@@ -699,11 +699,18 @@ aws iam create-policy --policy-name circleci-vm --policy-document file://<POLICY
699
699
"arn:aws:ec2:*:*:launch-template/*",
700
700
"arn:aws:ec2:*:*:network-interface/*",
701
701
"arn:aws:ec2:*:*:placement-group/*",
702
- "arn:aws:ec2:*:*:subnet/*",
703
702
"arn:aws:ec2:*:*:security-group/<SECURITY_GROUP_ID>",
704
703
"arn:aws:ec2:*:*:volume/*"
705
704
]
706
705
},
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
+ },
707
714
{
708
715
"Action": "ec2:RunInstances",
709
716
"Effect": "Allow",
@@ -729,7 +736,7 @@ aws iam create-policy --policy-name circleci-vm --policy-document file://<POLICY
729
736
"Resource": "arn:aws:ec2:*:*:*/*",
730
737
"Condition": {
731
738
"StringEquals": {
732
- "ec2:CreateAction" : "RunInstances"
739
+ "ec2:CreateAction": "RunInstances"
733
740
}
734
741
}
735
742
},
@@ -756,10 +763,13 @@ aws iam create-policy --policy-name circleci-vm --policy-document file://<POLICY
756
763
"ec2:TerminateInstances"
757
764
],
758
765
"Effect": "Allow",
759
- "Resource": "arn:aws:ec2:*:*:subnet /*",
766
+ "Resource": "arn:aws:ec2:*:*:instance /*",
760
767
"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
+ ]
763
773
}
764
774
}
765
775
}
@@ -831,11 +841,18 @@ Create a `policy.json` file with the following content. You should fill in the I
831
841
"arn:aws:ec2:*:*:launch-template/*",
832
842
"arn:aws:ec2:*:*:network-interface/*",
833
843
"arn:aws:ec2:*:*:placement-group/*",
834
- "arn:aws:ec2:*:*:subnet/*",
835
844
"arn:aws:ec2:*:*:security-group/<SECURITY_GROUP_ID>",
836
845
"arn:aws:ec2:*:*:volume/*"
837
846
]
838
847
},
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
+ },
839
856
{
840
857
"Action": "ec2:RunInstances",
841
858
"Effect": "Allow",
@@ -888,10 +905,13 @@ Create a `policy.json` file with the following content. You should fill in the I
888
905
"ec2:TerminateInstances"
889
906
],
890
907
"Effect": "Allow",
891
- "Resource": "arn:aws:ec2:*:*:subnet /*",
908
+ "Resource": "arn:aws:ec2:*:*:instance /*",
892
909
"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
+ ]
895
915
}
896
916
}
897
917
}
0 commit comments