Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nivleshc/3f321b1f1cb6ecb3126436cfabddde84 to your computer and use it in GitHub Desktop.

Select an option

Save nivleshc/3f321b1f1cb6ecb3126436cfabddde84 to your computer and use it in GitHub Desktop.
This gist contains code from the file iam-roles.tf inside the product-s3-bucket folder, which is part of the blog-aws-service-catalog-for-terraform-products repository.
resource "aws_iam_policy" "service_catalog_product_s3_bucket_launch_contraint_role_policy" {
name = "service-catalog-product-s3-bucket-launch-constraint-role-policy"
policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCloudFormationAccess",
"Effect": "Allow",
"Action": [
"CloudFormation:*",
"lambda:Get*",
"lambda:Describe*",
"lambda:List*",
"lambda:InvokeFunction",
"s3:List*",
"s3:Get*"
],
"Resource": "*"
},
{
"Sid": "AllowAccessToArtifactsS3Buket",
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "${data.aws_s3_bucket.artifacts_s3_bucket.arn}/*"
},
{
"Sid": "AllowAccessToKMSCMKFOrArtifactsS3Buket",
"Effect": "Allow",
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource": "${var.artifacts_s3_bucket_kms_cmk_arn}"
}
]
}
POLICY
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment