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/customer_gateway - cleanup + certificate_arn #22435

Merged
merged 31 commits into from
Jan 7, 2022

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Jan 6, 2022

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #10548.
I don't think this closes the issue as there is work required in aws_vpn_connection.

Output from acceptance testing:

$ make testacc TESTS=TestAccEC2CustomerGateway_ PKG=ec2
--- PASS: TestAccEC2CustomerGateway_disappears (81.73s)
--- PASS: TestAccEC2CustomerGateway_deviceName (105.66s)
--- PASS: TestAccEC2CustomerGateway_4ByteASN (108.74s)
--- PASS: TestAccEC2CustomerGateway_similarAlreadyExists (126.87s)
--- PASS: TestAccEC2CustomerGateway_basic (158.66s)
--- PASS: TestAccEC2CustomerGateway_tags (176.13s)

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 6, 2022
@DrFaust92 DrFaust92 added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 6, 2022
@DrFaust92
Copy link
Collaborator Author

DrFaust92 commented Jan 6, 2022

cert arn test failing with:

        Error: Error creating customer gateway: InvalidParameterValue: An error was encountered during validation of your certificate chain. An error was encountered during certificate chain validation. Please ensure that your End Entity certificate was generated by your Subordinate CA. See our documentation for assistance with proper CA setup and validation.
        	status code: 400

Leaving this as baseline to support cert arn /:

Edit:

according to docs:

https://github.com/awsdocs/aws-site-to-site-vpn-user-guide/blob/master/doc_source/SetUpVPNConnections.md

If you plan to use a private certificate to authenticate your VPN, create a private certificate from a subordinate CA using AWS Certificate Manager Private Certificate Authority. For information about creating a private certificate, see Creating and managing a private CA in the AWS Certificate Manager Private Certificate Authority User Guide.

@github-actions github-actions bot added the sweeper Pertains to changes to or issues with the sweeper. label Jan 6, 2022
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2VPNGateway_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2VPNGateway_ -timeout 180m
=== RUN   TestAccEC2VPNGateway_basic
=== PAUSE TestAccEC2VPNGateway_basic
=== RUN   TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== PAUSE TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== RUN   TestAccEC2VPNGateway_withAmazonSideASNSetToState
=== PAUSE TestAccEC2VPNGateway_withAmazonSideASNSetToState
=== RUN   TestAccEC2VPNGateway_disappears
=== PAUSE TestAccEC2VPNGateway_disappears
=== RUN   TestAccEC2VPNGateway_reattach
=== PAUSE TestAccEC2VPNGateway_reattach
=== RUN   TestAccEC2VPNGateway_delete
=== PAUSE TestAccEC2VPNGateway_delete
=== RUN   TestAccEC2VPNGateway_tags
=== PAUSE TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGateway_basic
=== CONT  TestAccEC2VPNGateway_reattach
=== CONT  TestAccEC2VPNGateway_disappears
=== CONT  TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGateway_withAmazonSideASNSetToState
=== CONT  TestAccEC2VPNGateway_delete
=== CONT  TestAccEC2VPNGateway_withAvailabilityZoneSetToState
--- PASS: TestAccEC2VPNGateway_disappears (50.56s)
--- PASS: TestAccEC2VPNGateway_withAmazonSideASNSetToState (61.43s)
--- PASS: TestAccEC2VPNGateway_withAvailabilityZoneSetToState (72.30s)
--- PASS: TestAccEC2VPNGateway_delete (84.79s)
--- PASS: TestAccEC2VPNGateway_tags (100.45s)
--- PASS: TestAccEC2VPNGateway_basic (100.54s)
--- PASS: TestAccEC2VPNGateway_reattach (143.07s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	147.121s
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2VPNGateway_\|TestAccEC2VPNGatewayAttachment_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2VPNGateway_\|TestAccEC2VPNGatewayAttachment_ -timeout 180m
=== RUN   TestAccEC2VPNGatewayAttachment_basic
=== PAUSE TestAccEC2VPNGatewayAttachment_basic
=== RUN   TestAccEC2VPNGatewayAttachment_disappears
=== PAUSE TestAccEC2VPNGatewayAttachment_disappears
=== RUN   TestAccEC2VPNGateway_basic
=== PAUSE TestAccEC2VPNGateway_basic
=== RUN   TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== PAUSE TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== RUN   TestAccEC2VPNGateway_withAmazonSideASNSetToState
=== PAUSE TestAccEC2VPNGateway_withAmazonSideASNSetToState
=== RUN   TestAccEC2VPNGateway_disappears
=== PAUSE TestAccEC2VPNGateway_disappears
=== RUN   TestAccEC2VPNGateway_reattach
=== PAUSE TestAccEC2VPNGateway_reattach
=== RUN   TestAccEC2VPNGateway_delete
=== PAUSE TestAccEC2VPNGateway_delete
=== RUN   TestAccEC2VPNGateway_tags
=== PAUSE TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGatewayAttachment_basic
=== CONT  TestAccEC2VPNGateway_disappears
=== CONT  TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGateway_delete
=== CONT  TestAccEC2VPNGateway_reattach
=== CONT  TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== CONT  TestAccEC2VPNGateway_withAmazonSideASNSetToState
=== CONT  TestAccEC2VPNGatewayAttachment_disappears
=== CONT  TestAccEC2VPNGateway_basic
--- PASS: TestAccEC2VPNGatewayAttachment_disappears (43.11s)
--- PASS: TestAccEC2VPNGatewayAttachment_basic (49.46s)
--- PASS: TestAccEC2VPNGateway_disappears (64.68s)
--- PASS: TestAccEC2VPNGateway_withAmazonSideASNSetToState (75.58s)
--- PASS: TestAccEC2VPNGateway_withAvailabilityZoneSetToState (75.59s)
--- PASS: TestAccEC2VPNGateway_delete (78.88s)
--- PASS: TestAccEC2VPNGateway_tags (95.42s)
--- PASS: TestAccEC2VPNGateway_basic (116.62s)
--- PASS: TestAccEC2VPNGateway_reattach (159.67s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	163.832s
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2VPNGateway_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2VPNGateway_ -timeout 180m
=== RUN   TestAccEC2VPNGateway_basic
=== PAUSE TestAccEC2VPNGateway_basic
=== RUN   TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== PAUSE TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== RUN   TestAccEC2VPNGateway_withAmazonSideASN
=== PAUSE TestAccEC2VPNGateway_withAmazonSideASN
=== RUN   TestAccEC2VPNGateway_disappears
=== PAUSE TestAccEC2VPNGateway_disappears
=== RUN   TestAccEC2VPNGateway_reattach
=== PAUSE TestAccEC2VPNGateway_reattach
=== RUN   TestAccEC2VPNGateway_tags
=== PAUSE TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGateway_basic
=== CONT  TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGateway_reattach
=== CONT  TestAccEC2VPNGateway_withAmazonSideASN
=== CONT  TestAccEC2VPNGateway_disappears
=== CONT  TestAccEC2VPNGateway_withAvailabilityZoneSetToState
--- PASS: TestAccEC2VPNGateway_withAmazonSideASN (53.42s)
--- PASS: TestAccEC2VPNGateway_disappears (57.88s)
--- PASS: TestAccEC2VPNGateway_withAvailabilityZoneSetToState (71.78s)
--- PASS: TestAccEC2VPNGateway_basic (100.99s)
--- PASS: TestAccEC2VPNGateway_tags (101.11s)
--- PASS: TestAccEC2VPNGateway_reattach (135.10s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	138.784s
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2VPNGateway_\|TestAccEC2VPNGatewayAttachment_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2VPNGateway_\|TestAccEC2VPNGatewayAttachment_ -timeout 180m
=== RUN   TestAccEC2VPNGatewayAttachment_basic
=== PAUSE TestAccEC2VPNGatewayAttachment_basic
=== RUN   TestAccEC2VPNGatewayAttachment_disappears
=== PAUSE TestAccEC2VPNGatewayAttachment_disappears
=== RUN   TestAccEC2VPNGateway_basic
=== PAUSE TestAccEC2VPNGateway_basic
=== RUN   TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== PAUSE TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== RUN   TestAccEC2VPNGateway_withAmazonSideASN
=== PAUSE TestAccEC2VPNGateway_withAmazonSideASN
=== RUN   TestAccEC2VPNGateway_disappears
=== PAUSE TestAccEC2VPNGateway_disappears
=== RUN   TestAccEC2VPNGateway_reattach
=== PAUSE TestAccEC2VPNGateway_reattach
=== RUN   TestAccEC2VPNGateway_tags
=== PAUSE TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGatewayAttachment_basic
=== CONT  TestAccEC2VPNGateway_disappears
=== CONT  TestAccEC2VPNGateway_basic
=== CONT  TestAccEC2VPNGateway_reattach
=== CONT  TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== CONT  TestAccEC2VPNGateway_withAmazonSideASN
=== CONT  TestAccEC2VPNGatewayAttachment_disappears
--- PASS: TestAccEC2VPNGatewayAttachment_disappears (42.48s)
--- PASS: TestAccEC2VPNGatewayAttachment_basic (46.78s)
--- PASS: TestAccEC2VPNGateway_disappears (56.01s)
--- PASS: TestAccEC2VPNGateway_withAmazonSideASN (67.49s)
--- PASS: TestAccEC2VPNGateway_withAvailabilityZoneSetToState (74.33s)
--- PASS: TestAccEC2VPNGateway_basic (97.92s)
--- PASS: TestAccEC2VPNGateway_tags (114.21s)
--- PASS: TestAccEC2VPNGateway_reattach (146.13s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	152.872s
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2VPNGatewayDataSource_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2VPNGatewayDataSource_ -timeout 180m
=== RUN   TestAccEC2VPNGatewayDataSource_unattached
=== PAUSE TestAccEC2VPNGatewayDataSource_unattached
=== RUN   TestAccEC2VPNGatewayDataSource_attached
=== PAUSE TestAccEC2VPNGatewayDataSource_attached
=== CONT  TestAccEC2VPNGatewayDataSource_unattached
=== CONT  TestAccEC2VPNGatewayDataSource_attached
--- PASS: TestAccEC2VPNGatewayDataSource_unattached (18.34s)
--- PASS: TestAccEC2VPNGatewayDataSource_attached (54.60s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	58.731s
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_ -timeout 180m
=== RUN   TestAccEC2CustomerGateway_basic
=== PAUSE TestAccEC2CustomerGateway_basic
=== RUN   TestAccEC2CustomerGateway_tags
=== PAUSE TestAccEC2CustomerGateway_tags
=== RUN   TestAccEC2CustomerGateway_deviceName
=== PAUSE TestAccEC2CustomerGateway_deviceName
=== RUN   TestAccEC2CustomerGateway_disappears
=== PAUSE TestAccEC2CustomerGateway_disappears
=== RUN   TestAccEC2CustomerGateway_4ByteASN
=== PAUSE TestAccEC2CustomerGateway_4ByteASN
=== CONT  TestAccEC2CustomerGateway_basic
=== CONT  TestAccEC2CustomerGateway_disappears
=== CONT  TestAccEC2CustomerGateway_4ByteASN
=== CONT  TestAccEC2CustomerGateway_deviceName
=== CONT  TestAccEC2CustomerGateway_tags
--- PASS: TestAccEC2CustomerGateway_disappears (35.29s)
--- PASS: TestAccEC2CustomerGateway_4ByteASN (46.03s)
--- PASS: TestAccEC2CustomerGateway_deviceName (46.08s)
--- PASS: TestAccEC2CustomerGateway_basic (75.98s)
--- PASS: TestAccEC2CustomerGateway_tags (81.51s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	86.797s
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_ -timeout 180m
=== RUN   TestAccEC2CustomerGateway_basic
=== PAUSE TestAccEC2CustomerGateway_basic
=== RUN   TestAccEC2CustomerGateway_tags
=== PAUSE TestAccEC2CustomerGateway_tags
=== RUN   TestAccEC2CustomerGateway_deviceName
=== PAUSE TestAccEC2CustomerGateway_deviceName
=== RUN   TestAccEC2CustomerGateway_disappears
=== PAUSE TestAccEC2CustomerGateway_disappears
=== RUN   TestAccEC2CustomerGateway_4ByteASN
=== PAUSE TestAccEC2CustomerGateway_4ByteASN
=== CONT  TestAccEC2CustomerGateway_basic
=== CONT  TestAccEC2CustomerGateway_4ByteASN
=== CONT  TestAccEC2CustomerGateway_deviceName
=== CONT  TestAccEC2CustomerGateway_disappears
=== CONT  TestAccEC2CustomerGateway_tags
--- PASS: TestAccEC2CustomerGateway_disappears (30.12s)
--- PASS: TestAccEC2CustomerGateway_deviceName (34.34s)
--- PASS: TestAccEC2CustomerGateway_4ByteASN (34.38s)
--- PASS: TestAccEC2CustomerGateway_tags (55.88s)
--- PASS: TestAccEC2CustomerGateway_basic (57.29s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	62.839s
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_ -timeout 180m
=== RUN   TestAccEC2CustomerGateway_basic
=== PAUSE TestAccEC2CustomerGateway_basic
=== RUN   TestAccEC2CustomerGateway_disappears
=== PAUSE TestAccEC2CustomerGateway_disappears
=== RUN   TestAccEC2CustomerGateway_tags
=== PAUSE TestAccEC2CustomerGateway_tags
=== RUN   TestAccEC2CustomerGateway_deviceName
=== PAUSE TestAccEC2CustomerGateway_deviceName
=== RUN   TestAccEC2CustomerGateway_4ByteASN
=== PAUSE TestAccEC2CustomerGateway_4ByteASN
=== CONT  TestAccEC2CustomerGateway_basic
=== CONT  TestAccEC2CustomerGateway_deviceName
=== CONT  TestAccEC2CustomerGateway_4ByteASN
=== CONT  TestAccEC2CustomerGateway_tags
=== CONT  TestAccEC2CustomerGateway_disappears
--- PASS: TestAccEC2CustomerGateway_disappears (29.45s)
--- PASS: TestAccEC2CustomerGateway_4ByteASN (35.14s)
--- PASS: TestAccEC2CustomerGateway_basic (35.47s)
--- PASS: TestAccEC2CustomerGateway_deviceName (35.56s)
--- PASS: TestAccEC2CustomerGateway_tags (59.67s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	66.285s
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2CustomerGatewayDataSource_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGatewayDataSource_ -timeout 180m
=== RUN   TestAccEC2CustomerGatewayDataSource_filter
=== PAUSE TestAccEC2CustomerGatewayDataSource_filter
=== RUN   TestAccEC2CustomerGatewayDataSource_id
=== PAUSE TestAccEC2CustomerGatewayDataSource_id
=== CONT  TestAccEC2CustomerGatewayDataSource_filter
=== CONT  TestAccEC2CustomerGatewayDataSource_id
--- PASS: TestAccEC2CustomerGatewayDataSource_filter (29.01s)
--- PASS: TestAccEC2CustomerGatewayDataSource_id (29.10s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	34.923s
d/aws_customer_gateway: Add 'certificate_arn' attribute.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_basic\|TestAccEC2CustomerGatewayDataSource_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_basic\|TestAccEC2CustomerGatewayDataSource_ -timeout 180m
=== RUN   TestAccEC2CustomerGatewayDataSource_filter
=== PAUSE TestAccEC2CustomerGatewayDataSource_filter
=== RUN   TestAccEC2CustomerGatewayDataSource_id
=== PAUSE TestAccEC2CustomerGatewayDataSource_id
=== RUN   TestAccEC2CustomerGateway_basic
=== PAUSE TestAccEC2CustomerGateway_basic
=== CONT  TestAccEC2CustomerGatewayDataSource_filter
=== CONT  TestAccEC2CustomerGateway_basic
=== CONT  TestAccEC2CustomerGatewayDataSource_id
--- PASS: TestAccEC2CustomerGateway_basic (27.96s)
--- PASS: TestAccEC2CustomerGatewayDataSource_filter (28.32s)
--- PASS: TestAccEC2CustomerGatewayDataSource_id (28.83s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	32.305s
% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_certificate' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_certificate -timeout 180m
=== RUN   TestAccEC2CustomerGateway_certificate
=== PAUSE TestAccEC2CustomerGateway_certificate
=== CONT  TestAccEC2CustomerGateway_certificate
    customer_gateway_test.go:183: Step 2/4 error: Error running apply: exit status 1

        Error: error creating EC2 Customer Gateway: InvalidParameterValue: An error was encountered during validation of your certificate chain. An error was encountered during certificate chain validation. Please ensure that your End Entity certificate was generated by your Subordinate CA. See our documentation for assistance with proper CA setup and validation.
        	status code: 400, request id: 4c5b7cf0-84e2-4a2d-9bd3-d58ba9723bb2

          with aws_customer_gateway.test,
          on terraform_plugin_test.tf line 21, in resource "aws_customer_gateway" "test":
          21: resource "aws_customer_gateway" "test" {

--- FAIL: TestAccEC2CustomerGateway_certificate (72.37s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	76.126s
FAIL
make: *** [testacc] Error 1
…ate in acceptance test.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_certificate' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_certificate -timeout 180m
=== RUN   TestAccEC2CustomerGateway_certificate
=== PAUSE TestAccEC2CustomerGateway_certificate
=== CONT  TestAccEC2CustomerGateway_certificate
    customer_gateway_test.go:180: Step 1/2 error: Error running apply: exit status 1

        Error: error creating EC2 Customer Gateway: IncorrectState: The Certificate Authority arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/538adf8e-ad2d-4e76-bd0c-4d371d0a7f70, associated with the Certificate arn:aws:acm:us-west-2:123456789012:certificate/99b7e875-591b-42d7-97ce-3215c0af4689 is not Active.
        	status code: 400, request id: a43425cd-f923-42e5-845d-0527a18b6c0f

          with aws_customer_gateway.test,
          on terraform_plugin_test.tf line 77, in resource "aws_customer_gateway" "test":
          77: resource "aws_customer_gateway" "test" {

--- FAIL: TestAccEC2CustomerGateway_certificate (22.67s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	28.222s
FAIL
make: *** [testacc] Error 1
…certificate in acceptance test."

This reverts commit 699cb42c7d76a6e621c1f010ef61cf925e4e4733.
…ctivateSubordinateCA'.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_certificate' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_certificate -timeout 180m
=== RUN   TestAccEC2CustomerGateway_certificate
=== PAUSE TestAccEC2CustomerGateway_certificate
=== CONT  TestAccEC2CustomerGateway_certificate
    customer_gateway_test.go:185: Step 2/4 error: Error running apply: exit status 1

        Error: error creating EC2 Customer Gateway: InvalidParameterValue: Parameter certificateArn=arn:aws:acm:us-west-2:123456789012:certificate/2cfbfd30-5aac-4d09-a421-180e02064a12 does not exist.
        	status code: 400, request id: 17a7be55-0daf-4788-96e1-bfab97cf0719

          with aws_customer_gateway.test,
          on terraform_plugin_test.tf line 35, in resource "aws_customer_gateway" "test":
          35: resource "aws_customer_gateway" "test" {

--- FAIL: TestAccEC2CustomerGateway_certificate (60.95s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	65.020s
FAIL
make: *** [testacc] Error 1
Acceptance test output:

% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_certificate' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_certificate -timeout 180m
=== RUN   TestAccEC2CustomerGateway_certificate
=== PAUSE TestAccEC2CustomerGateway_certificate
=== CONT  TestAccEC2CustomerGateway_certificate
--- PASS: TestAccEC2CustomerGateway_certificate (85.63s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	89.458s
@github-actions github-actions bot added service/acmpca Issues and PRs that pertain to the acmpca service. service/appmesh Issues and PRs that pertain to the appmesh service. service/transfer Issues and PRs that pertain to the transfer service. labels Jan 6, 2022
@ewbankkit
Copy link
Contributor

@DrFaust92 Thanks for this.
I have also been looking at this (as an intro to some changes to aws_vpn_connection for v4.0.0) and eventually did get a test case passing (have to create 2 CAs, one subordinate to the other, activate them both and then issue a certificate).
I have hijacked this PR with my changes 😄.

@ewbankkit ewbankkit marked this pull request as ready for review January 6, 2022 18:15
@ewbankkit ewbankkit changed the title r/customer_gateway - cleanup + certificate_arn [WIP] r/customer_gateway - cleanup + certificate_arn Jan 6, 2022
@DrFaust92
Copy link
Collaborator Author

@ewbankkit Awesome! i played with 2 ACM PCA but didnt find the right combo.

…CACertificateAuthorityActivateRootCA' renames.
@github-actions github-actions bot added the service/kafka Issues and PRs that pertain to the kafka service. label Jan 6, 2022
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

Commercial
% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_basic\|TestAccEC2CustomerGatewayDataSource_\|TestAccEC2VPNGateway_\|TestAccEC2VPNGatewayAttachment_\|TestAccEC2VPNGatewayDataSource_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_basic\|TestAccEC2CustomerGatewayDataSource_\|TestAccEC2VPNGateway_\|TestAccEC2VPNGatewayAttachment_\|TestAccEC2VPNGatewayDataSource_ -timeout 180m
=== RUN   TestAccEC2CustomerGatewayDataSource_filter
=== PAUSE TestAccEC2CustomerGatewayDataSource_filter
=== RUN   TestAccEC2CustomerGatewayDataSource_id
=== PAUSE TestAccEC2CustomerGatewayDataSource_id
=== RUN   TestAccEC2CustomerGateway_basic
=== PAUSE TestAccEC2CustomerGateway_basic
=== RUN   TestAccEC2VPNGatewayAttachment_basic
=== PAUSE TestAccEC2VPNGatewayAttachment_basic
=== RUN   TestAccEC2VPNGatewayAttachment_disappears
=== PAUSE TestAccEC2VPNGatewayAttachment_disappears
=== RUN   TestAccEC2VPNGatewayDataSource_unattached
=== PAUSE TestAccEC2VPNGatewayDataSource_unattached
=== RUN   TestAccEC2VPNGatewayDataSource_attached
=== PAUSE TestAccEC2VPNGatewayDataSource_attached
=== RUN   TestAccEC2VPNGateway_basic
=== PAUSE TestAccEC2VPNGateway_basic
=== RUN   TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== PAUSE TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== RUN   TestAccEC2VPNGateway_withAmazonSideASN
=== PAUSE TestAccEC2VPNGateway_withAmazonSideASN
=== RUN   TestAccEC2VPNGateway_disappears
=== PAUSE TestAccEC2VPNGateway_disappears
=== RUN   TestAccEC2VPNGateway_reattach
=== PAUSE TestAccEC2VPNGateway_reattach
=== RUN   TestAccEC2VPNGateway_tags
=== PAUSE TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2CustomerGatewayDataSource_filter
=== CONT  TestAccEC2VPNGateway_basic
=== CONT  TestAccEC2VPNGateway_withAmazonSideASN
=== CONT  TestAccEC2VPNGatewayDataSource_unattached
=== CONT  TestAccEC2CustomerGatewayDataSource_id
=== CONT  TestAccEC2VPNGateway_reattach
=== CONT  TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== CONT  TestAccEC2VPNGatewayAttachment_disappears
=== CONT  TestAccEC2VPNGatewayDataSource_attached
=== CONT  TestAccEC2CustomerGateway_basic
=== CONT  TestAccEC2VPNGatewayAttachment_basic
=== CONT  TestAccEC2VPNGateway_disappears
--- PASS: TestAccEC2VPNGatewayDataSource_unattached (22.98s)
--- PASS: TestAccEC2CustomerGatewayDataSource_id (33.26s)
--- PASS: TestAccEC2CustomerGateway_basic (33.59s)
--- PASS: TestAccEC2CustomerGatewayDataSource_filter (33.94s)
--- PASS: TestAccEC2VPNGatewayAttachment_disappears (50.02s)
--- PASS: TestAccEC2VPNGatewayAttachment_basic (50.57s)
--- PASS: TestAccEC2VPNGateway_withAmazonSideASN (56.21s)
--- PASS: TestAccEC2VPNGateway_disappears (57.21s)
--- PASS: TestAccEC2VPNGateway_withAvailabilityZoneSetToState (57.85s)
--- PASS: TestAccEC2VPNGatewayDataSource_attached (59.75s)
--- PASS: TestAccEC2VPNGateway_basic (93.40s)
--- PASS: TestAccEC2VPNGateway_tags (96.76s)
--- PASS: TestAccEC2VPNGateway_reattach (143.79s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	147.200s
GovCloud
% make testacc TESTARGS='-run=TestAccEC2CustomerGateway_basic\|TestAccEC2CustomerGatewayDataSource_\|TestAccEC2VPNGateway_\|TestAccEC2VPNGatewayAttachment_\|TestAccEC2VPNGatewayDataSource_' PKG_NAME=internal/service/ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2CustomerGateway_basic\|TestAccEC2CustomerGatewayDataSource_\|TestAccEC2VPNGateway_\|TestAccEC2VPNGatewayAttachment_\|TestAccEC2VPNGatewayDataSource_ -timeout 180m
=== RUN   TestAccEC2CustomerGatewayDataSource_filter
=== PAUSE TestAccEC2CustomerGatewayDataSource_filter
=== RUN   TestAccEC2CustomerGatewayDataSource_id
=== PAUSE TestAccEC2CustomerGatewayDataSource_id
=== RUN   TestAccEC2CustomerGateway_basic
=== PAUSE TestAccEC2CustomerGateway_basic
=== RUN   TestAccEC2VPNGatewayAttachment_basic
=== PAUSE TestAccEC2VPNGatewayAttachment_basic
=== RUN   TestAccEC2VPNGatewayAttachment_disappears
=== PAUSE TestAccEC2VPNGatewayAttachment_disappears
=== RUN   TestAccEC2VPNGatewayDataSource_unattached
=== PAUSE TestAccEC2VPNGatewayDataSource_unattached
=== RUN   TestAccEC2VPNGatewayDataSource_attached
=== PAUSE TestAccEC2VPNGatewayDataSource_attached
=== RUN   TestAccEC2VPNGateway_basic
=== PAUSE TestAccEC2VPNGateway_basic
=== RUN   TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== PAUSE TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== RUN   TestAccEC2VPNGateway_withAmazonSideASN
=== PAUSE TestAccEC2VPNGateway_withAmazonSideASN
=== RUN   TestAccEC2VPNGateway_disappears
=== PAUSE TestAccEC2VPNGateway_disappears
=== RUN   TestAccEC2VPNGateway_reattach
=== PAUSE TestAccEC2VPNGateway_reattach
=== RUN   TestAccEC2VPNGateway_tags
=== PAUSE TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2CustomerGatewayDataSource_filter
=== CONT  TestAccEC2VPNGateway_basic
=== CONT  TestAccEC2VPNGateway_tags
=== CONT  TestAccEC2VPNGatewayAttachment_disappears
=== CONT  TestAccEC2VPNGatewayDataSource_attached
=== CONT  TestAccEC2VPNGateway_disappears
=== CONT  TestAccEC2VPNGatewayDataSource_unattached
=== CONT  TestAccEC2VPNGateway_withAmazonSideASN
=== CONT  TestAccEC2VPNGateway_reattach
=== CONT  TestAccEC2CustomerGateway_basic
=== CONT  TestAccEC2VPNGateway_withAvailabilityZoneSetToState
=== CONT  TestAccEC2CustomerGatewayDataSource_id
=== CONT  TestAccEC2VPNGatewayAttachment_basic
--- PASS: TestAccEC2VPNGatewayDataSource_unattached (25.47s)
--- PASS: TestAccEC2CustomerGatewayDataSource_id (35.14s)
--- PASS: TestAccEC2CustomerGatewayDataSource_filter (35.39s)
--- PASS: TestAccEC2CustomerGateway_basic (35.93s)
--- PASS: TestAccEC2VPNGatewayAttachment_disappears (49.01s)
--- PASS: TestAccEC2VPNGateway_disappears (54.96s)
--- PASS: TestAccEC2VPNGatewayDataSource_attached (61.65s)
--- PASS: TestAccEC2VPNGatewayAttachment_basic (65.27s)
--- PASS: TestAccEC2VPNGateway_withAmazonSideASN (74.62s)
--- PASS: TestAccEC2VPNGateway_withAvailabilityZoneSetToState (82.10s)
--- PASS: TestAccEC2VPNGateway_basic (94.70s)
--- PASS: TestAccEC2VPNGateway_tags (112.04s)
--- PASS: TestAccEC2VPNGateway_reattach (156.99s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	160.716s
Sweeper
% make sweep SWEEPARGS=-sweep-run=aws_vpn_gateway,aws_customer_gateway SWEEP=us-west-1
# make sweep SWEEPARGS=-sweep-run=aws_example_thing
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./internal/sweep -v -tags=sweep -sweep=us-west-1 -sweep-run=aws_vpn_gateway,aws_customer_gateway -timeout 60m
2022/01/06 13:57:51 [DEBUG] Running Sweepers for region (us-west-1):
2022/01/06 13:57:51 [DEBUG] Sweeper (aws_vpn_gateway) has dependency (aws_dx_gateway_association), running..
2022/01/06 13:57:51 [DEBUG] Sweeper (aws_dx_gateway_association) has dependency (aws_dx_gateway_association_proposal), running..
2022/01/06 13:57:51 [DEBUG] Running Sweeper (aws_dx_gateway_association_proposal) in region (us-west-1)
2022/01/06 13:57:51 [INFO] AWS Auth provider used: "EnvProvider"
2022/01/06 13:57:51 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/01/06 13:57:51 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/01/06 13:57:52 [DEBUG] Completed Sweeper (aws_dx_gateway_association_proposal) in region (us-west-1) in 1.171974349s
2022/01/06 13:57:52 [DEBUG] Running Sweeper (aws_dx_gateway_association) in region (us-west-1)
2022/01/06 13:57:53 [DEBUG] Completed Sweeper (aws_dx_gateway_association) in region (us-west-1) in 783.119411ms
2022/01/06 13:57:53 [DEBUG] Sweeper (aws_vpn_gateway) has dependency (aws_vpn_connection), running..
2022/01/06 13:57:53 [DEBUG] Running Sweeper (aws_vpn_connection) in region (us-west-1)
2022/01/06 13:57:54 [DEBUG] Completed Sweeper (aws_vpn_connection) in region (us-west-1) in 428.346217ms
2022/01/06 13:57:54 [DEBUG] Running Sweeper (aws_vpn_gateway) in region (us-west-1)
2022/01/06 13:57:54 [DEBUG] Waiting for state to become: [success]
2022/01/06 13:57:54 [DEBUG] Waiting for state to become: [success]
2022/01/06 13:57:54 [INFO] Deleting EC2 VPN Gateway: vgw-0635427cd09d9283e
2022/01/06 13:57:54 [DEBUG] Waiting for state to become: [success]
2022/01/06 13:57:54 [INFO] Detaching EC2 VPN Gateway (vgw-0f9e40710e8b75fb2) from VPC (vpc-032af5ec8d23ef28e)
2022/01/06 13:57:55 [DEBUG] Waiting for state to become: []
2022/01/06 13:57:56 [INFO] Deleting EC2 VPN Gateway: vgw-0f9e40710e8b75fb2
2022/01/06 13:57:56 [DEBUG] Waiting for state to become: [success]
2022/01/06 13:57:56 [DEBUG] Completed Sweeper (aws_vpn_gateway) in region (us-west-1) in 2.919310439s
2022/01/06 13:57:56 [DEBUG] Sweeper (aws_dx_gateway_association) has dependency (aws_dx_gateway_association_proposal), running..
2022/01/06 13:57:56 [DEBUG] Sweeper (aws_dx_gateway_association_proposal) already ran in region (us-west-1)
2022/01/06 13:57:56 [DEBUG] Sweeper (aws_dx_gateway_association) already ran in region (us-west-1)
2022/01/06 13:57:56 [DEBUG] Sweeper (aws_dx_gateway_association_proposal) already ran in region (us-west-1)
2022/01/06 13:57:56 [DEBUG] Sweeper (aws_vpn_connection) already ran in region (us-west-1)
2022/01/06 13:57:56 [DEBUG] Sweeper (aws_customer_gateway) has dependency (aws_vpn_connection), running..
2022/01/06 13:57:56 [DEBUG] Sweeper (aws_vpn_connection) already ran in region (us-west-1)
2022/01/06 13:57:56 [DEBUG] Running Sweeper (aws_customer_gateway) in region (us-west-1)
2022/01/06 13:57:57 [DEBUG] Waiting for state to become: [success]
2022/01/06 13:57:57 [INFO] Deleting EC2 Customer Gateway: cgw-08204f3a1404061c4
2022/01/06 13:57:57 [DEBUG] Waiting for state to become: []
2022/01/06 13:57:58 [DEBUG] Completed Sweeper (aws_customer_gateway) in region (us-west-1) in 1.426989975s
2022/01/06 13:57:58 Completed Sweepers for region (us-west-1) in 6.730240462s
2022/01/06 13:57:58 Sweeper Tests for region (us-west-1) ran successfully:
	- aws_dx_gateway_association_proposal
	- aws_dx_gateway_association
	- aws_vpn_connection
	- aws_vpn_gateway
	- aws_customer_gateway
ok  	github.com/hashicorp/terraform-provider-aws/internal/sweep	9.968s

@ewbankkit ewbankkit changed the title [WIP] r/customer_gateway - cleanup + certificate_arn r/customer_gateway - cleanup + certificate_arn Jan 6, 2022
@ewbankkit ewbankkit merged commit 323eece into hashicorp:main Jan 7, 2022
@github-actions github-actions bot added this to the v3.72.0 milestone Jan 7, 2022
@github-actions
Copy link

This functionality has been released in v3.72.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@DrFaust92 DrFaust92 deleted the customer-gtw-cert branch January 18, 2022 09:59
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/acmpca Issues and PRs that pertain to the acmpca service. service/appmesh Issues and PRs that pertain to the appmesh service. service/ec2 Issues and PRs that pertain to the ec2 service. service/kafka Issues and PRs that pertain to the kafka service. service/transfer Issues and PRs that pertain to the transfer service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants