-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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-route53): Query Logging #29095
Comments
According to this
Looks like it would be enabled if It's great to have a method like that but you still can enable that when you create the HostedZone, right? |
Correct; You can enable it when creating the HostedZone. The issue comes when trying to follow the recommendation:
The HostedZone has to be created; before that value can be set following the recommendations; but because the LogGroup hasn't been created yet, its not possible to set the queryLoggingConfig. To be clear; I understand I'm changing a setting "after the resource was created" but that is not my intent. If there is a best practice or something obvious I'm missing please let me know; this is the first time I'm using cdk. |
If I'm understanding this right, I think I hit a similar use-case. I want my stack to interact with Public Hosted Zones created through the AWS Domain Registration tool. The problem is you can import them, but you can't add logging afterwards, like mentioned above. (And I'd like to add a subscription filter to the logs). The only way I've found to get around this is to create a second Public Hosted Zone (with logging) in my stack, and add a NsRecord to point queries to the Zone I have direct control over. Something like: # The imported one you have no control over :/
const rootHostedZone = route53.HostedZone.fromLookup(this, 'HostedZone', {
domainName: <domain-name>,
});
# Create a second with logging this time:
const subdomainHostedZone = new route53.HostedZone(
this,
'SubdomainHostedZone',
{
zoneName: subdomain,
queryLogsLogGroupArn: queryLogGroup.logGroupArn,
}
);
# And tie them together with a NsRecord
const nsRecord = new route53.NsRecord(this, 'NSRecord', {
zone: rootHostedZone,
values: subdomainHostedZone.hostedZoneNameServers as string[],
recordName: subdomain,
}); Just being able to modify the original "fromLookup" zone would make things much simpler. Edit: I just realized you linked a issue in the initial post that explains why this isn't possible, Rip. Hopefully the example helps someone out there at least. |
Describe the feature
There should be a way to enable/disable query logging on hosted zones after they are created.
Currently it appears that this is only possible when creating a hosted zone; but it should be possible to enable/disable Query Logging on an already created Hosted Zone.
Use Case
Attempting to following the guidance provided at: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53-hostedzone.html#cfn-route53-hostedzone-queryloggingconfig
We can assume a cdk stack that looks similar to this:
Proposed Solution
Something as Simple as
PublicHostedZone.enableQueryLogging(LogGroup);
Other Information
Possibly related to #15296 ; and possibly requires a larger RFC as a similar issue exists in CloudFormation.
Acknowledgements
CDK version used
2.127.0 (build 6c90efc)
Environment details (OS name and version, etc.)
Arch Linux
The text was updated successfully, but these errors were encountered: