Creation of SQS FIFO in AWS

Creation of SQS FIFO in AWS

Cloudformation:

      
          AWSTemplateFormatVersion: '2010-09-09'
          Description: Template to create the sqs of websocket connections
          Parameters:
            StandardQueueName:
              Type: String
              Description: Queue Name

          Resources:

            QueueRefDLQ:
              Type: AWS::SQS::Queue
              Properties:
                FifoQueue: true
                #QueueName: !Join [ "-", [!Ref StandardQueueName, "dlq"] ]
                QueueName:
                  Fn::Join:
                  - ''
                  - - Ref: StandardQueueName
                    - dlq
                    - ".fifo"

            QueueRef:
              Type: AWS::SQS::Queue
              Properties:
                ContentBasedDeduplication: true
                FifoQueue: true
                QueueName:
                  Fn::Join:
                  - ''
                  - - Ref: StandardQueueName
                    - ".fifo"
                RedrivePolicy:
                  deadLetterTargetArn: !GetAtt
                    - QueueRefDLQ
                    - Arn
                  maxReceiveCount: 3

            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