Skip to content

Commit 4323632

Browse files
authored
server - update aws machine prov policy for explicit subnets (#9496)
1 parent 63d6250 commit 4323632

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
@@ -699,11 +699,18 @@ aws iam create-policy --policy-name circleci-vm --policy-document file://<POLICY
699699
"arn:aws:ec2:*:*:launch-template/*",
700700
"arn:aws:ec2:*:*:network-interface/*",
701701
"arn:aws:ec2:*:*:placement-group/*",
702-
"arn:aws:ec2:*:*:subnet/*",
703702
"arn:aws:ec2:*:*:security-group/<SECURITY_GROUP_ID>",
704703
"arn:aws:ec2:*:*:volume/*"
705704
]
706705
},
706+
{
707+
"Action": "ec2:RunInstances",
708+
"Effect": "Allow",
709+
"Resource": [
710+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_1>",
711+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_2>"
712+
]
713+
},
707714
{
708715
"Action": "ec2:RunInstances",
709716
"Effect": "Allow",
@@ -729,7 +736,7 @@ aws iam create-policy --policy-name circleci-vm --policy-document file://<POLICY
729736
"Resource": "arn:aws:ec2:*:*:*/*",
730737
"Condition": {
731738
"StringEquals": {
732-
"ec2:CreateAction" : "RunInstances"
739+
"ec2:CreateAction": "RunInstances"
733740
}
734741
}
735742
},
@@ -756,10 +763,13 @@ aws iam create-policy --policy-name circleci-vm --policy-document file://<POLICY
756763
"ec2:TerminateInstances"
757764
],
758765
"Effect": "Allow",
759-
"Resource": "arn:aws:ec2:*:*:subnet/*",
766+
"Resource": "arn:aws:ec2:*:*:instance/*",
760767
"Condition": {
761-
"StringEquals": {
762-
"ec2:Vpc": "<VPC_ID>"
768+
"StringLike": {
769+
"ec2:Subnet": [
770+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_1>",
771+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_2>"
772+
]
763773
}
764774
}
765775
}
@@ -831,11 +841,18 @@ Create a `policy.json` file with the following content. You should fill in the I
831841
"arn:aws:ec2:*:*:launch-template/*",
832842
"arn:aws:ec2:*:*:network-interface/*",
833843
"arn:aws:ec2:*:*:placement-group/*",
834-
"arn:aws:ec2:*:*:subnet/*",
835844
"arn:aws:ec2:*:*:security-group/<SECURITY_GROUP_ID>",
836845
"arn:aws:ec2:*:*:volume/*"
837846
]
838847
},
848+
{
849+
"Action": "ec2:RunInstances",
850+
"Effect": "Allow",
851+
"Resource": [
852+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_1>",
853+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_2>"
854+
]
855+
},
839856
{
840857
"Action": "ec2:RunInstances",
841858
"Effect": "Allow",
@@ -888,10 +905,13 @@ Create a `policy.json` file with the following content. You should fill in the I
888905
"ec2:TerminateInstances"
889906
],
890907
"Effect": "Allow",
891-
"Resource": "arn:aws:ec2:*:*:subnet/*",
908+
"Resource": "arn:aws:ec2:*:*:instance/*",
892909
"Condition": {
893-
"StringEquals": {
894-
"ec2:Vpc": "<VPC_ID>"
910+
"StringLike": {
911+
"ec2:Subnet": [
912+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_1>",
913+
"arn:aws:ec2:*:*:subnet/<SUBNET_ID_2>"
914+
]
895915
}
896916
}
897917
}

0 commit comments

Comments
 (0)