From 146ef076c174f2261b985605ef3acb669c4dd939 Mon Sep 17 00:00:00 2001 From: James Reed Date: Wed, 7 Sep 2022 09:18:38 +0100 Subject: [PATCH 01/14] add sns_region to sms_configuration on cognito user_pool --- examples/cognito-user-pool/main.tf | 1 + internal/service/cognitoidp/user_pool.go | 13 +++++++++++++ website/docs/r/cognito_user_pool.markdown | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/examples/cognito-user-pool/main.tf b/examples/cognito-user-pool/main.tf index bc559e6ea94..4d56cd13488 100644 --- a/examples/cognito-user-pool/main.tf +++ b/examples/cognito-user-pool/main.tf @@ -148,6 +148,7 @@ resource "aws_cognito_user_pool" "pool" { sms_configuration { external_id = "12345" sns_caller_arn = aws_iam_role.cidp.arn + sns_region = "us-east-1" } tags = { diff --git a/internal/service/cognitoidp/user_pool.go b/internal/service/cognitoidp/user_pool.go index 93bc1104f27..161f4323efb 100644 --- a/internal/service/cognitoidp/user_pool.go +++ b/internal/service/cognitoidp/user_pool.go @@ -463,6 +463,11 @@ func ResourceUserPool() *schema.Resource { Required: true, ValidateFunc: verify.ValidARN, }, + "sns_region": { + Type: schema.TypeString, + Required: false, + ValidateFunc: verify.ValidRegionName, + }, }, }, }, @@ -1230,6 +1235,10 @@ func expandSMSConfiguration(tfList []interface{}) *cognitoidentityprovider.SmsCo apiObject.SnsCallerArn = aws.String(v) } + if v, ok := tfMap["sns_region"].(string); ok && v != "" { + apiObject.SnsRegion = aws.String(v) + } + return apiObject } @@ -1264,6 +1273,10 @@ func flattenSMSConfiguration(apiObject *cognitoidentityprovider.SmsConfiguration tfMap["sns_caller_arn"] = aws.StringValue(v) } + if v := apiObject.SnsRegion; v != nil { + tfMap["sns_region"] = aws.StringValue(v) + } + return []interface{}{tfMap} } diff --git a/website/docs/r/cognito_user_pool.markdown b/website/docs/r/cognito_user_pool.markdown index 20b4615effd..d2a7b5ee193 100644 --- a/website/docs/r/cognito_user_pool.markdown +++ b/website/docs/r/cognito_user_pool.markdown @@ -32,6 +32,7 @@ resource "aws_cognito_user_pool" "example" { sms_configuration { external_id = "example" sns_caller_arn = aws_iam_role.example.arn + sns_region = "us-east-1" } software_token_mfa_configuration { @@ -203,6 +204,9 @@ resource "aws_cognito_user_pool" "example" { * `external_id` - (Required) External ID used in IAM role trust relationships. For more information about using external IDs, see [How to Use an External ID When Granting Access to Your AWS Resources to a Third Party](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html). * `sns_caller_arn` - (Required) ARN of the Amazon SNS caller. This is usually the IAM role that you've given Cognito permission to assume. +* `sns_region` - (Optional) The AWS Region to use with Amazon SNS integration. You can choose the same Region as your user pool, or a supported Legacy Amazon SNS alternate Region. Amazon Cognito resources in the Asia Pacific (Seoul) AWS Region must use your Amazon SNS configuration in the Asia Pacific (Tokyo) Region. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html). + + ### software_token_mfa_configuration From d0a42d4cc2c9cc37b791c1064210d2d83906c795 Mon Sep 17 00:00:00 2001 From: James Reed Date: Wed, 7 Sep 2022 13:00:09 +0100 Subject: [PATCH 02/14] fix required vs optional, add test but not quite working --- internal/service/cognitoidp/user_pool.go | 2 +- internal/service/cognitoidp/user_pool_test.go | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/internal/service/cognitoidp/user_pool.go b/internal/service/cognitoidp/user_pool.go index 161f4323efb..baea0c22f41 100644 --- a/internal/service/cognitoidp/user_pool.go +++ b/internal/service/cognitoidp/user_pool.go @@ -465,7 +465,7 @@ func ResourceUserPool() *schema.Resource { }, "sns_region": { Type: schema.TypeString, - Required: false, + Optional: true, ValidateFunc: verify.ValidRegionName, }, }, diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 4a893031677..874889f7cf8 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -603,6 +603,35 @@ func TestAccCognitoIDPUserPool_sms(t *testing.T) { }) } +func TestAccCognitoIDPUserPool_SMS_snsRegion(t *testing.T) { + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + iamRoleResourceName := "aws_iam_role.test" + resourceName := "aws_cognito_user_pool.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(t) }, + ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckUserPoolDestroy, + Steps: []resource.TestStep{ + { + Config: testAccUserPoolConfig_smsConfigurationSnsRegion(rName, "us-east-1"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "mfa_configuration", "OFF"), + resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "sms_configuration.0.sns_region", "foobar"), + resource.TestCheckResourceAttrPair(resourceName, "sms_configuration.0.sns_caller_arn", iamRoleResourceName, "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccCognitoIDPUserPool_SMS_externalID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) iamRoleResourceName := "aws_iam_role.test" @@ -1691,6 +1720,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn + sns_region = "us-east-1" } } `, rName) @@ -1705,6 +1735,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn + sns_region = "us-east-1" } software_token_mfa_configuration { @@ -1744,11 +1775,26 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = %[2]q sns_caller_arn = aws_iam_role.test.arn + sns_region = "us-east-1" } } `, rName, externalID) } +func testAccUserPoolConfig_smsConfigurationSnsRegion(rName string, snsRegion string) string { + return testAccUserPoolSMSConfigurationBaseConfig(rName, snsRegion) + fmt.Sprintf(` +resource "aws_cognito_user_pool" "test" { + name = %[1]q + + sms_configuration { + external_id = "test" + sns_caller_arn = aws_iam_role.test.arn + sns_region = %[2]q + } +} +`, rName, snsRegion) +} + func testAccUserPoolConfig_smsConfigurationSNSCallerARN2(rName string) string { return testAccUserPoolSMSConfigurationBaseConfig(rName+"-2", "test") + fmt.Sprintf(` resource "aws_cognito_user_pool" "test" { @@ -1757,6 +1803,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn + sns_region = "us-east-1" } } `, rName) @@ -2335,6 +2382,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = data.aws_caller_identity.current.account_id sns_caller_arn = aws_iam_role.test.arn + sns_region = "us-east-1" } } `, name, mfaconfig, smsAuthMsg) From 634efd444ba845faefb35ff71af25a6918b715be Mon Sep 17 00:00:00 2001 From: James Reed Date: Wed, 7 Sep 2022 13:04:18 +0100 Subject: [PATCH 03/14] add changelog file --- .changelog/26684.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/26684.txt diff --git a/.changelog/26684.txt b/.changelog/26684.txt new file mode 100644 index 00000000000..8acc7ab9e7a --- /dev/null +++ b/.changelog/26684.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/cognitoidp/user_pool: Add sns_region to sms_configuration +``` \ No newline at end of file From 608208e8b8cb62c6176738c4d85c425595ce4ff5 Mon Sep 17 00:00:00 2001 From: James Reed Date: Wed, 7 Sep 2022 13:12:08 +0100 Subject: [PATCH 04/14] fix tabs in wrong places --- internal/service/cognitoidp/user_pool_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 874889f7cf8..d075804a102 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -1720,7 +1720,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" + sns_region = "us-east-1" } } `, rName) @@ -1735,7 +1735,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" + sns_region = "us-east-1" } software_token_mfa_configuration { @@ -1775,7 +1775,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = %[2]q sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" + sns_region = "us-east-1" } } `, rName, externalID) @@ -1789,7 +1789,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn - sns_region = %[2]q + sns_region = %[2]q } } `, rName, snsRegion) @@ -1803,7 +1803,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" + sns_region = "us-east-1" } } `, rName) @@ -2382,7 +2382,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = data.aws_caller_identity.current.account_id sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" + sns_region = "us-east-1" } } `, name, mfaconfig, smsAuthMsg) From 449c01eb7ab3f6406213e68fefd2540de23e6828 Mon Sep 17 00:00:00 2001 From: James Reed Date: Wed, 7 Sep 2022 13:13:18 +0100 Subject: [PATCH 05/14] fix tabs in wrong places --- internal/service/cognitoidp/user_pool_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index d075804a102..ba9f60c9714 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -1775,7 +1775,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = %[2]q sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" + sns_region = "us-east-1" } } `, rName, externalID) @@ -2382,7 +2382,7 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = data.aws_caller_identity.current.account_id sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" + sns_region = "us-east-1" } } `, name, mfaconfig, smsAuthMsg) From 34da2b4fe8f523c2c0edc88ba28ca576d3e17f5f Mon Sep 17 00:00:00 2001 From: James Reed <109068236+ReedSoftware@users.noreply.github.com> Date: Tue, 13 Sep 2022 10:56:09 +0100 Subject: [PATCH 06/14] Update internal/service/cognitoidp/user_pool_test.go Co-authored-by: Matthew Burgess <549318+mattburgess@users.noreply.github.com> --- internal/service/cognitoidp/user_pool_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index ba9f60c9714..2e14e345ff6 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -1782,7 +1782,7 @@ resource "aws_cognito_user_pool" "test" { } func testAccUserPoolConfig_smsConfigurationSnsRegion(rName string, snsRegion string) string { - return testAccUserPoolSMSConfigurationBaseConfig(rName, snsRegion) + fmt.Sprintf(` + return testAccUserPoolSMSConfigurationBaseConfig(rName, "test") + fmt.Sprintf(` resource "aws_cognito_user_pool" "test" { name = %[1]q From 238e067dc5d4898cc9f6423cba4b89771c6e73f1 Mon Sep 17 00:00:00 2001 From: James Reed <109068236+ReedSoftware@users.noreply.github.com> Date: Tue, 13 Sep 2022 10:56:21 +0100 Subject: [PATCH 07/14] Update internal/service/cognitoidp/user_pool_test.go Co-authored-by: Matthew Burgess <549318+mattburgess@users.noreply.github.com> --- internal/service/cognitoidp/user_pool_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 2e14e345ff6..6b717449133 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -619,7 +619,7 @@ func TestAccCognitoIDPUserPool_SMS_snsRegion(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "mfa_configuration", "OFF"), resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "sms_configuration.0.sns_region", "foobar"), + resource.TestCheckResourceAttr(resourceName, "sms_configuration.0.sns_region", acctest.Region()), resource.TestCheckResourceAttrPair(resourceName, "sms_configuration.0.sns_caller_arn", iamRoleResourceName, "arn"), ), }, From 484da61a9c064f5bfb662bb2ae69d260afefcc30 Mon Sep 17 00:00:00 2001 From: James Reed <109068236+ReedSoftware@users.noreply.github.com> Date: Tue, 13 Sep 2022 10:56:29 +0100 Subject: [PATCH 08/14] Update internal/service/cognitoidp/user_pool_test.go Co-authored-by: Matthew Burgess <549318+mattburgess@users.noreply.github.com> --- internal/service/cognitoidp/user_pool_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 6b717449133..1f4eb9f56b2 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -615,7 +615,7 @@ func TestAccCognitoIDPUserPool_SMS_snsRegion(t *testing.T) { CheckDestroy: testAccCheckUserPoolDestroy, Steps: []resource.TestStep{ { - Config: testAccUserPoolConfig_smsConfigurationSnsRegion(rName, "us-east-1"), + Config: testAccUserPoolConfig_smsConfigurationSnsRegion(rName, acctest.Region()), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "mfa_configuration", "OFF"), resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "1"), From 861440824e7fb7567d9c96499c1e6ed1f3b75b54 Mon Sep 17 00:00:00 2001 From: James Reed Date: Tue, 13 Sep 2022 14:16:30 +0100 Subject: [PATCH 09/14] remove region from other tests - not needed --- examples/cognito-user-pool/main.tf | 1 - internal/service/cognitoidp/user_pool_test.go | 5 ----- 2 files changed, 6 deletions(-) diff --git a/examples/cognito-user-pool/main.tf b/examples/cognito-user-pool/main.tf index 4d56cd13488..bc559e6ea94 100644 --- a/examples/cognito-user-pool/main.tf +++ b/examples/cognito-user-pool/main.tf @@ -148,7 +148,6 @@ resource "aws_cognito_user_pool" "pool" { sms_configuration { external_id = "12345" sns_caller_arn = aws_iam_role.cidp.arn - sns_region = "us-east-1" } tags = { diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 1f4eb9f56b2..43b7d9409fc 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -1720,7 +1720,6 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" } } `, rName) @@ -1735,7 +1734,6 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" } software_token_mfa_configuration { @@ -1775,7 +1773,6 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = %[2]q sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" } } `, rName, externalID) @@ -1803,7 +1800,6 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = "test" sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" } } `, rName) @@ -2382,7 +2378,6 @@ resource "aws_cognito_user_pool" "test" { sms_configuration { external_id = data.aws_caller_identity.current.account_id sns_caller_arn = aws_iam_role.test.arn - sns_region = "us-east-1" } } `, name, mfaconfig, smsAuthMsg) From 74ad40ccf7f97e715b8c1dd5c298d8c8074fd77c Mon Sep 17 00:00:00 2001 From: James Reed <109068236+ReedSoftware@users.noreply.github.com> Date: Tue, 13 Sep 2022 14:58:33 +0100 Subject: [PATCH 10/14] Update internal/service/cognitoidp/user_pool.go Co-authored-by: Matthew Burgess <549318+mattburgess@users.noreply.github.com> --- internal/service/cognitoidp/user_pool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/cognitoidp/user_pool.go b/internal/service/cognitoidp/user_pool.go index baea0c22f41..6284d2a5755 100644 --- a/internal/service/cognitoidp/user_pool.go +++ b/internal/service/cognitoidp/user_pool.go @@ -466,6 +466,7 @@ func ResourceUserPool() *schema.Resource { "sns_region": { Type: schema.TypeString, Optional: true, + Computed: true, ValidateFunc: verify.ValidRegionName, }, }, From 1123b6a051e82898e9f69fbec7b89d6798bcb0d4 Mon Sep 17 00:00:00 2001 From: James Reed Date: Tue, 13 Sep 2022 15:39:39 +0100 Subject: [PATCH 11/14] fix Sns vs SNS --- internal/service/cognitoidp/user_pool_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 43b7d9409fc..962d2e0ac67 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -615,7 +615,7 @@ func TestAccCognitoIDPUserPool_SMS_snsRegion(t *testing.T) { CheckDestroy: testAccCheckUserPoolDestroy, Steps: []resource.TestStep{ { - Config: testAccUserPoolConfig_smsConfigurationSnsRegion(rName, acctest.Region()), + Config: testAccUserPoolConfig_smsConfigurationSNSRegion(rName, acctest.Region()), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "mfa_configuration", "OFF"), resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "1"), @@ -1778,7 +1778,7 @@ resource "aws_cognito_user_pool" "test" { `, rName, externalID) } -func testAccUserPoolConfig_smsConfigurationSnsRegion(rName string, snsRegion string) string { +func testAccUserPoolConfig_smsConfigurationSNSRegion(rName string, snsRegion string) string { return testAccUserPoolSMSConfigurationBaseConfig(rName, "test") + fmt.Sprintf(` resource "aws_cognito_user_pool" "test" { name = %[1]q From 2c4afac5bd336d1449c53ba4f5679360f3c85a87 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 15 Nov 2022 08:03:03 -0500 Subject: [PATCH 12/14] Update 26684.txt --- .changelog/26684.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changelog/26684.txt b/.changelog/26684.txt index 8acc7ab9e7a..d3f7f16c0a2 100644 --- a/.changelog/26684.txt +++ b/.changelog/26684.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/cognitoidp/user_pool: Add sns_region to sms_configuration -``` \ No newline at end of file +resource/aws_cognito_user_pool: Add `sns_region` attribute to `sms_configuration` block +``` From 8675c3a737527299f179064a44dbe3587c538013 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 15 Nov 2022 08:29:34 -0500 Subject: [PATCH 13/14] markdown-lint: Fix 'MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]'. --- website/docs/r/cognito_user_pool.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/docs/r/cognito_user_pool.markdown b/website/docs/r/cognito_user_pool.markdown index 64c15ad89df..931ed419a90 100644 --- a/website/docs/r/cognito_user_pool.markdown +++ b/website/docs/r/cognito_user_pool.markdown @@ -208,8 +208,6 @@ resource "aws_cognito_user_pool" "example" { * `sns_caller_arn` - (Required) ARN of the Amazon SNS caller. This is usually the IAM role that you've given Cognito permission to assume. * `sns_region` - (Optional) The AWS Region to use with Amazon SNS integration. You can choose the same Region as your user pool, or a supported Legacy Amazon SNS alternate Region. Amazon Cognito resources in the Asia Pacific (Seoul) AWS Region must use your Amazon SNS configuration in the Asia Pacific (Tokyo) Region. For more information, see [SMS message settings for Amazon Cognito user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html). - - ### software_token_mfa_configuration The following arguments are required in the `software_token_mfa_configuration` configuration block: From c7c6d98c038e07961d35eeff0090ef28e0fa6c9e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 15 Nov 2022 08:31:11 -0500 Subject: [PATCH 14/14] r/aws_cognito_user_pool: Fixup 'testAccUserPoolConfig_smsConfigurationSNSRegion'. --- internal/service/cognitoidp/user_pool_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 2a7ebddca41..3c727c0f5ca 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -1858,7 +1858,7 @@ resource "aws_cognito_user_pool" "test" { } func testAccUserPoolConfig_smsConfigurationSNSRegion(rName string, snsRegion string) string { - return testAccUserPoolSMSConfigurationBaseConfig(rName, "test") + fmt.Sprintf(` + return acctest.ConfigCompose(testAccUserPoolSMSConfigurationConfig_base(rName, "test"), fmt.Sprintf(` resource "aws_cognito_user_pool" "test" { name = %[1]q @@ -1868,7 +1868,7 @@ resource "aws_cognito_user_pool" "test" { sns_region = %[2]q } } -`, rName, snsRegion) +`, rName, snsRegion)) } func testAccUserPoolConfig_smsConfigurationSNSCallerARN2(rName string) string {