File tree Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ module "aws_oidc_github" {
28
28
iam_role_policy_arns = [
29
29
aws_iam_policy . terraform_pike . arn ,
30
30
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
32
33
]
33
34
}
34
35
@@ -546,3 +547,41 @@ resource "aws_iam_policy" "terraform_pike2" {
546
547
]
547
548
})
548
549
}
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
+ # }
You can’t perform that action at this time.
0 commit comments