Skip to content

Commit

Permalink
Merge pull request #37213 from mattburgess/directconnect-awssdkv2-mig…
Browse files Browse the repository at this point in the history
…ration

directconnect: Migrate to AWS SDK v2
  • Loading branch information
ewbankkit authored Aug 8, 2024
2 parents a124281 + 077fc89 commit 0aba279
Show file tree
Hide file tree
Showing 96 changed files with 3,172 additions and 3,183 deletions.
3 changes: 3 additions & 0 deletions .changelog/37213.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_dx_macsec_key_association: Add plan-time validation of `secret_arn`
```
1 change: 1 addition & 0 deletions .ci/semgrep/migrate/context.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ rules:
- pattern-not: conn.Options()
- pattern-not: codestarconnections_sdkv2.$API()
- pattern-not: connectcases_sdkv2.$API()
- pattern-not: directconnect_sdkv2.$API()
- pattern-not: kafkaconnect_sdkv2.$API()
- pattern-not: mediaconnect_sdkv2.$API()
- pattern-not: pcaconnectorad_sdkv2.$API()
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/detective v1.29.3
github.com/aws/aws-sdk-go-v2/service/devicefarm v1.25.2
github.com/aws/aws-sdk-go-v2/service/devopsguru v1.32.3
github.com/aws/aws-sdk-go-v2/service/directconnect v1.27.5
github.com/aws/aws-sdk-go-v2/service/directoryservice v1.27.3
github.com/aws/aws-sdk-go-v2/service/dlm v1.26.3
github.com/aws/aws-sdk-go-v2/service/docdb v1.36.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ github.com/aws/aws-sdk-go-v2/service/devicefarm v1.25.2 h1:DSv0r8nKo8+ix2h5Rz/Zl
github.com/aws/aws-sdk-go-v2/service/devicefarm v1.25.2/go.mod h1:7Ev/BlW5/zbURomHu/2Ay8l/HAgoQAbaSP2XlMUED9I=
github.com/aws/aws-sdk-go-v2/service/devopsguru v1.32.3 h1:dVk+ogfz83rhZLaWSwSbgTQnxno+DIhZ3Q3KFdxTVmA=
github.com/aws/aws-sdk-go-v2/service/devopsguru v1.32.3/go.mod h1:Rbgi0LKyAIyWHlqVtgU5wy39omdfHHvlGjrl+Vg41us=
github.com/aws/aws-sdk-go-v2/service/directconnect v1.27.5 h1:waoTf1hh2njzovjQm35YI/NgzBJ6MFh38V1D06m3ZSw=
github.com/aws/aws-sdk-go-v2/service/directconnect v1.27.5/go.mod h1:pPYhajQqE5gRnRVzTE6ptT0BCl603tkBc8YgLxsHMSo=
github.com/aws/aws-sdk-go-v2/service/directoryservice v1.27.3 h1:Ua8NLsRNDm/HSotawG9MjeUEdo88uuTsEJ+EQB99G7c=
github.com/aws/aws-sdk-go-v2/service/directoryservice v1.27.3/go.mod h1:DeGGGnrVVVNQlfMpAqmIiEndGTlDVbUIzNI4MbyyH68=
github.com/aws/aws-sdk-go-v2/service/dlm v1.26.3 h1:LAZoBLsYn4eSTzJlfIu+v/+EHzqLqkPlIIc+y36HgEA=
Expand Down
6 changes: 3 additions & 3 deletions internal/conns/awsclient_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions internal/service/apigatewayv2/integration_response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,17 @@ func testAccIntegrationResponseImportStateIdFunc(resourceName string) resource.I
}

func testAccIntegrationResponseConfig_basic(rName string) string {
return testAccIntegrationConfig_basic(rName) + `
return acctest.ConfigCompose(testAccIntegrationConfig_basic(rName), `
resource "aws_apigatewayv2_integration_response" "test" {
api_id = aws_apigatewayv2_api.test.id
integration_id = aws_apigatewayv2_integration.test.id
integration_response_key = "/200/"
}
`
`)
}

func testAccIntegrationResponseConfig_allAttributes(rName string) string {
return testAccIntegrationConfig_basic(rName) + `
return acctest.ConfigCompose(testAccIntegrationConfig_basic(rName), `
resource "aws_apigatewayv2_integration_response" "test" {
api_id = aws_apigatewayv2_api.test.id
integration_id = aws_apigatewayv2_integration.test.id
Expand All @@ -212,11 +212,11 @@ resource "aws_apigatewayv2_integration_response" "test" {
"application/json" = ""
}
}
`
`)
}

func testAccIntegrationResponseConfig_allAttributesUpdated(rName string) string {
return testAccIntegrationConfig_basic(rName) + `
return acctest.ConfigCompose(testAccIntegrationConfig_basic(rName), `
resource "aws_apigatewayv2_integration_response" "test" {
api_id = aws_apigatewayv2_api.test.id
integration_id = aws_apigatewayv2_integration.test.id
Expand All @@ -230,5 +230,5 @@ resource "aws_apigatewayv2_integration_response" "test" {
"application/xml" = "#set($percent=$number/100)"
}
}
`
`)
}
8 changes: 4 additions & 4 deletions internal/service/apigatewayv2/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,24 +255,24 @@ resource "aws_apigatewayv2_api" "test" {
}

func testAccModelConfig_basic(rName, schema string) string {
return testAccModelConfig_api(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccModelConfig_api(rName), fmt.Sprintf(`
resource "aws_apigatewayv2_model" "test" {
api_id = aws_apigatewayv2_api.test.id
content_type = "application/json"
name = %[1]q
schema = %[2]q
}
`, rName, schema)
`, rName, schema))
}

func testAccModelConfig_allAttributes(rName, schema string) string {
return testAccModelConfig_api(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccModelConfig_api(rName), fmt.Sprintf(`
resource "aws_apigatewayv2_model" "test" {
api_id = aws_apigatewayv2_api.test.id
content_type = "text/x-json"
name = %[1]q
description = "test"
schema = %[2]q
}
`, rName, schema)
`, rName, schema))
}
8 changes: 4 additions & 4 deletions internal/service/appautoscaling/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ resource "aws_ecs_service" "test2" {
}

func testAccPolicyConfig_resourceIDForceNew1(rName string) string {
return testAccPolicyConfig_resourceIDForceNewBase(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccPolicyConfig_resourceIDForceNewBase(rName), fmt.Sprintf(`
resource "aws_appautoscaling_target" "test" {
max_capacity = 4
min_capacity = 0
Expand Down Expand Up @@ -1190,11 +1190,11 @@ resource "aws_cloudwatch_metric_alarm" "test" {
ClusterName = aws_ecs_cluster.test.name
}
}
`, rName)
`, rName))
}

func testAccPolicyConfig_resourceIDForceNew2(rName string) string {
return testAccPolicyConfig_resourceIDForceNewBase(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccPolicyConfig_resourceIDForceNewBase(rName), fmt.Sprintf(`
resource "aws_appautoscaling_target" "test" {
max_capacity = 4
min_capacity = 0
Expand Down Expand Up @@ -1239,7 +1239,7 @@ resource "aws_cloudwatch_metric_alarm" "test" {
ClusterName = aws_ecs_cluster.test.name
}
}
`, rName)
`, rName))
}

func testAccPolicyImportStateIdFunc(resourceName string) resource.ImportStateIdFunc {
Expand Down
2 changes: 1 addition & 1 deletion internal/service/appsync/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ EOF
}

func testAccResolverConfig_sync(rName string) string {
return acctest.ConfigCompose(testAccDatasourceConfig_baseDynamoDB(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccDatasourceConfig_baseDynamoDB(rName), fmt.Sprintf(`
resource "aws_appsync_graphql_api" "test" {
authentication_type = "API_KEY"
name = %[1]q
Expand Down
4 changes: 2 additions & 2 deletions internal/service/backup/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ resource "aws_backup_plan" "test" {
}

func testAccPlanConfig_ruleCopyActionCrossRegion(rName string) string {
return acctest.ConfigAlternateRegionProvider() + fmt.Sprintf(`
return acctest.ConfigCompose(acctest.ConfigAlternateRegionProvider(), fmt.Sprintf(`
resource "aws_backup_vault" "test" {
name = "%[1]s-1"
}
Expand Down Expand Up @@ -1095,7 +1095,7 @@ resource "aws_backup_plan" "test" {
}
}
}
`, rName)
`, rName))
}

func testAccPlanConfig_ruleCopyActionNoLifecycle(rName string) string {
Expand Down
4 changes: 2 additions & 2 deletions internal/service/batch/scheduling_policy_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestAccBatchSchedulingPolicyDataSource_basic(t *testing.T) {
})
}

func testAccSchedulingPolicyDataSourceConfig(rName string) string {
func testAccSchedulingPolicyDataSourceConfig_base(rName string) string {
return fmt.Sprintf(`
resource "aws_batch_scheduling_policy" "test" {
name = %[1]q
Expand All @@ -69,7 +69,7 @@ resource "aws_batch_scheduling_policy" "test" {
}

func testAccSchedulingPolicyDataSourceConfig_basic(rName string) string {
return fmt.Sprintf(testAccSchedulingPolicyDataSourceConfig(rName) + `
return acctest.ConfigCompose(testAccSchedulingPolicyDataSourceConfig_base(rName), `
data "aws_batch_scheduling_policy" "test" {
arn = aws_batch_scheduling_policy.test.arn
}
Expand Down
16 changes: 8 additions & 8 deletions internal/service/codeartifact/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ resource "aws_codeartifact_repository" "test" {
}

func testAccRepositoryConfig_upstreams2(rName string) string {
return testAccRepositoryConfig_base(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccRepositoryConfig_base(rName), fmt.Sprintf(`
resource "aws_codeartifact_repository" "upstream1" {
repository = "%[1]s-upstream1"
domain = aws_codeartifact_domain.test.domain
Expand All @@ -407,11 +407,11 @@ resource "aws_codeartifact_repository" "test" {
repository_name = aws_codeartifact_repository.upstream2.repository
}
}
`, rName)
`, rName))
}

func testAccRepositoryConfig_externalConnection(rName string) string {
return testAccRepositoryConfig_base(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccRepositoryConfig_base(rName), fmt.Sprintf(`
resource "aws_codeartifact_repository" "test" {
repository = %[1]q
domain = aws_codeartifact_domain.test.domain
Expand All @@ -420,11 +420,11 @@ resource "aws_codeartifact_repository" "test" {
external_connection_name = "public:npmjs"
}
}
`, rName)
`, rName))
}

func testAccRepositoryConfig_tags1(rName, tagKey1, tagValue1 string) string {
return testAccRepositoryConfig_base(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccRepositoryConfig_base(rName), fmt.Sprintf(`
resource "aws_codeartifact_repository" "test" {
repository = %[1]q
domain = aws_codeartifact_domain.test.domain
Expand All @@ -433,11 +433,11 @@ resource "aws_codeartifact_repository" "test" {
%[2]q = %[3]q
}
}
`, rName, tagKey1, tagValue1)
`, rName, tagKey1, tagValue1))
}

func testAccRepositoryConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string {
return testAccRepositoryConfig_base(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccRepositoryConfig_base(rName), fmt.Sprintf(`
resource "aws_codeartifact_repository" "test" {
repository = %[1]q
domain = aws_codeartifact_domain.test.domain
Expand All @@ -447,5 +447,5 @@ resource "aws_codeartifact_repository" "test" {
%[4]q = %[5]q
}
}
`, rName, tagKey1, tagValue1, tagKey2, tagValue2)
`, rName, tagKey1, tagValue1, tagKey2, tagValue2))
}
14 changes: 7 additions & 7 deletions internal/service/cognitoidentity/pool_roles_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func testAccCheckPoolRolesAttachmentDestroy(ctx context.Context) resource.TestCh
}
}

func testAccPoolRolesAttachmentConfig(name string) string {
func testAccPoolRolesAttachmentConfig_base(name string) string {
return fmt.Sprintf(`
resource "aws_cognito_identity_pool" "main" {
identity_pool_name = "identity pool %[1]s"
Expand Down Expand Up @@ -356,7 +356,7 @@ EOF
}

func testAccPoolRolesAttachmentConfig_basic(name string) string {
return fmt.Sprintf(testAccPoolRolesAttachmentConfig(name) + `
return acctest.ConfigCompose(testAccPoolRolesAttachmentConfig_base(name), `
resource "aws_cognito_identity_pool_roles_attachment" "test" {
identity_pool_id = aws_cognito_identity_pool.main.id
Expand All @@ -368,7 +368,7 @@ resource "aws_cognito_identity_pool_roles_attachment" "test" {
}

func testAccPoolRolesAttachmentConfig_roleMappings(name string) string {
return fmt.Sprintf(testAccPoolRolesAttachmentConfig(name) + `
return acctest.ConfigCompose(testAccPoolRolesAttachmentConfig_base(name), `
resource "aws_cognito_identity_pool_roles_attachment" "test" {
identity_pool_id = aws_cognito_identity_pool.main.id
Expand All @@ -393,7 +393,7 @@ resource "aws_cognito_identity_pool_roles_attachment" "test" {
}

func testAccPoolRolesAttachmentConfig_roleMappingsUpdated(name string) string {
return fmt.Sprintf(testAccPoolRolesAttachmentConfig(name) + `
return acctest.ConfigCompose(testAccPoolRolesAttachmentConfig_base(name), `
resource "aws_cognito_identity_pool_roles_attachment" "test" {
identity_pool_id = aws_cognito_identity_pool.main.id
Expand Down Expand Up @@ -425,7 +425,7 @@ resource "aws_cognito_identity_pool_roles_attachment" "test" {
}

func testAccPoolRolesAttachmentConfig_roleMappingsWithAmbiguousRoleResolutionError(name string) string {
return fmt.Sprintf(testAccPoolRolesAttachmentConfig(name) + `
return acctest.ConfigCompose(testAccPoolRolesAttachmentConfig_base(name), `
resource "aws_cognito_identity_pool_roles_attachment" "test" {
identity_pool_id = aws_cognito_identity_pool.main.id
Expand All @@ -449,7 +449,7 @@ resource "aws_cognito_identity_pool_roles_attachment" "test" {
}

func testAccPoolRolesAttachmentConfig_roleMappingsWithRulesTypeError(name string) string {
return fmt.Sprintf(testAccPoolRolesAttachmentConfig(name) + `
return acctest.ConfigCompose(testAccPoolRolesAttachmentConfig_base(name), `
resource "aws_cognito_identity_pool_roles_attachment" "test" {
identity_pool_id = aws_cognito_identity_pool.main.id
Expand All @@ -467,7 +467,7 @@ resource "aws_cognito_identity_pool_roles_attachment" "test" {
}

func testAccPoolRolesAttachmentConfig_roleMappingsWithTokenTypeError(name string) string {
return fmt.Sprintf(testAccPoolRolesAttachmentConfig(name) + `
return acctest.ConfigCompose(testAccPoolRolesAttachmentConfig_base(name), `
resource "aws_cognito_identity_pool_roles_attachment" "test" {
identity_pool_id = aws_cognito_identity_pool.main.id
Expand Down
Loading

0 comments on commit 0aba279

Please sign in to comment.