Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
80 lines (71 sloc) 2.46 KB
{
"Description" : "S3 & SQS Testing",
"Parameters" : {
"BucketName" : {
"Type": "String",
"Default" : "s3bucket20160920",
"Description" : "Enter the name for the S3 bucket - this must be global unique"
},
"EventQueueName" : {
"Type": "String",
"Default" : "EventSQS",
"Description" : "Enter the name for the SQS queue to receive events from the S3 Bucket"
}
},
"Resources" : {
"S3EventQueue" : {
"Type" : "AWS::SQS::Queue",
"Properties" : {
"QueueName" : { "Ref" : "EventQueueName" },
"VisibilityTimeout" : 20
}
},
"S3EventQueuePolicy" : {
"Type" : "AWS::SQS::QueuePolicy",
"DependsOn" : [ "S3EventQueue" ],
"Properties" : {
"PolicyDocument" : {
"Id": "SQSPolicy",
"Statement": [
{
"Sid": "SQSEventPolicy",
"Effect": "Allow",
"Principal": "*",
"Action": "SQS:*",
"Resource": "*",
"Condition": {
"ArnLike": {
"aws:SourceArn": "arn:aws:s3:::*"
}
}
}
]
},
"Queues" : [ { "Ref" : "S3EventQueue"} ]
}
},
"UploadS3" : {
"Type": "AWS::S3::Bucket",
"DependsOn" : [ "S3EventQueue", "S3EventQueuePolicy" ],
"Properties" : {
"BucketName" : { "Ref" : "BucketName"},
"NotificationConfiguration" : {
"QueueConfigurations" : [
{
"Event" : "s3:ObjectCreated:*",
"Queue" : {
"Fn::GetAtt" : [ "S3EventQueue", "Arn" ]
}
}
]
}
}
},
},
"Outputs" : {
"SQSName" : {
"Description" : "SQS Name from ref",
"Value" : { "Ref" : "S3EventQueue" }
}
}
}