Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directconnect: Migrate to AWS SDK v2 #37213

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
cc940ef
directconnect: Migrate to AWS SDK v2
mattburgess Apr 30, 2024
cc368ee
Merge branch 'main' into HEAD
ewbankkit Aug 1, 2024
a3116df
Run 'make fix-constants PKG=directconnect'.
ewbankkit Aug 1, 2024
b8fe757
Fix semgrep errors.
ewbankkit Aug 1, 2024
dd9ced1
r/aws_dx_bgp_peer: Tidy up.
ewbankkit Aug 1, 2024
5a16390
'directconnect/acc_test.go' -> 'directconnect/vif_test.go'.
ewbankkit Aug 2, 2024
0bdbc38
directconnect: Fix compilation errors (a3116df0862dc3631405f280386309…
ewbankkit Aug 2, 2024
3c2a05a
r/aws_dx_connection: Migrate to AWS SDK for Go v2.
ewbankkit Aug 2, 2024
85a2cbd
r/aws_dx_connection_association: Tidy up.
ewbankkit Aug 2, 2024
60af88d
d/aws_dx_connection: Tidy up.
ewbankkit Aug 4, 2024
945fcdf
r/aws_dx_connection_confirmation: Tidy up.
ewbankkit Aug 4, 2024
e1e0e45
r/aws_dx_gateway: Tidy up.
ewbankkit Aug 4, 2024
9c18db3
d/aws_dx_gateway: Tidy up.
ewbankkit Aug 4, 2024
ec8e34a
d/aws_dx_gateway_association: Tidy up.
ewbankkit Aug 4, 2024
9036aff
r/aws_dx_gateway_association_proposal: Tidy up.
ewbankkit Aug 4, 2024
5e7c5a9
r/aws_dx_hosted_connection: Tidy up.
ewbankkit Aug 5, 2024
d4a3f10
r/aws_dx_hosted_private_virtual_interface: Tidy up.
ewbankkit Aug 6, 2024
6f3277f
r/aws_dx_hosted_private_virtual_interface_accepter: Tidy up.
ewbankkit Aug 6, 2024
e4f2bba
r/aws_dx_hosted_public_virtual_interface: Tidy up.
ewbankkit Aug 6, 2024
67e920d
r/aws_dx_hosted_transit_virtual_interface: Tidy up.
ewbankkit Aug 7, 2024
6afffb8
r/aws_dx_hosted_public_virtual_interface_accepter: Tidy up.
ewbankkit Aug 7, 2024
9a01170
r/aws_dx_hosted_transit_virtual_interface_accepter: Tidy up.
ewbankkit Aug 7, 2024
9175f57
r/aws_dx_lag: Tidy up.
ewbankkit Aug 7, 2024
784ae3d
d/aws_dx_location(s): Tidy up.
ewbankkit Aug 7, 2024
ef41f2b
r/aws_dx_macsec_key_association: Tidy up.
ewbankkit Aug 7, 2024
baf78ab
r/aws_dx_macsec_key_association: Correct source file names.
ewbankkit Aug 7, 2024
9acb515
r/aws_dx_private_virtual_interface: Tidy up.
ewbankkit Aug 7, 2024
37ce093
r/aws_dx_public_virtual_interface: Tidy up.
ewbankkit Aug 7, 2024
3b57b7a
r/aws_dx_transit_virtual_interface: Tidy up.
ewbankkit Aug 7, 2024
ff07267
d/aws_dx_router_configuration: Tidy up.
ewbankkit Aug 7, 2024
75ca632
Remove unused functions.
ewbankkit Aug 7, 2024
f8f34db
Add 'TestAccDirectConnectConnectionAssociation_disappears'.
ewbankkit Aug 7, 2024
7acd006
directconnect: Tidy up sweepers.
ewbankkit Aug 7, 2024
984843d
Fix compilation errors.
ewbankkit Aug 7, 2024
ad55671
Fix golangci-lint 'unparam'.
ewbankkit Aug 8, 2024
5101e3e
r/aws_dx_lag: Fix acceptance tests.
ewbankkit Aug 8, 2024
2841d35
Fix 'TestAccDirectConnectConnection_vlanIDMigration510'.
ewbankkit Aug 8, 2024
ecd06a1
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
34e3d15
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
9319944
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
9aff365
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
7d809a4
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
aa811da
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
180a0d1
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
7b7af6a
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
2367736
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
7caba11
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
9a9f2b7
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
8232b0f
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
5e46521
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
68b20e2
Replace '+ fmt.Sprintf' in acceptance tests with 'acctest.ConfigCompo…
ewbankkit Aug 8, 2024
da07ea1
Replace '+ ' in acceptance tests with 'acctest.ConfigCompose' - apiga…
ewbankkit Aug 8, 2024
e44a346
Replace '+ ' in acceptance tests with 'acctest.ConfigCompose' - batch.
ewbankkit Aug 8, 2024
01ab01b
Replace '+ ' in acceptance tests with 'acctest.ConfigCompose' - cogni…
ewbankkit Aug 8, 2024
db7bf6a
Replace '+ ' in acceptance tests with 'acctest.ConfigCompose' - ec2.
ewbankkit Aug 8, 2024
6abd556
Replace '+ ' in acceptance tests with 'acctest.ConfigCompose' - elbv2.
ewbankkit Aug 8, 2024
0f72bc4
Replace '+ ' in acceptance tests with 'acctest.ConfigCompose' - events.
ewbankkit Aug 8, 2024
644aa93
Replace '+ ' in acceptance tests with 'acctest.ConfigCompose' - ssm.
ewbankkit Aug 8, 2024
eb05751
Replace '+ ' in acceptance tests with 'acctest.ConfigCompose' - stora…
ewbankkit Aug 8, 2024
077fc89
Replace '+ ' in acceptance tests with 'acctest.ConfigCompose' - wafre…
ewbankkit Aug 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading