Skip to content

Instantly share code, notes, and snippets.

@makolyte
Created April 5, 2020 13:53
Show Gist options
  • Save makolyte/ce563262fa5bab9935b07b9edd1781c1 to your computer and use it in GitHub Desktop.
Save makolyte/ce563262fa5bab9935b07b9edd1781c1 to your computer and use it in GitHub Desktop.
AWS stack template for SQS
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Sample stack for Spring Aws Sqs",
"Resources": {
"QuoteQueue": {
"Type": "AWS::SQS::Queue",
"Properties": {}
},
"SqsAdmin": {
"Type": "AWS::IAM::User",
"Properties": {
"Path": "/",
"Policies": [
{
"PolicyName": "giveaccesstoqueueonly",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sqs:*"
],
"Resource": [
{
"Fn::GetAtt": [
"QuoteQueue",
"Arn"
]
}
]
},
{
"Effect": "Deny",
"Action": [
"sqs:*"
],
"NotResource": [
{
"Fn::GetAtt": [
"QuoteQueue",
"Arn"
]
}
]
}
]
}
},
{
"PolicyName": "readonlyaccesstocloudformation",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:Describe*",
"cloudformation:EstimateTemplateCost",
"cloudformation:Get*",
"cloudformation:List*",
"cloudformation:ValidateTemplate",
"cloudformation:Detect*"
],
"Resource": [
"*"
]
}
]
}
}
]
}
},
"SqsAdminAccessKey": {
"Type": "AWS::IAM::AccessKey",
"Properties": {
"UserName": {
"Ref": "SqsAdmin"
}
}
}
},
"Outputs": {
"AccessKeyForSqsAdmin": {
"Value": {
"Ref": "SqsAdminAccessKey"
}
},
"SecretKeyForSqsAdmin": {
"Value": {
"Fn::GetAtt": [
"SqsAdminAccessKey",
"SecretAccessKey"
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment