Skip to content

Commit 38f12f0

Browse files
authored
server - update aws machine prov policy for explicit subnets (#9495)
1 parent fb488d9 commit 38f12f0

File tree

1 file changed

+29
-9
lines changed
  • docs/server-admin/modules/ROOT/partials/installation

1 file changed

+29
-9
lines changed

docs/server-admin/modules/ROOT/partials/installation/phase-3.adoc

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,18 @@ aws iam create-policy --policy-name circleci-vm --policy-document file://<POLICY
726726
"arn:aws:ec2:*:*:launch-template/*",
727727
"arn:aws:ec2:*:*:network-interface/*",
728728
"arn:aws:ec2:*:*:placement-group/*",
729-
"arn:aws:ec2:*:*:subnet/*",
730729
"arn:aws:ec2:*:*:security-group/<SECURITY_GROUP_ID>",
731730
"arn:aws:ec2:*:*:volume/*"
732731
]
733732
},
733+
{
734+
"Action": "ec2:RunInstances",
735+
"Effect": "Allow",
736+
"Resource": [
737+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_1>",
738+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_2>"
739+
]
740+
},
734741
{
735742
"Action": "ec2:RunInstances",
736743
"Effect": "Allow",
@@ -756,7 +763,7 @@ aws iam create-policy --policy-name circleci-vm --policy-document file://<POLICY
756763
"Resource": "arn:aws:ec2:*:*:*/*",
757764
"Condition": {
758765
"StringEquals": {
759-
"ec2:CreateAction" : "RunInstances"
766+
"ec2:CreateAction": "RunInstances"
760767
}
761768
}
762769
},
@@ -783,10 +790,13 @@ aws iam create-policy --policy-name circleci-vm --policy-document file://<POLICY
783790
"ec2:TerminateInstances"
784791
],
785792
"Effect": "Allow",
786-
"Resource": "arn:aws:ec2:*:*:subnet/*",
793+
"Resource": "arn:aws:ec2:*:*:instance/*",
787794
"Condition": {
788-
"StringEquals": {
789-
"ec2:Vpc": "<VPC_ID>"
795+
"StringLike": {
796+
"ec2:Subnet": [
797+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_1>",
798+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_2>"
799+
]
790800
}
791801
}
792802
}
@@ -858,11 +868,18 @@ Create a `policy.json` file with the following content. You should fill in the I
858868
"arn:aws:ec2:*:*:launch-template/*",
859869
"arn:aws:ec2:*:*:network-interface/*",
860870
"arn:aws:ec2:*:*:placement-group/*",
861-
"arn:aws:ec2:*:*:subnet/*",
862871
"arn:aws:ec2:*:*:security-group/<SECURITY_GROUP_ID>"
863872
"arn:aws:ec2:*:*:volume/*"
864873
]
865874
},
875+
{
876+
"Action": "ec2:RunInstances",
877+
"Effect": "Allow",
878+
"Resource": [
879+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_1>",
880+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_2>"
881+
]
882+
},
866883
{
867884
"Action": "ec2:RunInstances",
868885
"Effect": "Allow",
@@ -915,10 +932,13 @@ Create a `policy.json` file with the following content. You should fill in the I
915932
"ec2:TerminateInstances"
916933
],
917934
"Effect": "Allow",
918-
"Resource": "arn:aws:ec2:*:*:subnet/*",
935+
"Resource": "arn:aws:ec2:*:*:instance/*",
919936
"Condition": {
920-
"StringEquals": {
921-
"ec2:Vpc": "<VPC_ID>"
937+
"StringLike": {
938+
"ec2:Subnet": [
939+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_1>",
940+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_2>"
941+
]
922942
}
923943
}
924944
}

0 commit comments

Comments
 (0)