AWS::Logs::PutResourcePolicy would handle the CW Logs PutResourcePolicy API call
Pretty straight forward - create/update/delete the policy. Ideally be able to skip the PolicyName and have it auto-generate based off the logical name like S3 bucket names do.
API Doc: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutResourcePolicy.html
Management & Governance
I would just like to register that implementing this suggestion would increase the value introduced with the addition of LogPublishingOptions to elasticsearch domain resources (issue #54 ).
Though it's now possible via CloudFormation to create and connect domains with log groups, stack creations / updates fail if you haven't previously "prepped" your account by running a cli command to grant privileges to the es.amazonaws.com service, like ...
aws logs put-resource-policy --policy-name elasticsearch-logging --policy-document '{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "es.amazonaws.com" ] }, "Action": [ "logs:CreateLogStream", "logs:PutLogEvents", "logs:PutLogEventsBatch" ], "Resource": "arn:aws:logs:*:*:log-group:/aws/aes/domains/*:*" } ] }'
Not having this feature makes it impossible to construct a Route 53 DNS Hosted Zone with logging entirely in CloudFormation, which is practically a requirement for adoption by our team. Please add this soon!
totally defeats the purpose of having LogPublishingOptions for Elasticsearch in Cloudformation
+1 to this. Please add this to CF
+1 LogPublishingOptions for Elasticsearch in Cloudformation is unusable without it
+1 to this. Please add to CF
+1 for the Elasticsearch LogPublishingOptions scenario. I'm actively watching this to avoid the need of a lambda-backed CloudFormation custom resource.
+1 I have auditors requiring this and would really rather avoid implementing lambda backed custom resources where possible
+1 ! :)
Add this feature for ElasticSearch
I need this for Route53 query logging in the CDK.
Most helpful comment
I would just like to register that implementing this suggestion would increase the value introduced with the addition of
LogPublishingOptionsto elasticsearch domain resources (issue #54 ).Though it's now possible via CloudFormation to create and connect domains with log groups, stack creations / updates fail if you haven't previously "prepped" your account by running a cli command to grant privileges to the es.amazonaws.com service, like ...