Created
August 16, 2022 11:47
-
-
Save zxkane/e33bf78c5e4908e0e8f0ec98f6914a07 to your computer and use it in GitHub Desktop.
reset resource policy of CloudWatch logs, see doc https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-logs-infrastructure-CWL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws logs put-resource-policy --policy-name AWSLogDeliveryWrite20150319 \ | |
--policy-document ' | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AWSLogDeliveryWrite", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "delivery.logs.amazonaws.com" | |
}, | |
"Action": [ | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], | |
"Resource": [] | |
}, | |
{ | |
"Sid": "AWSLogDeliveryWrite2", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "delivery.logs.amazonaws.com" | |
}, | |
"Action": [ | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], | |
"Resource": [ | |
], | |
"Condition": { | |
"StringEquals": { | |
"aws:SourceAccount": "845861764576" | |
}, | |
"ArnLike": { | |
"aws:SourceArn": "arn:aws:logs:us-east-1:845861764576:*" | |
} | |
} | |
} | |
] | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment