if i am creating an SQS Queue via Cloudformation, are you able to attach an second QueuePolicy after the SQS Queue has been created?
if i do run this following config:
Resources:
SQSQueue:
Properties:
QueueName: !Ref SQSQueuename
Type: 'AWS::SQS::Queue'
QueuePolicy:
Type: 'AWS::SQS::QueuePolicy'
Properties:
PolicyDocument:
Id: !Ref SQSQueuename
Statement:
- Sid: QueuePolicy2-SendMessage-To-Queue-From-SNS-Topic
Effect: Allow
Principal:
AWS: !Ref AccountID
Action:
- 'sqs:*'
Resource: 'arn:aws:sqs:eu-central-1:123456789010:${SQSQueuename}'
Queues:
- !Ref SQSQueue
DependsOn:
- SQSQueue
Are i am able to create another QueuePolicy attached to the created Queue? And How would i attach it? Via ARN?
Resources:
SecondQueuePolicy:
Type: 'AWS::SQS::QueuePolicy'
Properties:
PolicyDocument:
Id: !Ref SQSQueuename
Statement:
- Sid: QueuePolicy2-SendMessage-To-Queue-From-SNS-Topic
Effect: Allow
Principal:
AWS: !Ref AccountID
Action:
- 'sqs:*'
Resource: 'arn:aws:sqs:eu-central-1:123456789010:${SQSQueuename}'
Queues:
- !Ref SQSQueue <-- how do i ref to the Queue ?
DependsOn:
- SQSQueue
Fn::ImportValue. - kichik