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

Migrate remaining EC2 service resources to AWS SDK V2 #38363

Merged
merged 204 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
2663d84
feat: migrated r/vpc_default_security_group to sdkv2
DanielRieske Jul 12, 2024
436996c
feat: migrated r/vpc_security_group to sdkv2
DanielRieske Jul 12, 2024
debb045
fix: `testAccCheckDefaultSecurityGroupARN` references
DanielRieske Jul 12, 2024
7273158
feat: migrate r/vpc_default_subnet to sdkv2
DanielRieske Jul 12, 2024
6c23c59
feat: migrate last ec2 function from r/efs_mount_target to sdkv2
DanielRieske Jul 12, 2024
b1b5743
chore: reduced visibility
DanielRieske Jul 12, 2024
f354e23
feat: migrated r/vpc_default_vpc_dhcp_options to sdkv2
DanielRieske Jul 12, 2024
a6f797e
feat: migrated tests from r/vpc_default to sdkv2
DanielRieske Jul 12, 2024
bf82f2b
feat: add string value variant for flex string values
DanielRieske Jul 13, 2024
73f4455
feat: migrate r/common_model ec2 to SDKv2 package
DanielRieske Jul 13, 2024
0fde045
feat: migrate r/document_classifier ec2 to SDKv2 package
DanielRieske Jul 13, 2024
5ab284a
feat: migrate r/entity_recognizer ec2 to SDKv2 package
DanielRieske Jul 13, 2024
9a6a1bc
chore: refactor FindSubnetsV2 to FindSubnets
DanielRieske Jul 13, 2024
c982818
chore: reduce visibility r/verified_access_group
DanielRieske Jul 13, 2024
a377262
chore: migrate `FindNetworkACLByIDV2` to FindNetworkACLByID`
DanielRieske Jul 13, 2024
adc49db
chore: reduce visibility
DanielRieske Jul 13, 2024
58bea45
chore: reduce visibility on `securityGroupMigrateState`
DanielRieske Jul 13, 2024
2974144
feat: migrate d/vpc_dhcp_options to SDKv2
DanielRieske Jul 13, 2024
5d09e7c
feat: migrate r/vpc_dhcp_options to SDKv2
DanielRieske Jul 13, 2024
4a7dfcc
feat: migrate r/vpc_internet_gateway_attachment to SDKv2
DanielRieske Jul 13, 2024
d1eae73
feat: migrate r/vpc_internet_gateway to SDKv2
DanielRieske Jul 13, 2024
5702cce
feat: migrate r/vpc_ipv4_cidr_block_association to SDKv2
DanielRieske Jul 13, 2024
69bdbe6
feat: migrate d/vpc_internet_gateway to SDKv2
DanielRieske Jul 13, 2024
a4e7469
feat: migrate d/vpc_nat_gateway to SDKv2
DanielRieske Jul 13, 2024
04088ea
feat: migrate r/vpc_nat_gateway to SDKv2
DanielRieske Jul 13, 2024
a27bfaa
feat: migrate d/vpc_nat_gateways to SDKv2
DanielRieske Jul 13, 2024
9c35c30
feat: migrate r/vpc_network_acl_association to SDKv2
DanielRieske Jul 13, 2024
4891b0f
feat: migrate r/vpc_network_acl_rule to SDKv2
DanielRieske Jul 13, 2024
c0d53ce
feat: migrate r/vpc_network_acl to SDKv2
DanielRieske Jul 13, 2024
7df538f
feat: migrate d/vpc_network_acls to SDKv2
DanielRieske Jul 13, 2024
13445e5
feat: reduce visibility and migrate last CRUD r/vpc_network_interface…
DanielRieske Jul 13, 2024
f0fa55a
chore: reduce visibility
DanielRieske Jul 13, 2024
5119d95
feat: migrate r/vpc_network_interface_sg_attachment to SDKv2
DanielRieske Jul 13, 2024
cd05398
chore: refactor `FindNetworkInterfaceByIDV2` to `FindNetworkInterface…
DanielRieske Jul 13, 2024
b864605
feat: migrate d/vpc_network_interfaces to SDKv2
DanielRieske Jul 13, 2024
0164add
chore: reduce visibility r/vpc_network_performance_metric_subscription
DanielRieske Jul 13, 2024
4b5f03f
feat: migrate r/vpc_peering_connection_accepter to SDKv2
DanielRieske Jul 13, 2024
e1e2041
feat: migrate d/vpc_peering_connection to SDKv2
DanielRieske Jul 13, 2024
0dbb75b
feat: migrate r/vpc_peering_connection_options to SDKv2
DanielRieske Jul 13, 2024
d79b1fc
feat: migrate r/vpc_peering_connection to SDKv2
DanielRieske Jul 13, 2024
5c9743c
feat: migrate d/vpc_peering_connections to SDKv2
DanielRieske Jul 13, 2024
d7ffdb4
chore: reduce visibility d/prefix_list
DanielRieske Jul 13, 2024
a5d2d06
chore: reduce visibility d/route
DanielRieske Jul 13, 2024
4f5ed90
chore: reduce visibility d/route_table_association
DanielRieske Jul 13, 2024
64c9af2
chore: reduce visibility d/route_table
DanielRieske Jul 13, 2024
bce324b
chore: reduce visibility d/route_tables
DanielRieske Jul 13, 2024
2dfb9db
feat: migrated d/vpc_security_group to SDKv2
DanielRieske Jul 13, 2024
28c0730
feat: migrated r/vpc_security_group_egress_rule to SDKv2
DanielRieske Jul 13, 2024
2d6ba6e
feat: migrated r/vpc_security_group_ingress_rule to SDKv2
DanielRieske Jul 13, 2024
a57c66a
chore: reduce visibility securityGroupMigrateState
DanielRieske Jul 13, 2024
b8d57dc
feat: migrated d/vpc_security_group_rule to SDKv2
DanielRieske Jul 13, 2024
28d02a8
feat: migrated securityGroupRuleMigrateState to SDKv2
DanielRieske Jul 13, 2024
5773b63
feat: migrated r/vpc_security_group_rule to SDKv2
DanielRieske Jul 13, 2024
d6fc976
feat: migrated d/vpc_security_group_rules to SDKv2
DanielRieske Jul 13, 2024
f4fb8e5
feat: migrated tags test generated for r/vpc_security_group
DanielRieske Jul 13, 2024
5be256d
feat: migrated d/vpc_security_groups to SDKv2
DanielRieske Jul 13, 2024
d93072c
feat: migrated r/vpc_subnet_cidr_reservation to SDKv2
DanielRieske Jul 13, 2024
475cbb6
feat: migrated d/vpc_subnet to SDKv2
DanielRieske Jul 13, 2024
fea0b08
feat: migrated r/vpc_subnet to SDKv2
DanielRieske Jul 13, 2024
39a7f58
feat: migrated d/vpc_subnets to SDKv2
DanielRieske Jul 13, 2024
77582db
feat: migrated last ec2 references for r/elastic_beanstalk_environmen…
DanielRieske Jul 13, 2024
57ace0f
feat: migrated ec2 client in d/elb to SDKv2
DanielRieske Jul 13, 2024
0929693
feat: migrated ec2 client in r/elb to SDKv2
DanielRieske Jul 13, 2024
8f79d04
feat: migrate ec2 client in emr cluster tests to SDKv2
DanielRieske Jul 13, 2024
4062a91
feat: migrated ec2 client in global accelerator endpoint group to SDKv2
DanielRieske Jul 13, 2024
cdb38ef
feat: migrated ec2 client to SDKv2 in networkmonitor/prove to SDKv2
DanielRieske Jul 13, 2024
8806574
fix: export references
DanielRieske Jul 13, 2024
e4ae54c
feat: migrate find functions
DanielRieske Jul 13, 2024
ed28e4b
feat: migrate status functions
DanielRieske Jul 13, 2024
eed0c1f
feat: migrate wait functions
DanielRieske Jul 13, 2024
8e60582
feat: run `make gen`
DanielRieske Jul 13, 2024
966fd5e
feat: migrate r/vpc_dhcp_options_association to SDKv2
DanielRieske Jul 13, 2024
1d6dcdf
feat: reduce visibility `spotFleetRequestMigrateState`
DanielRieske Jul 13, 2024
cfa6160
feat: migrate d/serial_console_access tests to SDKv2
DanielRieske Jul 13, 2024
f47bd82
feat: migrate `find` functions and remove `v2` postfix
DanielRieske Jul 13, 2024
1b00f41
chore: reduce visibility
DanielRieske Jul 13, 2024
129f604
feat: migrate `status` functions and remove `v2` postfix
DanielRieske Jul 13, 2024
c7b0ca7
feat: migrate r/vpc_flow_log to SDKv2
DanielRieske Jul 13, 2024
9a4b3cc
feat: migrate r/vpc_egress_only_internet_gateway to SDKv2
DanielRieske Jul 13, 2024
91de1ce
feat: migrate r/vpc_ipv6_cidr_block_association to SDKv2
DanielRieske Jul 13, 2024
6d9dae6
chore: fix imports
DanielRieske Jul 13, 2024
aa7d843
feat: migrate d/vpc_managed_prefix_list to SDKv2
DanielRieske Jul 13, 2024
28a4fa3
feat: migrate d/vpc_managed_prefix_lists to SDKv2
DanielRieske Jul 13, 2024
e731f0c
feat: migrate r/vpc_managed_prefix_list_entry to SDKv2
DanielRieske Jul 13, 2024
99b3259
feat: migrate r/vpc_managed_prefix_list to SDKv2
DanielRieske Jul 13, 2024
274f355
feat: migrate r/vpc_peering_connection_options tests to SDKv2
DanielRieske Jul 13, 2024
1b9ae9f
feat: migrate d/vpcs to SDKv2
DanielRieske Jul 13, 2024
7ec8984
feat: migrate `wait` functions and remove `v2` postfix
DanielRieske Jul 13, 2024
461fc49
feat: run `make gen`
DanielRieske Jul 13, 2024
0217153
fix: fix exports for tests
DanielRieske Jul 13, 2024
08d9477
feat: migrate ec2 import on `errors` and remove `v2` postfixes
DanielRieske Jul 13, 2024
1f5d85b
feat: reduce visibility r/vpc_endpoint_connection_accepter
DanielRieske Jul 13, 2024
8240856
chore: reduce visibility on certain vpc resources
DanielRieske Jul 13, 2024
630ba2e
chore: reduce visibility r/verifiedaccess_endpoint
DanielRieske Jul 13, 2024
3302206
chore: reduce visibility r/verified_access_instance
DanielRieske Jul 13, 2024
09385e2
chore: reduce visibility r/verified_access_trust_provider
DanielRieske Jul 13, 2024
dfbe057
chore: reduce visibility r/verified_access_instance_trust_provider_at…
DanielRieske Jul 13, 2024
78fed88
chore: reduce visibility d/vpc
DanielRieske Jul 13, 2024
ffd5545
chore: reduce visibility d/vpc_endpoint
DanielRieske Jul 13, 2024
472a033
chore: reduce visibility d/endpoint_service
DanielRieske Jul 13, 2024
16e334e
chore: reduce visibility r/vpc_default and fix name
DanielRieske Jul 13, 2024
e4d27f1
chore: reduce visibility r/verified_access_instance_logging_configura…
DanielRieske Jul 13, 2024
58dc26e
chore: reduce visibility r/vpc_endpoint_connection_notification
DanielRieske Jul 13, 2024
6d5fed9
chore: reduce visibility and fix name r/vpc_endpoint_policy
DanielRieske Jul 13, 2024
586befb
chore: reduce visibility and fix name r/vpc_endpoint_route_table_asso…
DanielRieske Jul 13, 2024
8743bb5
chore: reduce visibility and fix name r/vpc_endpoint_security_group_a…
DanielRieske Jul 13, 2024
9c23e5a
chore: reduce visibility and fix name r/vpc_endpoint_subnet_association
DanielRieske Jul 13, 2024
1c2ef13
chore: run `make gen`
DanielRieske Jul 13, 2024
c9feed3
feat: remove redundant `tagv2` resources and remove `v2` on the tag r…
DanielRieske Jul 13, 2024
5703b8f
feat: migrate `CheckVPCExistsV2` to `CheckVPCExists`
DanielRieske Jul 13, 2024
ce00789
fix: several `sprintf` specifiers
DanielRieske Jul 13, 2024
3291968
fix: peering_connectiont `printf` specifier
DanielRieske Jul 13, 2024
691af56
feat: migrate all `filterV2` to `filter` resources
DanielRieske Jul 13, 2024
aa01e18
feat: migrate `testAccCheckENIExistsV2` to `testAccCheckENIExists`
DanielRieske Jul 13, 2024
f3f5232
feat: migrate ec2 resources in acctest.go
DanielRieske Jul 13, 2024
a660427
feat: migrate namevaluesfilters files
DanielRieske Jul 13, 2024
b23abce
feat: migrate ec2 resources
DanielRieske Jul 13, 2024
9e03485
feat: migrate ec2 resources in directconnect sweepers
DanielRieske Jul 13, 2024
1913e3c
feat: migrate ec2 v1 references in consts
DanielRieske Jul 13, 2024
5cc1c39
feat: migrate ec2 references in meta
DanielRieske Jul 13, 2024
1ceb861
feat: migrate ec2 references in cloudformation_stack tests
DanielRieske Jul 13, 2024
e814c1a
feat: remove `ec2_sdkv1` clients
DanielRieske Jul 13, 2024
473c0e4
fix: set `AllowUnexported` argument for filter tests
DanielRieske Jul 13, 2024
809ff0f
chore: fixed semgrep finding by adding an exception
DanielRieske Jul 13, 2024
764e03d
fix: semgrep findings
DanielRieske Jul 13, 2024
24de3f1
fix: removed unused status function
DanielRieske Jul 13, 2024
f677e66
fix: fix the correct int type conversion
DanielRieske Jul 13, 2024
b436f34
fix: TestRulesMixedMatching `from_port` and `to_port` type conversion
DanielRieske Jul 14, 2024
20c813e
fix: added delay for status check for `TestAccEC2AMILaunchPermission_…
DanielRieske Jul 14, 2024
6f20921
fix: `TestAccEC2AMIIDsDataSource_sorted` by adding relative creation …
DanielRieske Jul 14, 2024
d394571
chore: fix comments and revert tagresource change and cleanup `genera…
DanielRieske Jul 14, 2024
e4d1e16
fix: platformName reference in environment_test for elasticbeanstalk
DanielRieske Jul 15, 2024
23e81be
fix: emr cluster tests changed `EMR_DefaultRole` and `EMR_EC2_Default…
DanielRieske Jul 15, 2024
e61aa03
chore: reduce visibility
DanielRieske Jul 15, 2024
2ca95fe
fix: `resourceIPAMUpdate` handler by adding `resourceIPAMRead` to ret…
DanielRieske Jul 15, 2024
ecaa3b1
fix: `resourceIPAMResourceDiscoveryUpdate` handler by adding `resourc…
DanielRieske Jul 15, 2024
2a1d00f
Merge branch 'main' into f/migrate-vpc-sdkv2
DanielRieske Jul 15, 2024
ae69426
fix: nil exception and `TestAccComprehendEntityRecognizer_VPCConfig_*…
DanielRieske Jul 15, 2024
035ba8f
feat: reduce visibility `instanceMigrateState`
DanielRieske Jul 16, 2024
2a260e8
fix: indent
DanielRieske Jul 16, 2024
5444430
fix: added `ListTags` to generator
DanielRieske Jul 16, 2024
661e175
chore: sorted constants and `wait` functions & reduced visibility
DanielRieske Jul 16, 2024
d639544
chore: sort `wait` functions
DanielRieske Jul 16, 2024
85ed1cc
fix: `ACLAssociation_dissapears` test scenario's
DanielRieske Jul 17, 2024
e94b50a
fix: shallow copy of perm objects in r/aws_security_group
DanielRieske Jul 17, 2024
afc3071
fix: shallow copy of object in r/vpc_security_rule
DanielRieske Jul 17, 2024
49aa8c9
fix: `forceRevokeRulesTrue` and `forceRevokeRulesFalse` to ignore cer…
DanielRieske Jul 17, 2024
2d02fc8
fix: spelling mistake
DanielRieske Jul 17, 2024
418e2f0
fix: `TestAccVPCManagedPrefixListEntry_disappears` by adding addition…
DanielRieske Jul 17, 2024
ed04421
fix: `TestAccVPCNetworkInterface_ignoreExternalAttachment` by adding …
DanielRieske Jul 17, 2024
e74b91a
fix: `TestAccVPCSecurityGroupRule_expectInvalidTypeError` by changing…
DanielRieske Jul 17, 2024
b974fa1
fix: unset `description` in certain test scenario's
DanielRieske Jul 17, 2024
2911d6a
Merge branch 'main' into f/migrate-vpc-sdkv2
DanielRieske Jul 17, 2024
f621b00
chore: semgrep finding
DanielRieske Jul 18, 2024
d8e7eca
fix: accept pascal case on `action` attribute for r/vpc_network_acl f…
DanielRieske Jul 18, 2024
136a407
chore: fix comment
DanielRieske Jul 18, 2024
ac5cd7b
Merge branch 'main' into f/migrate-vpc-sdkv2
DanielRieske Jul 18, 2024
b22b4a8
Merge branch 'main' into f/migrate-vpc-sdkv2
DanielRieske Jul 18, 2024
0dd6eba
chore: run `make clean-tidy`
DanielRieske Jul 18, 2024
8c73e8a
Merge branch 'main' into HEAD
ewbankkit Jul 18, 2024
772edae
acctest: 'awstypes' -> 'iamtypes'.
ewbankkit Jul 18, 2024
62aec63
comprehend: 'awstypes' -> 'ec2types'.
ewbankkit Jul 18, 2024
b0989ab
ec2: Reduce visibility of constants.
ewbankkit Jul 18, 2024
4815922
ec2: Reduce visibility of types.
ewbankkit Jul 18, 2024
891cccd
ec2: More visibility reduction.
ewbankkit Jul 18, 2024
ba4e4b1
ec2: Reduce visibility for state migration tests.
ewbankkit Jul 18, 2024
a3bd070
ec2: Reduce visibility for some more symbols.
ewbankkit Jul 19, 2024
164bc0b
r/aws_verifiedaccess_instance_trust_provider_attachment: Reduce visib…
ewbankkit Jul 19, 2024
ab3b989
Acceptance test output:
ewbankkit Jul 19, 2024
11c4f27
r/aws_vpn_connection_route: Reduce visibility.
ewbankkit Jul 19, 2024
4bf5d7f
Acceptance test output:
ewbankkit Jul 19, 2024
b575ce6
r/aws_vpc_endpoint_connection_accepter: Reduce visibility.
ewbankkit Jul 19, 2024
029a8c9
Acceptance test output:
ewbankkit Jul 19, 2024
3c57839
r/aws_ec2_transit_gateway_route: Reduce visibility.
ewbankkit Jul 19, 2024
d62044d
Acceptance test output:
ewbankkit Jul 19, 2024
0e78b7f
'ParseInstanceType' -- reduce visibility.
ewbankkit Jul 19, 2024
5e8a971
r/aws_vpc_network_performance_metric_subscription: Reduce visibility.
ewbankkit Jul 19, 2024
8788be4
Acceptance test output:
ewbankkit Jul 19, 2024
61ee863
r/aws_vpc_ipam_pool_cidr: Reduce visibility.
ewbankkit Jul 19, 2024
df9e35c
Acceptance test output:
ewbankkit Jul 19, 2024
2359e3f
r/aws_vpc_ipam_pool_cidr_allocation: Reduce visibility.
ewbankkit Jul 19, 2024
b0e2e0c
Acceptance test output:
ewbankkit Jul 19, 2024
d9aba20
r/aws_snapshot_create_volume_permission: Reduce visibility.
ewbankkit Jul 19, 2024
666735b
Acceptance test output:
ewbankkit Jul 19, 2024
f36ee2f
r/aws_ec2_client_vpn_route: Reduce visibility.
ewbankkit Jul 19, 2024
52ca333
Acceptance test output:
ewbankkit Jul 19, 2024
5219135
r/aws_ec2_client_vpn_authorization_rule: Reduce visibility.
ewbankkit Jul 19, 2024
6af842b
Acceptance test output:
ewbankkit Jul 19, 2024
ba83437
r/aws_ami_launch_permission: Reduce visibility.
ewbankkit Jul 19, 2024
088380b
Acceptance test output:
ewbankkit Jul 19, 2024
903e86c
d/aws_ec2_capacity_block_offering: Reduce visibility.
ewbankkit Jul 19, 2024
b164739
Acceptance test output:
ewbankkit Jul 19, 2024
e713d24
r/aws_ec2_instance_state: Reduce visibility.
ewbankkit Jul 19, 2024
097a55f
Acceptance test output:
ewbankkit Jul 19, 2024
d79dbe7
r/aws_ec2_capacity_block_reservation: Reduce visibility.
ewbankkit Jul 19, 2024
e27fd51
Acceptance test output:
ewbankkit Jul 19, 2024
cdef3e8
r/aws_vpc_endpoint_private_dns: Reduce visibility.
ewbankkit Jul 19, 2024
5da215e
r/aws_vpc_endpoint_service_private_dns_verification: Reduce visibility.
ewbankkit Jul 19, 2024
134e18a
Acceptance test output:
ewbankkit Jul 19, 2024
a26b6fd
Acceptance test output:
ewbankkit Jul 19, 2024
70390db
r/aws_vpc_ipv4_cidr_block_association: 'aws-sdk-go-base/v2/awsv1shim/…
ewbankkit Jul 19, 2024
7cac822
networkACLEntryAlreadyExistsError: Use 'errs.APIError'.
ewbankkit Jul 19, 2024
e12169a
Sort exports
ewbankkit Jul 19, 2024
8b16be0
Update acctest.go
ewbankkit Jul 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 7 additions & 33 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
dstypes "github.com/aws/aws-sdk-go-v2/service/directoryservice/types"
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/aws/aws-sdk-go-v2/service/iam"
awstypes "github.com/aws/aws-sdk-go-v2/service/iam/types"
iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types"
"github.com/aws/aws-sdk-go-v2/service/inspector2"
inspector2types "github.com/aws/aws-sdk-go-v2/service/inspector2/types"
organizationstypes "github.com/aws/aws-sdk-go-v2/service/organizations/types"
Expand All @@ -40,7 +40,6 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/outposts"
"github.com/aws/aws-sdk-go/service/pinpoint"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
Expand Down Expand Up @@ -1188,7 +1187,7 @@ func PreCheckIAMServiceLinkedRoleWithProvider(ctx context.Context, t *testing.T,
input := &iam.ListRolesInput{
PathPrefix: aws.String(pathPrefix),
}
var role awstypes.Role
var role iamtypes.Role

pages := iam.NewListRolesPaginator(conn, input)
for pages.HasMorePages() {
Expand Down Expand Up @@ -2231,7 +2230,7 @@ data "aws_ec2_instance_type_offering" "%[1]s" {
`, name, strings.Join(preferredInstanceTypes, "\", \""))
}

func configLatestAmazonLinux2HVMEBSAMI(architecture string) string {
func configLatestAmazonLinux2HVMEBSAMI(architecture ec2types.ArchitectureValues) string {
return fmt.Sprintf(`
data "aws_ami" "amzn2-ami-minimal-hvm-ebs-%[1]s" {
most_recent = true
Expand Down Expand Up @@ -2259,14 +2258,14 @@ data "aws_ami" "amzn2-ami-minimal-hvm-ebs-%[1]s" {
// describes the latest Amazon Linux 2 x86_64 AMI using HVM virtualization and an EBS root device.
// The data source is named 'amzn2-ami-minimal-hvm-ebs-x86_64'.
func ConfigLatestAmazonLinux2HVMEBSX8664AMI() string {
return configLatestAmazonLinux2HVMEBSAMI(ec2.ArchitectureValuesX8664)
return configLatestAmazonLinux2HVMEBSAMI(ec2types.ArchitectureValuesX8664)
}

// ConfigLatestAmazonLinux2HVMEBSARM64AMI returns the configuration for a data source that
// describes the latest Amazon Linux 2 arm64 AMI using HVM virtualization and an EBS root device.
// The data source is named 'amzn2-ami-minimal-hvm-ebs-arm64'.
func ConfigLatestAmazonLinux2HVMEBSARM64AMI() string {
return configLatestAmazonLinux2HVMEBSAMI(ec2.ArchitectureValuesArm64)
return configLatestAmazonLinux2HVMEBSAMI(ec2types.ArchitectureValuesArm64)
}

func ConfigLambdaBase(policyName, roleName, sgName string) string {
Expand Down Expand Up @@ -2494,32 +2493,7 @@ resource "aws_subnet" "test" {
)
}

func CheckVPCExists(ctx context.Context, n string, v *ec2.Vpc) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
if !ok {
return fmt.Errorf("not found: %s", n)
}

if rs.Primary.ID == "" {
return fmt.Errorf("no VPC ID is set")
}

conn := Provider.Meta().(*conns.AWSClient).EC2Conn(ctx)

output, err := tfec2.FindVPCByID(ctx, conn, rs.Primary.ID)

if err != nil {
return err
}

*v = *output

return nil
}
}

func CheckVPCExistsV2(ctx context.Context, n string, v *ec2types.Vpc) resource.TestCheckFunc {
func CheckVPCExists(ctx context.Context, n string, v *ec2types.Vpc) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
if !ok {
Expand All @@ -2532,7 +2506,7 @@ func CheckVPCExistsV2(ctx context.Context, n string, v *ec2types.Vpc) resource.T

conn := Provider.Meta().(*conns.AWSClient).EC2Client(ctx)

output, err := tfec2.FindVPCByIDV2(ctx, conn, rs.Primary.ID)
output, err := tfec2.FindVPCByID(ctx, conn, rs.Primary.ID)

if err != nil {
return err
Expand Down
5 changes: 0 additions & 5 deletions internal/conns/awsclient_gen.go

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

20 changes: 20 additions & 0 deletions internal/framework/flex/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ func StringFromFramework(ctx context.Context, v basetypes.StringValuable) *strin
return output
}

// StringValueFromFramework converts a Framework String value to a string.
// A null String is converted to an empty string.
func StringValueFromFramework(ctx context.Context, v basetypes.StringValuable) string {
var output string

must(Expand(ctx, v, &output))

return output
}

// StringFromFramework converts a single Framework String value to a string pointer slice.
// A null String is converted to a nil slice.
func StringSliceFromFramework(ctx context.Context, v basetypes.StringValuable) []*string {
Expand All @@ -32,6 +42,16 @@ func StringSliceFromFramework(ctx context.Context, v basetypes.StringValuable) [
return []*string{StringFromFramework(ctx, v)}
}

// StringSliceValueFromFramework converts a single Framework String value to a string slice.
// A null String is converted to a nil slice.
func StringSliceValueFromFramework(ctx context.Context, v basetypes.StringValuable) []string {
if v.IsNull() || v.IsUnknown() {
return nil
}

return []string{StringValueFromFramework(ctx, v)}
}

// StringValueToFramework converts a string value to a Framework String value.
// An empty string is converted to a null String.
func StringValueToFramework[T ~string](ctx context.Context, v T) types.String {
Expand Down
2 changes: 1 addition & 1 deletion internal/generate/namevaluesfilters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Full documentation for this package can be found on [GoDoc](https://godoc.org/gi

Many AWS Go SDK services that support resource filtering have their service-specific Go type conversion functions to and from `NameValuesFilters` code generated. Converting from `NameValuesFilters` to AWS Go SDK types is done via `{SERVICE}Filters()` functions on the type. For more information about this code generation, see the [`generators/servicefilters` README](generators/servicefilters/README.md).

Any filtering functions that cannot be generated should be hand implemented in a service-specific source file (e.g. `ec2_filters.go`) and follow the format of similar generated code wherever possible. The first line of the source file should be `// +build !generate`. This prevents the file's inclusion during the code generation phase.
Any filtering functions that cannot be generated should be hand implemented in a service-specific source file and follow the format of similar generated code wherever possible. The first line of the source file should be `// +build !generate`. This prevents the file's inclusion during the code generation phase.

## Code Structure

Expand Down
24 changes: 0 additions & 24 deletions internal/generate/namevaluesfilters/ec2_filters.go

This file was deleted.

54 changes: 0 additions & 54 deletions internal/generate/namevaluesfilters/ec2_filters_test.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ import (

const filename = `service_filters_gen.go`

// Representing types such as []*ec2.Filter, []*rds.Filter, ...
// Representing types such as []*fsx.Filter, []*rds.Filter, ...
var sliceServiceNames = []string{
"autoscaling",
"databasemigrationservice",
"docdb",
"ec2",
"elasticinference",
"elasticsearchservice",
"fsx",
Expand Down
23 changes: 0 additions & 23 deletions internal/generate/namevaluesfilters/service_filters_gen.go

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

2 changes: 1 addition & 1 deletion internal/generate/tagresource/resource.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func resourceTagCreate(ctx context.Context, d *schema.ResourceData, meta interfa
value := d.Get(names.AttrValue).(string)

{{ if eq .ServicePackage "ec2" }}
if err := createTagsV2(ctx, conn, identifier, TagsV2(tftags.New(ctx, map[string]string{key: value}))); err != nil {
if err := createTags(ctx, conn, identifier, Tags(tftags.New(ctx, map[string]string{key: value}))); err != nil {
{{- else }}
if err := {{ .UpdateTagsFunc }}(ctx, conn, identifier, nil, map[string]string{key: value}); err != nil {
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions internal/service/batch/job_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"log"
"testing"

"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/batch"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
Expand Down Expand Up @@ -802,15 +802,15 @@ resource "aws_batch_compute_environment" "more" {

func testAccCheckLaunchTemplateDestroy(ctx context.Context) resource.TestCheckFunc {
return func(s *terraform.State) error {
conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Conn(ctx)
conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Client(ctx)

for _, rs := range s.RootModule().Resources {
if rs.Type != "aws_launch_template" {
continue
}

resp, err := conn.DescribeLaunchTemplatesWithContext(ctx, &ec2.DescribeLaunchTemplatesInput{
LaunchTemplateIds: []*string{aws.String(rs.Primary.ID)},
resp, err := conn.DescribeLaunchTemplates(ctx, &ec2.DescribeLaunchTemplatesInput{
LaunchTemplateIds: []string{rs.Primary.ID},
})

if err == nil {
Expand Down
Loading
Loading