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

r/aws_ec2_client_vpn_network_association: Deprecate security_groups; r/aws_ec2_client_vpn_endpoint: Add security_group_ids and vpc_id #22911

Merged
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5c8cba5
Add 'testAccClientVPNNetworkAssociation_multipleSubnetsWithSecurityGr…
ewbankkit Feb 2, 2022
282918e
Correct test for 'ErrCodeInvalidClientVpnAssociationIdNotFound'.
ewbankkit Feb 2, 2022
1a551b8
r/aws_ec2_client_vpn_network_association: Deprecate the 'security_gro…
ewbankkit Feb 2, 2022
7dbca77
Revert "Add 'testAccClientVPNNetworkAssociation_multipleSubnetsWithSe…
ewbankkit Feb 2, 2022
9eed22b
Standardize resource names in acceptance test case.
ewbankkit Feb 2, 2022
64db47a
r/aws_ec2_client_vpn_security_groups_association: New resource.
ewbankkit Feb 2, 2022
d38242a
Correct new resource name.
ewbankkit Feb 2, 2022
699d84b
r/aws_ec2_client_vpn_security_groups_association: Implementation.
ewbankkit Feb 2, 2022
f4b0ec3
Revert "r/aws_ec2_client_vpn_security_groups_association: Implementat…
ewbankkit Feb 2, 2022
43f4584
Revert "Correct new resource name."
ewbankkit Feb 2, 2022
6a4e0ff
Revert "r/aws_ec2_client_vpn_security_groups_association: New resource."
ewbankkit Feb 2, 2022
31f1aca
r/aws_ec2_client_vpn_network_association: Use new 'security_group_ids…
ewbankkit Feb 2, 2022
35e8f70
r/aws_ec2_client_vpn_endpoint: Add 'security_group_ids' and 'vpc_id' …
ewbankkit Feb 2, 2022
4b89496
d/aws_ec2_client_vpn_endpoint: Add 'security_group_ids' and 'vpc_id' …
ewbankkit Feb 2, 2022
54fa458
'testAccEc2ClientVpnEndpointMsADBase' -> 'testAccEc2ClientVpnEndpoint…
ewbankkit Feb 2, 2022
539f328
Add 'testAccClientVPNEndpoint_vpcNoSecurityGroups'.
ewbankkit Feb 2, 2022
7123c34
Correct CHANGELOG file name.
ewbankkit Feb 2, 2022
5b90500
Add 'testAccClientVPNEndpoint_vpcSecurityGroups'.
ewbankkit Feb 2, 2022
8c8fa95
Fix terrafmt error.
ewbankkit Feb 2, 2022
4365e8a
Standardize configuration generation function names in acceptance tests.
ewbankkit Feb 3, 2022
cd8ed96
Add 'testAccClientVPNNetworkAssociation_securityGroupsOnEndpoint'.
ewbankkit Feb 3, 2022
734ff73
r/aws_ec2_client_vpn_route: Alphabetize attributes.
ewbankkit Feb 3, 2022
c5c42e2
Rename client VPN route resource ID generate and parse functions.
ewbankkit Feb 3, 2022
78ec2d6
r/aws_ec2_client_vpn_route: Tidy up resource Create and Delete.
ewbankkit Feb 3, 2022
ecdd813
r/aws_ec2_client_vpn_route: Tidy up resource Read.
ewbankkit Feb 3, 2022
f7a0837
r/aws_ec2_client_vpn_route: Tidy up acceptance tests.
ewbankkit Feb 3, 2022
30367c8
r/aws_ec2_client_vpn_route: Add custom 'timeouts' block.
ewbankkit Feb 3, 2022
23d18cf
r/aws_ec2_client_vpn_route: Retry route creation when 'InvalidClientV…
ewbankkit Feb 3, 2022
9150caa
r/aws_ec2_client_vpn_route: Retry route creation and deletion when 'C…
ewbankkit Feb 3, 2022
c5d156f
Acceptance test output:
ewbankkit Feb 3, 2022
5685620
r/aws_ec2_client_vpn_authorization_rule: No ','s allowed in 'access_g…
ewbankkit Feb 3, 2022
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
Prev Previous commit
Next Next commit
Add 'testAccClientVPNNetworkAssociation_securityGroupsOnEndpoint'.
  • Loading branch information
ewbankkit committed Feb 3, 2022

Verified

This commit was signed with the committer’s verified signature.
messense messense
commit cd8ed966bd4d113aa33410547d003c1e92dcfb1e
11 changes: 6 additions & 5 deletions internal/service/ec2/client_vpn_endpoint_test.go
Original file line number Diff line number Diff line change
@@ -57,10 +57,11 @@ func TestAccEC2ClientVPNEndpoint_serial(t *testing.T) {
"disappearsEndpoint": testAccClientVPNAuthorizationRule_Disappears_endpoint,
},
"NetworkAssociation": {
"basic": testAccClientVPNNetworkAssociation_basic,
"multipleSubnets": testAccClientVPNNetworkAssociation_multipleSubnets,
"disappears": testAccClientVPNNetworkAssociation_disappears,
"securityGroups": testAccClientVPNNetworkAssociation_securityGroups,
"basic": testAccClientVPNNetworkAssociation_basic,
"multipleSubnets": testAccClientVPNNetworkAssociation_multipleSubnets,
"disappears": testAccClientVPNNetworkAssociation_disappears,
"securityGroups": testAccClientVPNNetworkAssociation_securityGroups,
"securityGroupsOnEndpoint": testAccClientVPNNetworkAssociation_securityGroupsOnEndpoint,
},
"Route": {
"basic": testAccClientVPNRoute_basic,
@@ -806,7 +807,7 @@ func testAccEc2ClientVpnEndpointConfigVPCBase(rName string) string {
acctest.ConfigAvailableAZsNoOptIn(),
fmt.Sprintf(`
resource "aws_vpc" "test" {
cidr_block = "10.0.0.0/16"
cidr_block = "10.1.0.0/16"

tags = {
Name = %[1]q
46 changes: 40 additions & 6 deletions internal/service/ec2/client_vpn_network_association_test.go
Original file line number Diff line number Diff line change
@@ -171,6 +171,35 @@ func testAccClientVPNNetworkAssociation_securityGroups(t *testing.T) {
})
}

func testAccClientVPNNetworkAssociation_securityGroupsOnEndpoint(t *testing.T) {
var assoc ec2.TargetNetwork
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_ec2_client_vpn_network_association.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t); testAccPreCheckClientVPNSyncronize(t) },
ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID),
Providers: acctest.Providers,
CheckDestroy: testAccCheckClientVPNNetworkAssociationDestroy,
Steps: []resource.TestStep{
{
Config: testAccEc2ClientVpnNetworkAssociationConfigTwoSecurityGroupsOnEndpoint(rName),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckClientVPNNetworkAssociationExists(resourceName, &assoc),
resource.TestCheckResourceAttr(resourceName, "security_groups.#", "2"),
resource.TestCheckResourceAttrSet(resourceName, "vpc_id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateIdFunc: testAccClientVPNNetworkAssociationImportStateIdFunc(resourceName),
},
},
})
}

func testAccCheckClientVPNNetworkAssociationDestroy(s *terraform.State) error {
conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Conn

@@ -302,9 +331,7 @@ resource "aws_ec2_client_vpn_network_association" "test2" {
}

func testAccEc2ClientVpnNetworkAssociationConfigTwoSecurityGroups(rName string) string {
return acctest.ConfigCompose(
testAccEc2ClientVpnNetworkAssociationBaseConfig(rName),
fmt.Sprintf(`
return acctest.ConfigCompose(testAccEc2ClientVpnNetworkAssociationBaseConfig(rName), fmt.Sprintf(`
resource "aws_ec2_client_vpn_network_association" "test" {
client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.test.id
subnet_id = aws_subnet.test1.id
@@ -332,9 +359,7 @@ resource "aws_security_group" "test2" {
}

func testAccEc2ClientVpnNetworkAssociationConfigOneSecurityGroup(rName string) string {
return acctest.ConfigCompose(
testAccEc2ClientVpnNetworkAssociationBaseConfig(rName),
fmt.Sprintf(`
return acctest.ConfigCompose(testAccEc2ClientVpnNetworkAssociationBaseConfig(rName), fmt.Sprintf(`
resource "aws_ec2_client_vpn_network_association" "test" {
client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.test.id
subnet_id = aws_subnet.test1.id
@@ -360,3 +385,12 @@ resource "aws_security_group" "test2" {
}
`, rName))
}

func testAccEc2ClientVpnNetworkAssociationConfigTwoSecurityGroupsOnEndpoint(rName string) string {
return acctest.ConfigCompose(testAccEc2ClientVpnEndpointConfigSecurityGroups(rName, 2), `
resource "aws_ec2_client_vpn_network_association" "test" {
client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.test.id
subnet_id = aws_subnet.test[0].id
}
`)
}