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 @@ -187,6 +187,48 @@ module "iam_role_saml" {
187
187
tags = local. tags
188
188
}
189
189
190
+ # ###############################################################################
191
+ # IAM Role - Inline Policy
192
+ # ###############################################################################
193
+
194
+ module "iam_role_inline_policy" {
195
+ source = " ../../modules/iam-role"
196
+
197
+ name = " ${ local . name } -inline-policy"
198
+
199
+ create = true
200
+ create_inline_policy = true
201
+
202
+ trust_policy_permissions = {
203
+ ec2 = {
204
+ effect = " Allow"
205
+ actions = [
206
+ " sts:AssumeRole"
207
+ ]
208
+ principals = [{
209
+ type = " Service"
210
+ identifiers = [" ec2.amazonaws.com" ]
211
+ }]
212
+ }
213
+ }
214
+
215
+ inline_policy_permissions = {
216
+ S3ReadAccess = {
217
+ effect = " Allow"
218
+ actions = [
219
+ " s3:GetObject" ,
220
+ " s3:ListBucket"
221
+ ]
222
+ resources = [
223
+ " arn:aws:s3:::example-bucket" ,
224
+ " arn:aws:s3:::example-bucket/*"
225
+ ]
226
+ }
227
+ }
228
+
229
+ tags = local. tags
230
+ }
231
+
190
232
# ###############################################################################
191
233
# Supporting resources
192
234
# ###############################################################################
You can’t perform that action at this time.
0 commit comments