File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,48 @@ module "iam_role_saml" {
179
179
tags = local. tags
180
180
}
181
181
182
+ # ###############################################################################
183
+ # IAM Role - Inline Policy
184
+ # ###############################################################################
185
+
186
+ module "iam_role_inline_policy" {
187
+ source = " ../../modules/iam-role"
188
+
189
+ name = " ${ local . name } -inline-policy"
190
+
191
+ create = true
192
+ create_inline_policy = true
193
+
194
+ trust_policy_permissions = {
195
+ ec2 = {
196
+ effect = " Allow"
197
+ actions = [
198
+ " sts:AssumeRole"
199
+ ]
200
+ principals = [{
201
+ type = " Service"
202
+ identifiers = [" ec2.amazonaws.com" ]
203
+ }]
204
+ }
205
+ }
206
+
207
+ inline_policy_permissions = {
208
+ S3ReadAccess = {
209
+ effect = " Allow"
210
+ actions = [
211
+ " s3:GetObject" ,
212
+ " s3:ListBucket"
213
+ ]
214
+ resources = [
215
+ " arn:aws:s3:::example-bucket" ,
216
+ " arn:aws:s3:::example-bucket/*"
217
+ ]
218
+ }
219
+ }
220
+
221
+ tags = local. tags
222
+ }
223
+
182
224
# ###############################################################################
183
225
# Supporting resources
184
226
# ###############################################################################
You can’t perform that action at this time.
0 commit comments