Entradas

Mostrando las entradas de marzo, 2023

Stack to create a table with DynamoDB in AWS

Stack to create a table with DynamoDB in AWS Cloudformation: Description: Table for create an user Parameters: Stage: Description: Environment Name Type: String DynamodbTableName: Description: Table name Type: String Resources: SATContractsDBTable: Type: AWS::DynamoDB::Table Properties: TableName: !Sub "${DynamodbTableName}" BillingMode: PAY_PER_REQUEST AttributeDefinitions: - AttributeName: id AttributeType: N - AttributeName: username AttributeType: S KeySchema: - AttributeName: id KeyType: HASH - AttributeName: username KeyType: RANGE Tags: -

Stack to create a S3 bucket

Stack to create a S3 bucket Cloudformation: Description: Stack to create a S3 bucket for only read files. Parameters: Stage: Description: Environment Name Type: String BucketName: Type: String Description: The bucket name OriginURL: Description: Origin url name Type: String Resources: S3FilesBucket: Type: AWS::S3::Bucket Properties: BucketName: !Ref BucketName VersioningConfiguration: Status: Enabled BucketEncryption: ServerSideEncryptionConfiguration: - ServerSideEncryptionByDefault: SSEAlgorithm: AES256 PublicAccessBlockConfiguration: BlockPublicAcls : true BlockPublicPolicy : true IgnorePublicAcls : true RestrictPublicBuckets : true CorsConfiguration: CorsRules: - AllowedHeaders: - x-amz-* AllowedMethods: - PUT AllowedOrigins: - !Ref OriginURL ExposedHeaders: - Connection - Server -

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: - '

Websocket with API Gateway AWS | Websocket con API Gateway AWS

Ejemplo de implementación de Websocket con API Gateway de AWS. Cloudformation: AWSTemplateFormatVersion: '2010-09-09' #Transform: AWS::Serverless-2016-10-31 Description: websockets to notify to the frontend. Parameters: WebSocketName: Description: Websocket name Type: String Resources: WebSocket: Type: AWS::ApiGatewayV2::Api Properties: Name: !Sub ${WebSocketName} ProtocolType: WEBSOCKET RouteSelectionExpression: "$request.body.action" Description: "Mock WebSocket API Gateway." ConnectRoute: Type: AWS::ApiGatewayV2::Route Properties: ApiId: !Ref WebSocket RouteKey: $connect #RouteResponseSelectionExpression: '$default' AuthorizationType: NONE OperationN