-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws_servicediscovery: PublicDnsNamespace NS records #20510
Comments
I've created a PR which allows you to access the created hosted zone id from the namespace construct. Otherwise - any functionality about adding record sub3.sub2.sub1.mydomain.com record to HZ for sub2.sub1.mydomain.com I'm unaware of. Our PublicDnsNamespace construct pretty much just creates the same named CloudFormation resource - are you expecting this to happen just when you create a Cloudformation PublicDnsNamespace? |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
@peterwoodworth This is great! Thank you. Given if/when the PR is merged, can I use the created hosted zone id (namespace_hosted_zone_id) from the namespace construct in the same stack to retrieve the Name Server records and then create the NS record in the parent hosted zone? Something like, POC addition to my Python previously submitted. dns.NsRecord(
self,
"ns",
zone=dns.PublicHostedZone.from_lookup(
self,
"parent-hosted-zone",
domain_name=fqdn
),
record_name=service_discovery.namespace_name,
values=dns.PublicHostedZone.from_public_hosted_zone_id(
self,
id="sd-hosted-zone",
public_hosted_zone_id=service_discovery.namespace_hosted_zone_id).hosted_zone_name_servers,
ttl=Duration.seconds(60)
) |
Not quite, but close - the |
@peterwoodworth I'm not seeing where/how that's an option from the documentation, if I'm understanding your correction. Is my example below correct from your last message? dns.NsRecord(
self,
"ns",
zone=dns.PublicHostedZone.from_lookup(
self,
"parent-hosted-zone",
domain_name=fqdn
),
record_name=service_discovery.namespace_name,
values=service_discovery.namespace_hosted_zone_id,
ttl=Duration.seconds(60)
) |
namespaceHostedZoneId will return a string! So I would expect you to be able to put it in an array of strings
|
@peterwoodworth Ah yes, I meant to use as a list above, I didn't realize CFN would see a hosted_zone_id in place of name server records and look-up said records auto-magically given the hosted_zone_id in-place of the name servers. Neat. |
Ack, I spaced pretty bad here, I thought you were describing something slightly different. No, CloudFormation will not magically do that unfortunately. You want to use the the name I'm not sure what the path forward is for you here is. The way we do this for our regular |
You could use a custom resource to get the resource records associated with the hosted zone using a custom resource and the LIstResourceRecordSets API call |
No worries, kind of didn't seem to be the case, but I went with it :-). Truly appreciate the help + insight. I have a side channel Python Boto3 script that looks everything up after the formation event and adds the record to the parent hosted zone. Having it all in the CDK would be brilliant, oh well. Just noticed another response from you while typing this. I do have a footnote in my script to move it to a custom resource Boto3 Lambda, I simply haven't experimented w/ custom resources yet. Still - providing the namespace_hosted_zone_id would provide a tighter lookup, rather than matching on FQDN to find the HostedZone and then finding it's name records. |
…20583) related to #20510 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
We should be supporting the attribute by next release 🙂 |
Awesome, very excited to incorporate. Thank you |
…ws#20583) related to aws#20510 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
When creating a public Service Discovery namespace, the nameserver records are not added to the hosted zone. There doesn't appear to be a way to get the hosted zone ID created from the public Service Discovery namespace. For the example below, NS records are not added to the hosted zone for "sub2.sub1.mydomain.com". A hosted zone is added for "sub3.sub2.sub1.mydomain.com" but the NS records from this HZ are not linked to the HZ for "sub2.sub1.mydomain.com".
Expected Behavior
NS record(s) for sub3.sub2.sub1.mydomain.com is added to HZ for sub2.sub1.mydomain.com
Current Behavior
NS records not added, public Service Discovery namespace fails DNS look-ups
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.25.0 (build ae1cb4b)
Framework Version
No response
Node.js Version
v14.19.1
OS
Windows
Language
Python
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: