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

New Data Source: aws_rds_certificate #15221

Closed
bflad opened this issue Sep 18, 2020 · 3 comments · Fixed by #15789
Closed

New Data Source: aws_rds_certificate #15221

bflad opened this issue Sep 18, 2020 · 3 comments · Fixed by #15789
Assignees
Labels
new-data-source Introduces a new data source. partition/aws-us-gov Pertains to the aws-us-gov partition. service/rds Issues and PRs that pertain to the rds service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Sep 18, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

RDS Certificates differ between AWS Commercial and GovCloud (US):

        {
            "CertificateIdentifier": "rds-ca-2019",
            "CertificateType": "CA",
            "Thumbprint": "c8de1d13ad359b3dea182adcb4796d2247753c4a",
            "ValidFrom": "2019-09-16T18:21:15+00:00",
            "ValidTill": "2024-08-22T17:08:50+00:00",
            "CertificateArn": "arn:aws:rds:us-west-2::cert:rds-ca-2019",
            "CustomerOverride": false
        }

        {
            "CertificateIdentifier": "rds-ca-2017",
            "CertificateType": "CA",
            "Thumbprint": "77558cc45e711f1b57e3da6e5b7427124ee869e8",
            "ValidFrom": "2017-05-19T22:31:19+00:00",
            "ValidTill": "2022-05-18T12:00:00+00:00",
            "CertificateArn": "arn:aws-us-gov:rds:us-gov-west-1::cert:rds-ca-2017"
        }

Thumbprints also differ between regions. This difference causes failures in our hardcoded test configurations:

=== CONT  TestAccAWSDBInstance_CACertificateIdentifier
TestAccAWSDBInstance_CACertificateIdentifier: resource_aws_db_instance_test.go:2991: Step 1/1 error: terraform failed: exit status 1
stderr:
Error: error modifying DB Instance (terraform-20200918073750038000000001): CertificateNotFound: Certificate not found: rds-ca-2019
  status code: 404, request id: 61e06444-7f68-472c-b97d-a0fff6c6974e
--- FAIL: TestAccAWSDBInstance_CACertificateIdentifier (508.55s)

We can support a new data source to lookup this information. 👍 It looks like the other RDS-backed services are also beginning to support this type of lookup, but those can have their own tracking issues.

New Data Source

  • aws_rds_certificate

Potential Terraform Configuration

data "aws_rds_certificate" "test" {
  most_recent = true
}

resource "aws_db_instance" "test" {
  # ... other configuration ...

  ca_cert_identifier  = data.aws_rds_certificate.test.id
}

References

@bflad bflad added new-data-source Introduces a new data source. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/rds Issues and PRs that pertain to the rds service. partition/aws-us-gov Pertains to the aws-us-gov partition. labels Sep 18, 2020
@bflad bflad self-assigned this Oct 22, 2020
bflad added a commit that referenced this issue Oct 22, 2020
Reference: #15221

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSRDSCertificateDataSource_LatestValidTill (10.41s)
--- PASS: TestAccAWSRDSCertificateDataSource_Id (11.03s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSRDSCertificateDataSource_LatestValidTill (15.02s)
--- PASS: TestAccAWSRDSCertificateDataSource_Id (16.86s)
```
@bflad bflad added this to the v3.12.0 milestone Oct 22, 2020
bflad added a commit that referenced this issue Oct 22, 2020
Reference: #15221

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSRDSCertificateDataSource_LatestValidTill (10.41s)
--- PASS: TestAccAWSRDSCertificateDataSource_Id (11.03s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSRDSCertificateDataSource_LatestValidTill (15.02s)
--- PASS: TestAccAWSRDSCertificateDataSource_Id (16.86s)
```
@bflad
Copy link
Contributor Author

bflad commented Oct 22, 2020

Support for this new data source has been merged and will release with version 3.12.0 of the Terraform AWS Provider, likely later today.

@ghost
Copy link

ghost commented Oct 22, 2020

This has been released in version 3.12.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
Copy link

ghost commented Nov 22, 2020

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 Nov 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. partition/aws-us-gov Pertains to the aws-us-gov partition. service/rds Issues and PRs that pertain to the rds service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant