Skip to content

resource/aws_lb_listener_certificate: Prevent resource ID parsing error with IAM Server Certificate names containing underscores#17645

Merged
bflad merged 2 commits into
mainfrom
b-aws_lb_listener_certificate-certificate_arn-underscores
Feb 17, 2021
Merged

resource/aws_lb_listener_certificate: Prevent resource ID parsing error with IAM Server Certificate names containing underscores#17645
bflad merged 2 commits into
mainfrom
b-aws_lb_listener_certificate-certificate_arn-underscores

Conversation

@bflad

@bflad bflad commented Feb 16, 2021

Copy link
Copy Markdown
Contributor

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

Closes #17639

Previously:

=== CONT  TestAccAwsLbListenerCertificate_CertificateArn_Underscores
    resource_aws_lb_listener_certificate_test.go:54: Step 1/2 error: Error running apply: exit status 1

        Error: error parsing ELBv2 Listener Certificate ID (arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/tf-acc-test-1918488772698388616/37ea83aabfff17e9/c77f900678310ecd_arn:aws:iam::123456789012:server-certificate/tf_acc_test_1918488772698388616): unexpected format for ID ("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/tf-acc-test-1918488772698388616/37ea83aabfff17e9/c77f900678310ecd_arn:aws:iam::123456789012:server-certificate/tf_acc_test_1918488772698388616"), expected listener-arn_certificate-arn

--- FAIL: TestAccAwsLbListenerCertificate_CertificateArn_Underscores (161.31s)

Output from acceptance testing in AWS Commercial:

--- PASS: TestAccAwsLbListenerCertificate_disappears (165.35s)
--- PASS: TestAccAwsLbListenerCertificate_CertificateArn_Underscores (167.76s)
--- PASS: TestAccAwsLbListenerCertificate_basic (168.14s)
--- PASS: TestAccAwsLbListenerCertificate_multiple (243.26s)

Output from acceptance testing in AWS GovCloud (US):

--- PASS: TestAccAwsLbListenerCertificate_CertificateArn_Underscores (159.16s)
--- PASS: TestAccAwsLbListenerCertificate_disappears (162.81s)
--- PASS: TestAccAwsLbListenerCertificate_basic (170.08s)
--- PASS: TestAccAwsLbListenerCertificate_multiple (272.30s)

…or with IAM Server Certificate names containing underscores

Reference: #17639

Previously:

```
=== CONT  TestAccAwsLbListenerCertificate_CertificateArn_Underscores
    resource_aws_lb_listener_certificate_test.go:54: Step 1/2 error: Error running apply: exit status 1

        Error: error parsing ELBv2 Listener Certificate ID (arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/tf-acc-test-1918488772698388616/37ea83aabfff17e9/c77f900678310ecd_arn:aws:iam::123456789012:server-certificate/tf_acc_test_1918488772698388616): unexpected format for ID ("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/tf-acc-test-1918488772698388616/37ea83aabfff17e9/c77f900678310ecd_arn:aws:iam::123456789012:server-certificate/tf_acc_test_1918488772698388616"), expected listener-arn_certificate-arn

--- FAIL: TestAccAwsLbListenerCertificate_CertificateArn_Underscores (161.31s)
```

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAwsLbListenerCertificate_disappears (165.35s)
--- PASS: TestAccAwsLbListenerCertificate_CertificateArn_Underscores (167.76s)
--- PASS: TestAccAwsLbListenerCertificate_basic (168.14s)
--- PASS: TestAccAwsLbListenerCertificate_multiple (243.26s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAwsLbListenerCertificate_CertificateArn_Underscores (159.16s)
--- PASS: TestAccAwsLbListenerCertificate_disappears (162.81s)
--- PASS: TestAccAwsLbListenerCertificate_basic (170.08s)
--- PASS: TestAccAwsLbListenerCertificate_multiple (272.30s)
```
@bflad bflad added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. labels Feb 16, 2021
@bflad bflad requested a review from a team as a code owner February 16, 2021 21:16
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/elbv2 Issues and PRs that pertain to the elbv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Feb 16, 2021

@anGie44 anGie44 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great 🚀

@bflad bflad merged commit b8b46b9 into main Feb 17, 2021
@bflad bflad deleted the b-aws_lb_listener_certificate-certificate_arn-underscores branch February 17, 2021 15:49
@github-actions github-actions Bot added this to the v3.29.0 milestone Feb 17, 2021
github-actions Bot pushed a commit that referenced this pull request Feb 17, 2021
heitorlessa added a commit to heitorlessa/terraform-provider-aws that referenced this pull request Feb 18, 2021
…r-aws into main

* 'main' of https://github.com/hashicorp/terraform-provider-aws: (599 commits)
  Adds CHANGELOG
  Updates acceptance tests and documentation
  Update CHANGELOG.md for hashicorp#17650
  Removes redundant error check
  Update CHANGELOG.md for hashicorp#17645
  resource/aws_lb_listener_certificate: Prevent resource ID parsing error with IAM Server Certificate names containing underscores (hashicorp#17645)
  resource/aws_instance: Apply attribute waiter logic to iam_instance_profile attribute (hashicorp#17414)
  Update CHANGELOG.md for hashicorp#17534
  Adds multi-error handling to ElastiCache Cluster sweeper
  Excludes Clusters in Replication Groups from sweeper
  Adds check for deleting only member of replication group and does not retry
  Update CHANGELOG.md for hashicorp#17204
  Update docs for cloudfront_distribution resource
  fix(aws_ses_reciept_rule): include period in name validation regex
  Add CHANGELOG entry.
  r/aws_dx_gateway_association: Fix 'TestAccAwsDxGatewayAssociation_multiVpnGatewaysSingleAccount'.
  r/aws_ec2_transit_gateway: Increase deletion IncorrectState retry to 5 minutes.
  Update CHANGELOG.md after release
  fix if evaluation
  r/aws_dx_gateway_association: Modernize acceptance tests.
  ...
heitorlessa added a commit to heitorlessa/terraform-provider-aws that referenced this pull request Feb 18, 2021
* main: (599 commits)
  Adds CHANGELOG
  Updates acceptance tests and documentation
  Update CHANGELOG.md for hashicorp#17650
  Removes redundant error check
  Update CHANGELOG.md for hashicorp#17645
  resource/aws_lb_listener_certificate: Prevent resource ID parsing error with IAM Server Certificate names containing underscores (hashicorp#17645)
  resource/aws_instance: Apply attribute waiter logic to iam_instance_profile attribute (hashicorp#17414)
  Update CHANGELOG.md for hashicorp#17534
  Adds multi-error handling to ElastiCache Cluster sweeper
  Excludes Clusters in Replication Groups from sweeper
  Adds check for deleting only member of replication group and does not retry
  Update CHANGELOG.md for hashicorp#17204
  Update docs for cloudfront_distribution resource
  fix(aws_ses_reciept_rule): include period in name validation regex
  Add CHANGELOG entry.
  r/aws_dx_gateway_association: Fix 'TestAccAwsDxGatewayAssociation_multiVpnGatewaysSingleAccount'.
  r/aws_ec2_transit_gateway: Increase deletion IncorrectState retry to 5 minutes.
  Update CHANGELOG.md after release
  fix if evaluation
  r/aws_dx_gateway_association: Modernize acceptance tests.
  ...
@ghost

ghost commented Feb 19, 2021

Copy link
Copy Markdown

This has been released in version 3.29.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 for triage. Thanks!

@ghost

ghost commented Mar 19, 2021

Copy link
Copy Markdown

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elbv2 Issues and PRs that pertain to the elbv2 service. size/M Managed by automation to categorize the size of a PR. 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.

aws_lb_listener_certificate throws error parsing ELBv2 Listener Certificate ID if iam cert name contains "_"

3 participants