github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/avd_docs/aws/sqs/AVD-AWS-0097/CloudFormation.md (about)

     1  
     2  Keep policy scope to the minimum that is required to be effective
     3  
     4  ```yaml---
     5  AWSTemplateFormatVersion: 2010-09-09
     6  Description: Good example of queue policy
     7  Resources:
     8    MyQueue:
     9      Type: AWS::SQS::Queue
    10      Properties:
    11        Name: something
    12    SampleSQSPolicy: 
    13      Type: AWS::SQS::QueuePolicy
    14      Properties: 
    15        Queues: 
    16          - Ref: MyQueue
    17        PolicyDocument: 
    18          Statement: 
    19            - 
    20              Action: 
    21                - "SQS:SendMessage" 
    22                - "SQS:ReceiveMessage"
    23              Effect: "Allow"
    24              Resource: "arn:aws:sqs:us-east-2:444455556666:queue2"
    25              Principal:  
    26                AWS: 
    27                  - "111122223333"        
    28  
    29  ```
    30  
    31