Skip to content

Instantly share code, notes, and snippets.

@tonyprawiro
Created June 16, 2017 02:34
Show Gist options
  • Save tonyprawiro/e3fa3c5beb507766fd375388190da36a to your computer and use it in GitHub Desktop.
Save tonyprawiro/e3fa3c5beb507766fd375388190da36a to your computer and use it in GitHub Desktop.
IAM policy to provide SSM permission
resource "aws_iam_role_policy" "policy_allow_all_ssm" {
name = "IAM_POLICY_ALLOW_ALL_SSM"
role = "${aws_iam_role.iam_role_adwriter.id}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAccessToSSM",
"Effect": "Allow",
"Action": [
"ssm:DescribeAssociation",
"ssm:ListAssociations",
"ssm:GetDocument",
"ssm:ListInstanceAssociations",
"ssm:UpdateAssociationStatus",
"ssm:UpdateInstanceInformation",
"ec2messages:AcknowledgeMessage",
"ec2messages:DeleteMessage",
"ec2messages:FailMessage",
"ec2messages:GetEndpoint",
"ec2messages:GetMessages",
"ec2messages:SendReply",
"ds:CreateComputer",
"ds:DescribeDirectories",
"ec2:DescribeInstanceStatus"
],
"Resource": [
"*"
]
}
]
}
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment