Last active
November 11, 2019 17:18
-
-
Save Tahooralisyed/54fae0defc807f219148cb6a5f4f90ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"SQS1": { | |
"Type": "AWS::SQS::Queue", | |
"Properties": { | |
"VisibilityTimeout": 40, | |
"MessageRetentionPeriod": 1209600, | |
"RedrivePolicy": { | |
"deadLetterTargetArn": { | |
"Fn::GetAtt": [ | |
"SQS2", | |
"Arn" | |
] | |
}, | |
"maxReceiveCount": 2 | |
}, | |
"QueueName": { | |
"Fn::Join": [ | |
"-", | |
[ | |
{ | |
"Ref": "ENV" | |
}, | |
{ | |
"Fn::FindInMap": [ | |
"RegionCodeMapping", | |
{ | |
"Ref": "AWS::Region" | |
}, | |
"regionCode" | |
] | |
}, | |
{ | |
"Ref": "TeamName" | |
}, | |
"DistributedTracingStateSpanEvent" | |
] | |
] | |
} | |
}, | |
"Metadata": { | |
"AWS::CloudFormation::Designer": { | |
"id": "4ff64496-acfa-409f-b919-3a9031f481bd" | |
} | |
} | |
}, | |
"SQS2": { | |
"Type": "AWS::SQS::Queue", | |
"Properties": { | |
"MessageRetentionPeriod": 1209600, | |
"QueueName": { | |
"Fn::Join": [ | |
"-", | |
[ | |
{ | |
"Ref": "ENV" | |
}, | |
{ | |
"Fn::FindInMap": [ | |
"RegionCodeMapping", | |
{ | |
"Ref": "AWS::Region" | |
}, | |
"regionCode" | |
] | |
}, | |
{ | |
"Ref": "TeamName" | |
}, | |
"DistributedTracingStateSpanEvent", | |
"DLQ" | |
] | |
] | |
} | |
}, | |
"Metadata": { | |
"AWS::CloudFormation::Designer": { | |
"id": "d4c9ed58-3374-4252-a3cf-6df8ad58a69d" | |
} | |
} | |
}, | |
"SQS3": { | |
"Type": "AWS::SQS::Queue", | |
"Properties": { | |
"VisibilityTimeout": 40, | |
"MessageRetentionPeriod": 1209600, | |
"RedrivePolicy": { | |
"deadLetterTargetArn": { | |
"Fn::GetAtt": [ | |
"SQS4", | |
"Arn" | |
] | |
}, | |
"maxReceiveCount": 2 | |
}, | |
"QueueName": { | |
"Fn::Join": [ | |
"-", | |
[ | |
{ | |
"Ref": "ENV" | |
}, | |
{ | |
"Fn::FindInMap": [ | |
"RegionCodeMapping", | |
{ | |
"Ref": "AWS::Region" | |
}, | |
"regionCode" | |
] | |
}, | |
{ | |
"Ref": "TeamName" | |
}, | |
"DistributedTracingSushiNotifier" | |
] | |
] | |
} | |
}, | |
"Metadata": { | |
"AWS::CloudFormation::Designer": { | |
"id": "2529cceb-5530-4368-9483-f82831fea1b6" | |
} | |
} | |
}, | |
"SQS4": { | |
"Type": "AWS::SQS::Queue", | |
"Properties": { | |
"MessageRetentionPeriod": 1209600, | |
"QueueName": { | |
"Fn::Join": [ | |
"-", | |
[ | |
{ | |
"Ref": "ENV" | |
}, | |
{ | |
"Fn::FindInMap": [ | |
"RegionCodeMapping", | |
{ | |
"Ref": "AWS::Region" | |
}, | |
"regionCode" | |
] | |
}, | |
{ | |
"Ref": "TeamName" | |
}, | |
"DistributedTracingSushiNotifier", | |
"DLQ" | |
] | |
] | |
} | |
}, | |
"Metadata": { | |
"AWS::CloudFormation::Designer": { | |
"id": "063a6c61-51d4-40e9-b0ac-422179aba91e" | |
} | |
} | |
}, | |
"SinkBucket": { | |
"Type": "AWS::S3::Bucket", | |
"Properties": { | |
"BucketName": { | |
"Fn::Join": [ | |
"-", | |
[ | |
{ | |
"Ref": "ENV" | |
}, | |
{ | |
"Ref": "TeamName" | |
}, | |
"distributed-tracing-shushi-sink", | |
{ | |
"Ref": "AWS::Region" | |
} | |
] | |
] | |
} | |
}, | |
"Metadata": { | |
"AWS::CloudFormation::Designer": { | |
"id": "a25ef55e-ef0b-4b9a-ac0d-724602e82daa" | |
} | |
} | |
}, | |
"DTracingActionLogSushiSinkS3BucketPolicy": { | |
"Type": "AWS::S3::BucketPolicy", | |
"Properties": { | |
"Bucket": { | |
"Ref": "SinkBucket" | |
}, | |
"PolicyDocument": { | |
"Statement": [ | |
{ | |
"Action": [ | |
"s3:PutObject" | |
], | |
"Effect": "Allow", | |
"Resource": { | |
"Fn::Join": [ | |
"", | |
[ | |
"arn:aws:s3:::", | |
{ | |
"Ref": "SinkBucket" | |
}, | |
"/*" | |
] | |
] | |
}, | |
"Principal": { | |
"AWS": "arn:aws:iam::316364526467:root" | |
} | |
} | |
] | |
} | |
}, | |
"Metadata": { | |
"AWS::CloudFormation::Designer": { | |
"id": "14d237cb-1152-401f-8418-275617a472fc" | |
} | |
} | |
}, | |
"DTracingActionEventsShushiNotifier": { | |
"Type": "AWS::SQS::QueuePolicy", | |
"Properties": { | |
"Queues": [ | |
{ | |
"Ref" : "SQS3" | |
} | |
], | |
"PolicyDocument": { | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": [ | |
"316364526467" | |
] | |
}, | |
"Action": [ | |
"SQS:GetQueueUrl", | |
"SQS:GetQueueAttributes", | |
"SQS:SendMessage" | |
] | |
} | |
] | |
} | |
}, | |
"Metadata": { | |
"AWS::CloudFormation::Designer": { | |
"id": "67ac0183-f747-431e-aca8-325cc4a13e97" | |
} | |
} | |
} | |
}, | |
"Mappings": { | |
"RegionCodeMapping": { | |
"us-east-1": { | |
"regionCode": "US" | |
}, | |
"us-west-2": { | |
"regionCode": "FE" | |
}, | |
"eu-west-1": { | |
"regionCode": "EU" | |
} | |
} | |
}, | |
"Parameters": { | |
"ENV": { | |
"Description": "Enter Envirment type e.g. dev,test,prod", | |
"Type": "String", | |
"AllowedValues": [ | |
"devo", | |
"test", | |
"prod" | |
] | |
}, | |
"TeamName": { | |
"Description": "Enter Name TeamName", | |
"Type": "String", | |
"AllowedPattern": "^[a-z0-9-]*$" | |
} | |
}, | |
"Outputs": { | |
"StateSpanSQS": { | |
"Description": "ARN of State Events SQS Queue", | |
"Value": { | |
"Fn::GetAtt": [ | |
"SQS1", | |
"Arn" | |
] | |
} | |
}, | |
"StateSpanSQSDLQ": { | |
"Description": "ARN of State Events SQS-DLQ Queues", | |
"Value": { | |
"Fn::GetAtt": [ | |
"SQS2", | |
"Arn" | |
] | |
} | |
}, | |
"SushiNotifierSQS": { | |
"Description": "ARN of SushiNotifier SQS-DLQ Queues", | |
"Value": { | |
"Fn::GetAtt": [ | |
"SQS3", | |
"Arn" | |
] | |
} | |
}, | |
"SushiNotifierSQSDLQ": { | |
"Description": "ARN of SushiNotifier SQS-DLQ Queues", | |
"Value": { | |
"Fn::GetAtt": [ | |
"SQS4", | |
"Arn" | |
] | |
} | |
}, | |
"S3BucketName": { | |
"Description": "Sushi will dump log files in this bucket", | |
"Value": { | |
"Fn::GetAtt": [ | |
"SinkBucket", | |
"Arn" | |
] | |
} | |
} | |
}, | |
"Metadata": { | |
"AWS::CloudFormation::Designer": { | |
"a25ef55e-ef0b-4b9a-ac0d-724602e82daa": { | |
"size": { | |
"width": 60, | |
"height": 60 | |
}, | |
"position": { | |
"x": 60, | |
"y": 90 | |
}, | |
"z": 1, | |
"embeds": [] | |
}, | |
"14d237cb-1152-401f-8418-275617a472fc": { | |
"size": { | |
"width": 60, | |
"height": 60 | |
}, | |
"position": { | |
"x": 180, | |
"y": 90 | |
}, | |
"z": 1, | |
"embeds": [], | |
"isassociatedwith": [ | |
"a25ef55e-ef0b-4b9a-ac0d-724602e82daa" | |
] | |
}, | |
"063a6c61-51d4-40e9-b0ac-422179aba91e": { | |
"size": { | |
"width": 60, | |
"height": 60 | |
}, | |
"position": { | |
"x": 60, | |
"y": 210 | |
}, | |
"z": 1, | |
"embeds": [] | |
}, | |
"2529cceb-5530-4368-9483-f82831fea1b6": { | |
"size": { | |
"width": 60, | |
"height": 60 | |
}, | |
"position": { | |
"x": 180, | |
"y": 210 | |
}, | |
"z": 1, | |
"embeds": [] | |
}, | |
"d4c9ed58-3374-4252-a3cf-6df8ad58a69d": { | |
"size": { | |
"width": 60, | |
"height": 60 | |
}, | |
"position": { | |
"x": 300, | |
"y": 90 | |
}, | |
"z": 1, | |
"embeds": [] | |
}, | |
"4ff64496-acfa-409f-b919-3a9031f481bd": { | |
"size": { | |
"width": 60, | |
"height": 60 | |
}, | |
"position": { | |
"x": 300, | |
"y": 210 | |
}, | |
"z": 1, | |
"embeds": [] | |
}, | |
"67ac0183-f747-431e-aca8-325cc4a13e97": { | |
"size": { | |
"width": 60, | |
"height": 60 | |
}, | |
"position": { | |
"x": 150, | |
"y": 320 | |
}, | |
"z": 1, | |
"embeds": [], | |
"isassociatedwith": [ | |
"2529cceb-5530-4368-9483-f82831fea1b6" | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment