|
4 | 4 | {
|
5 | 5 | "Effect": "Allow",
|
6 | 6 | "Action": [
|
7 |
| - "ec2:CreateSnapshot", |
8 |
| - "ec2:AttachVolume", |
9 |
| - "ec2:DetachVolume", |
10 |
| - "ec2:ModifyVolume", |
11 | 7 | "ec2:DescribeAvailabilityZones",
|
12 | 8 | "ec2:DescribeInstances",
|
13 | 9 | "ec2:DescribeSnapshots",
|
14 | 10 | "ec2:DescribeTags",
|
15 | 11 | "ec2:DescribeVolumes",
|
16 |
| - "ec2:DescribeVolumesModifications", |
17 |
| - "ec2:EnableFastSnapshotRestores" |
| 12 | + "ec2:DescribeVolumesModifications" |
18 | 13 | ],
|
19 | 14 | "Resource": "*"
|
20 | 15 | },
|
21 | 16 | {
|
22 | 17 | "Effect": "Allow",
|
23 | 18 | "Action": [
|
24 |
| - "ec2:CreateTags" |
| 19 | + "ec2:CreateSnapshot", |
| 20 | + "ec2:ModifyVolume" |
| 21 | + ], |
| 22 | + "Resource": "arn:aws:ec2:*:*:volume/*" |
| 23 | + }, |
| 24 | + { |
| 25 | + "Effect": "Allow", |
| 26 | + "Action": [ |
| 27 | + "ec2:AttachVolume", |
| 28 | + "ec2:DetachVolume" |
25 | 29 | ],
|
26 | 30 | "Resource": [
|
27 |
| - "arn:*:ec2:*:*:volume/*", |
28 |
| - "arn:*:ec2:*:*:snapshot/*" |
| 31 | + "arn:aws:ec2:*:*:volume/*", |
| 32 | + "arn:aws:ec2:*:*:instance/*" |
29 | 33 | ]
|
30 | 34 | },
|
| 35 | + { |
| 36 | + "Effect": "Allow", |
| 37 | + "Action": [ |
| 38 | + "ec2:CreateVolume", |
| 39 | + "ec2:EnableFastSnapshotRestores" |
| 40 | + ], |
| 41 | + "Resource": "arn:aws:ec2:*:*:snapshot/*" |
| 42 | + }, |
| 43 | + { |
| 44 | + "Effect": "Allow", |
| 45 | + "Action": [ |
| 46 | + "ec2:CreateTags" |
| 47 | + ], |
| 48 | + "Resource": [ |
| 49 | + "arn:aws:ec2:*:*:volume/*", |
| 50 | + "arn:aws:ec2:*:*:snapshot/*" |
| 51 | + ], |
| 52 | + "Condition": { |
| 53 | + "StringEquals": { |
| 54 | + "ec2:CreateAction": [ |
| 55 | + "CreateVolume", |
| 56 | + "CreateSnapshot" |
| 57 | + ] |
| 58 | + } |
| 59 | + } |
| 60 | + }, |
31 | 61 | {
|
32 | 62 | "Effect": "Allow",
|
33 | 63 | "Action": [
|
34 | 64 | "ec2:DeleteTags"
|
35 | 65 | ],
|
36 | 66 | "Resource": [
|
37 |
| - "arn:*:ec2:*:*:volume/*", |
38 |
| - "arn:*:ec2:*:*:snapshot/*" |
| 67 | + "arn:aws:ec2:*:*:volume/*", |
| 68 | + "arn:aws:ec2:*:*:snapshot/*" |
39 | 69 | ]
|
40 | 70 | },
|
41 | 71 | {
|
42 | 72 | "Effect": "Allow",
|
43 | 73 | "Action": [
|
44 | 74 | "ec2:CreateVolume"
|
45 | 75 | ],
|
46 |
| - "Resource": "arn:*:ec2:*:*:volume/*", |
| 76 | + "Resource": "arn:aws:ec2:*:*:volume/*", |
47 | 77 | "Condition": {
|
48 | 78 | "StringLike": {
|
49 | 79 | "aws:RequestTag/ebs.csi.aws.com/cluster": "true"
|
|
55 | 85 | "Action": [
|
56 | 86 | "ec2:CreateVolume"
|
57 | 87 | ],
|
58 |
| - "Resource": "arn:*:ec2:*:*:volume/*", |
| 88 | + "Resource": "arn:aws:ec2:*:*:volume/*", |
59 | 89 | "Condition": {
|
60 | 90 | "StringLike": {
|
61 | 91 | "aws:RequestTag/CSIVolumeName": "*"
|
|
65 | 95 | {
|
66 | 96 | "Effect": "Allow",
|
67 | 97 | "Action": [
|
68 |
| - "ec2:CreateVolume" |
| 98 | + "ec2:DeleteVolume" |
69 | 99 | ],
|
70 |
| - "Resource": "arn:*:ec2:*:*:snapshot/*" |
| 100 | + "Resource": "arn:aws:ec2:*:*:volume/*", |
| 101 | + "Condition": { |
| 102 | + "StringLike": { |
| 103 | + "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" |
| 104 | + } |
| 105 | + } |
71 | 106 | },
|
72 | 107 | {
|
73 | 108 | "Effect": "Allow",
|
74 | 109 | "Action": [
|
75 | 110 | "ec2:DeleteVolume"
|
76 | 111 | ],
|
77 |
| - "Resource": "*", |
| 112 | + "Resource": "arn:aws:ec2:*:*:volume/*", |
78 | 113 | "Condition": {
|
79 | 114 | "StringLike": {
|
80 |
| - "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" |
| 115 | + "ec2:ResourceTag/CSIVolumeName": "*" |
81 | 116 | }
|
82 | 117 | }
|
83 | 118 | },
|
|
86 | 121 | "Action": [
|
87 | 122 | "ec2:DeleteVolume"
|
88 | 123 | ],
|
89 |
| - "Resource": "*", |
| 124 | + "Resource": "arn:aws:ec2:*:*:volume/*", |
90 | 125 | "Condition": {
|
91 | 126 | "StringLike": {
|
92 |
| - "ec2:ResourceTag/CSIVolumeName": "*" |
| 127 | + "ec2:ResourceTag/kubernetes.io/created-for/pvc/name": "*" |
93 | 128 | }
|
94 | 129 | }
|
95 | 130 | },
|
96 | 131 | {
|
97 | 132 | "Effect": "Allow",
|
98 | 133 | "Action": [
|
99 |
| - "ec2:DeleteVolume" |
| 134 | + "ec2:CreateSnapshot" |
100 | 135 | ],
|
101 |
| - "Resource": "*", |
| 136 | + "Resource": "arn:aws:ec2:*:*:snapshot/*", |
102 | 137 | "Condition": {
|
103 | 138 | "StringLike": {
|
104 |
| - "ec2:ResourceTag/kubernetes.io/created-for/pvc/name": "*" |
| 139 | + "aws:RequestTag/CSIVolumeSnapshotName": "*" |
| 140 | + } |
| 141 | + } |
| 142 | + }, |
| 143 | + { |
| 144 | + "Effect": "Allow", |
| 145 | + "Action": [ |
| 146 | + "ec2:CreateSnapshot" |
| 147 | + ], |
| 148 | + "Resource": "arn:aws:ec2:*:*:snapshot/*", |
| 149 | + "Condition": { |
| 150 | + "StringLike": { |
| 151 | + "aws:RequestTag/ebs.csi.aws.com/cluster": "true" |
105 | 152 | }
|
106 | 153 | }
|
107 | 154 | },
|
|
110 | 157 | "Action": [
|
111 | 158 | "ec2:DeleteSnapshot"
|
112 | 159 | ],
|
113 |
| - "Resource": "*", |
| 160 | + "Resource": "arn:aws:ec2:*:*:snapshot/*", |
114 | 161 | "Condition": {
|
115 | 162 | "StringLike": {
|
116 | 163 | "ec2:ResourceTag/CSIVolumeSnapshotName": "*"
|
|
122 | 169 | "Action": [
|
123 | 170 | "ec2:DeleteSnapshot"
|
124 | 171 | ],
|
125 |
| - "Resource": "*", |
| 172 | + "Resource": "arn:aws:ec2:*:*:snapshot/*", |
126 | 173 | "Condition": {
|
127 | 174 | "StringLike": {
|
128 | 175 | "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true"
|
|
0 commit comments