如果我通过Cloudformation创建一个SQS队列,能否在创建后附加第二个QueuePolicy?
如果我运行以下配置:
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
我能创建与创建的队列关联的另一个QueuePolicy吗?如何关联它?通过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