Stack to create a SQS in AWS

Stack to create a SQS in AWS

Cloudformation:

      
      AWSTemplateFormatVersion: '2010-09-09'
      Description: Template to create the sqs in aws
      Parameters:
        Stage:
          Description: Environment Name
          Type: String
        StandardQueueName:
          Type: String
          Description: Queue Name

      Resources:
        QueueRefDLQ:
          Type: AWS::SQS::Queue
          Properties:
            QueueName: !Join [ "-", [!Ref StandardQueueName, "dlq"] ]
            Tags:
              - 
                Key: "environment"
                Value: !Ref Stage

        QueueRef:
          Type: AWS::SQS::Queue
          Properties:
            QueueName: !Ref StandardQueueName
            ReceiveMessageWaitTimeSeconds: 10
            VisibilityTimeout: 900
            KmsMasterKeyId: alias/aws/sqs
            RedrivePolicy:
              deadLetterTargetArn: !GetAtt
                - QueueRefDLQ
                - Arn
              maxReceiveCount: 3
            Tags:
              - 
                Key: "environment"
                Value: !Ref Stage

        QueueRefPolicy:
          Type: AWS::SQS::QueuePolicy
          Properties:
            PolicyDocument:
              Version: "2012-10-17"
              Statement:
                - Sid: "allow-role-lambdas"
                  Effect: Allow
                  Principal:
                    AWS:
                      - !Sub ${AWS::AccountId}
                  Resource: !GetAtt
                    - QueueRef
                    - Arn
                  Action: 
                      - "SQS:SendMessage"
                      - "SQS:DeleteMessage"
            Queues:
              - Ref: QueueRef

      
  

Comentarios

Entradas más populares de este blog

Ejemplo Log4j 2 en JAVA | Log4j 2 en Springboot | Configuración Log4j 2 | Log4j 2 in SpringBoot| Example Log4j 2 in SpringBoot | Configuring Log4j 2

Python: Inyección de dependencias

GOlang con Docker | GOlang with Docker | GO con Docker | GO with Docker