UPD: added examples for iam-role module
This commit is contained in:
parent
0d9b7d704b
commit
b35e7def2a
@ -0,0 +1,34 @@
|
||||
module "role1" {
|
||||
source = ".../iam-role"
|
||||
role-name = "${local.resource_prefix}-${var.application}-role1"
|
||||
description = "IAM role for ${var.application}"
|
||||
trusted-entity = "ec2.amazonaws.com"
|
||||
create-instance-profile = true
|
||||
|
||||
managed-policy-arns = [
|
||||
"arn:aws:iam::aws:policy/ReadOnlyAccess"
|
||||
]
|
||||
}
|
||||
|
||||
module "role2" {
|
||||
source = ".../iam-role"
|
||||
role-name = "${local.resource_prefix}-${var.application}-role2"
|
||||
description = "IAM role for ${var.application}"
|
||||
trusted-entity = null
|
||||
assume-role-policy = jsonencode(
|
||||
{
|
||||
"Version" : "2012-10-17",
|
||||
"Statement" : [
|
||||
{
|
||||
"Effect" : "Allow",
|
||||
"Principal" : {
|
||||
"Service" : [
|
||||
"ssm.amazonaws.com"
|
||||
]
|
||||
},
|
||||
"Action" : "sts:AssumeRole"
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue
Block a user