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

resource/aws_rds_cluster: Adding hosted_zone_id as an exported attribute #3267

Merged
merged 2 commits into from
Feb 11, 2018

Conversation

ngenator
Copy link
Contributor

@ngenator ngenator commented Feb 6, 2018

The API returns a hosted zone id so you can create alias records in route53. This pr adds the hosted zone id to the aws_rds_cluster resource so that you can use it in route53 to create alias records.

@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Feb 6, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service. labels Feb 6, 2018
@ngenator
Copy link
Contributor Author

ngenator commented Feb 6, 2018

Should be noted that while you can currently set route53 aliases for RDS db instances and RDS clusters, the route53 documentation claims you can't do it for RDS instances. I haven't found any documentation talking about RDS cluster aliases. Tested via the cli and by manually passing in the hosted zone to the aws_route53_record resource. It's only available through the api, not the console.

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-rds-db.html

I can create some route53 alias acceptance tests for rds db instances and rds clusters if needed

@bflad bflad added this to the v1.10.0 milestone Feb 11, 2018
@bflad
Copy link
Contributor

bflad commented Feb 11, 2018

@ngenator thanks for submitting this! You're definitely on the right track, there are two other parts we'll need to address before this can get in:

  • Add this attribute to the resource Schema, which can be found inside resourceAwsRDSCluster(), e.g.:
"hosted_zone_id": {
	Type:     schema.TypeString,
	Computed: true,
},
  • Add a very simple acceptance test that this new attribute is actually set inside TestAccAWSRDSCluster_basic (I don't think it makes sense to try to determine its value as it'll be different per region), e.g.:
resource.TestCheckResourceAttrSet("aws_rds_cluster.default", "hosted_zone_id"),

We can skip any acceptance testing beyond this for this PR as we've ensured that the aws_rds_cluster resource has correctly (at least to a certain degree) done its part. Since Route53 alias usage would be part of a separate resource, a separate PR (we don't need to delay this one) ensuring that RDS Route53 aliases work in the aws_route53_record acceptance testing would most certainly be welcome of course 😄 .

If you don't have time to fix the above, just let us know and we can finish this up for you. Thanks again! 🚀

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Feb 11, 2018
@ngenator
Copy link
Contributor Author

Whoops, nice catch. For some reason I thought the schema was for the input attributes. I'll fix that and add the acceptance test for the attribute.

@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Feb 11, 2018
@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Feb 11, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

This looks great! :shipit:

make testacc TEST=./aws TESTARGS='-run=TestAccAWSRDSCluster_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSRDSCluster_basic -timeout 120m
=== RUN   TestAccAWSRDSCluster_basic
--- PASS: TestAccAWSRDSCluster_basic (118.46s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	118.514s

@bflad bflad merged commit c2815d5 into hashicorp:master Feb 11, 2018
bflad added a commit that referenced this pull request Feb 11, 2018
@bflad
Copy link
Contributor

bflad commented Feb 27, 2018

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

@ghost
Copy link

ghost commented Apr 7, 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 and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants