Skip to content

Commit be8cdb6

Browse files
author
mike dupont
committed
adding call ssm to the perms
1 parent 6a750d7 commit be8cdb6

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

examples/complete/main.tf

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ module "aws_oidc_github" {
2828
iam_role_policy_arns = [
2929
aws_iam_policy.terraform_pike.arn,
3030
aws_iam_policy.terraform_pike2.arn,
31-
aws_iam_policy.terraform_pike3.arn
31+
aws_iam_policy.terraform_pike3.arn,
32+
aws_iam_policy.github_ssm_policy.arn
3233
]
3334
}
3435

@@ -546,3 +547,41 @@ resource "aws_iam_policy" "terraform_pike2" {
546547
]
547548
})
548549
}
550+
551+
552+
# new swarms deploy permission
553+
resource "aws_iam_policy" "github_ssm_policy" {
554+
name = "GitHubSSMPolicy"
555+
description = "Policy to allow SSM commands for GitHub role"
556+
557+
policy = jsonencode({
558+
Version = "2012-10-17",
559+
Statement = [
560+
{
561+
Effect = "Allow",
562+
Action = [
563+
"ssm:SendCommand",
564+
"ssm:ListCommands",
565+
"ssm:GetCommandInvocation"
566+
],
567+
Resource = "*"
568+
},
569+
{
570+
Effect = "Allow",
571+
Action = [
572+
"ec2:DescribeInstances"
573+
],
574+
Resource = "*"
575+
}
576+
]
577+
})
578+
}
579+
580+
# resource "aws_iam_role_policy_attachment" "attach_github_ssm_policy" {
581+
# policy_arn = aws_iam_policy.github_ssm_policy.arn
582+
# role = "github" # Ensure this matches your IAM role
583+
# }
584+
585+
# output "policy_arn" {
586+
# value = aws_iam_policy.github_ssm_policy.arn
587+
# }

0 commit comments

Comments
 (0)