1 commento
UPDATE: It's not the Principal that's the problem it's the Condition. Without the condition I've set the Principal to "Service": "cloudwatch.amazonaws.com" and my CloudWatch alarm is able to publish to the SNS topic. When I add the condition it stops working. I am doing this via CloudFormation so wondering if my code is not right?
RootAccountUsageSNSTopicPolicy:
Type: AWS::SNS::TopicPolicy
Properties:
...
...
Condition:
StringEquals:
'aws:PrincipalOrgID': !Sub ${OrganizationID}
Struggling to get this working so that my CloudWatch alarm can publish to an SNS topic in a different account. I have tried:
"Principal": {
"AWS": "*"
}
"Principal": "*"
and
"Principal": {
"Service": "cloudwatch.amazonaws.com"
}
Each time I get:
AWS Internal is not authorized to perform: SNS:Publish on resource: arn:aws:sns:us-east-1:123456789012:RootAccountUsageSNSTopic because no resource-based policy allows the SNS:Publish action
With
"Principal": {
"AWS": "*"
}
I was able to publish to the SNS topic from a different account using AWS CLI, it just doesn't work when CloudWatch tried to publish to it.
risposta un anno fa
