UPD: added examples for iam-role module

This commit is contained in:
xpk 2024-09-27 10:49:20 +08:00
parent 0d9b7d704b
commit b35e7def2a
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86

View File

@ -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"
}
]
}
)
}