From f5dc8899c87f120a3b428e243cbf1d9688575da6 Mon Sep 17 00:00:00 2001 From: Atsushi Ishibashi Date: Tue, 5 Dec 2017 00:51:28 +0900 Subject: [PATCH] Add ConflictsWith to email_message and etc --- aws/resource_aws_cognito_user_pool.go | 36 ++++++++++++---------- aws/resource_aws_cognito_user_pool_test.go | 2 -- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/aws/resource_aws_cognito_user_pool.go b/aws/resource_aws_cognito_user_pool.go index 4e9899d7cce5..36f631ca2347 100644 --- a/aws/resource_aws_cognito_user_pool.go +++ b/aws/resource_aws_cognito_user_pool.go @@ -137,17 +137,19 @@ func resourceAwsCognitoUserPool() *schema.Resource { }, "email_verification_subject": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateCognitoUserPoolEmailVerificationSubject, + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validateCognitoUserPoolEmailVerificationSubject, + ConflictsWith: []string{"verification_message_template.0.email_subject"}, }, "email_verification_message": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateCognitoUserPoolEmailVerificationMessage, + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validateCognitoUserPoolEmailVerificationMessage, + ConflictsWith: []string{"verification_message_template.0.email_message"}, }, "lambda_config": { @@ -385,10 +387,11 @@ func resourceAwsCognitoUserPool() *schema.Resource { ValidateFunc: validateCognitoUserPoolTemplateDefaultEmailOption, }, "email_message": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateCognitoUserPoolTemplateEmailMessage, + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validateCognitoUserPoolTemplateEmailMessage, + ConflictsWith: []string{"email_verification_message"}, }, "email_message_by_link": { Type: schema.TypeString, @@ -397,10 +400,11 @@ func resourceAwsCognitoUserPool() *schema.Resource { ValidateFunc: validateCognitoUserPoolTemplateEmailMessageByLink, }, "email_subject": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateCognitoUserPoolTemplateEmailSubject, + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validateCognitoUserPoolTemplateEmailSubject, + ConflictsWith: []string{"email_verification_subject"}, }, "email_subject_by_link": { Type: schema.TypeString, diff --git a/aws/resource_aws_cognito_user_pool_test.go b/aws/resource_aws_cognito_user_pool_test.go index dc7a4cbc5dd9..464a127e2393 100644 --- a/aws/resource_aws_cognito_user_pool_test.go +++ b/aws/resource_aws_cognito_user_pool_test.go @@ -923,9 +923,7 @@ resource "aws_cognito_user_pool" "pool" { # attributes. verification_message_template { default_email_option = "CONFIRM_WITH_LINK" - email_message = "Foo {####} Bar" email_message_by_link = "{##foobar##}" - email_subject = "FooBar {####}" email_subject_by_link = "foobar" sms_message = "{####} Baz" }