I have the access policy set up like the below for an SNS topic. I thought I have allowed only the user2
to subscribe to the topic but user1
can subscribe the topic. How can I configure this for what I want to do?
{
"Version": "2008-10-17",
"Id": "__default_policy_ID",
"Statement": [
{
"Sid": "__console_pub_0",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::${account_id}:user/user1"
},
"Action": "SNS:Publish",
"Resource": "arn:aws:sns:eu-west-2:${account_id}:topic1"
},
{
"Sid": "__console_sub_0",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::${account_id}:user/user2"
},
"Action": [
"SNS:Subscribe",
"SNS:Receive"
],
"Resource": "arn:aws:sns:eu-west-2:${account_id}:topic1"
}
]
}