Example of aws iam role for ecs task.
module "iam_task_role" {
source = "github.com/bryan-rhm/terraform-aws-iam-role?ref=v1.0.0"
name = "task-ecs-role"
statement_id = "TaskExecution"
trusted_identifier = {
type = "Service"
identifiers = ["ecs-tasks.amazonaws.com"]
}
managed_policy_arns = [module.iam_task_policy.output.arn]
}
Name | Version |
---|---|
terraform | >= 1.0.3 |
aws | >= 3.43.0 |
Name | Version |
---|---|
aws | >= 3.43.0 |
No modules.
Name | Type |
---|---|
aws_iam_role.role | resource |
aws_iam_policy_document.aws_trust_policy | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
conditions | Assume Role Conditions | list(object({ |
[] |
no |
description | Description for the IAM role | string |
"Created by terraform" |
no |
managed_policy_arns | List of ARNs of IAM policies to attach | list(string) |
null |
no |
name | Name for the role | string |
n/a | yes |
statement_id | Identifier for a policy statement (Statement ID). | string |
null |
no |
trusted_identifier | Entity allowed to assume the role | object({ |
AWS service ec2.amazonaws.com }) |
n/a |
Name | Description |
---|---|
output | IAM role attributes |