iam-role

cloudposse/iam-role/aws

Terraform Module HCL AWS

A Terraform module that creates IAM role with provided JSON IAM polices documents.

Install
module "iam-role" {
source = "cloudposse/iam-role/aws"
version = "0.23.0"
}
plain text: /constructs/tfmod-cloudposse-iam-role-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

A Terraform module that creates IAM role with provided JSON IAM polices documents. Warning If var.enabled set false the module can be used as IAM Policy Document Aggregator because output.policy always aggregates var.policy_documents List size var.policy_documents limited to 10 > [!TIP] > #### 👽 Use Atmos with Terraform > Cloud Posse uses atmos to easily orchestrate multiple environments using Terraform. > Works with Github Actions, Atlantis, or Spacelift. > > > Watch demo of using Atmos with Terraform > > Example of running atmos to manage infrastructure from our Quick Start tutorial. > Usage This example creates a role with the name eg-prod-app with permission to grant read-write access to S3 bucket, and gives permission to the entities specified in principals_arns to assume the role. ``

Inputs (34)
NameTypeDescriptionDefault
role_descriptionstringThe description of the IAM role that is visible in the IAM role manager required
policy_descriptionstringThe description of the IAM policy that is visible in the IAM policy manager""
pathstringPath to the role and policy. See [IAM Identifiers](https://docs.aws.amazon.com/I"/"
contextanySingle object for setting entire context at once. See description of individual { "additional_tag_map": {}, "attribu
id_length_limitnumberLimit `id` to this many characters (minimum 6). Set to `0` for unlimited length.null
assume_role_policystringA JSON assume role policy document. If set, this will be used as the assume rolenull
stagestringID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'bunull
namestringID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. Thinull
managed_policy_arnsset(string)List of managed policies to attach to created role[]
inline_policy_enabledboolWhether or not to enable an inline policy instead of a reusable managed policyfalse
attributeslist(string)ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, []
policy_document_countnumberNumber of policy documents (length of policy_documents list)1
policy_namestringThe name of the IAM policy that is visible in the IAM policy managernull
additional_tag_mapmap(string)Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not add{}
descriptor_formatsanyDescribe additional descriptors to be output in the `descriptors` output map. Ma{}
use_fullnameboolIf set to 'true' then the full ID for the IAM role name (e.g. `[var.namespace]-[true
assume_role_actionslist(string)The IAM action to be granted by the AssumeRole policy[ "sts:AssumeRole", "sts:TagSession"
environmentstringID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'stnull
delimiterstringDelimiter to be used between ID elements. Defaults to `-` (hyphen). Set to `""` null
tagsmap(string)Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`). Neither the tag keys nor the t{}
label_value_casestringControls the letter case of ID elements (labels) as included in `id`, set as tagnull
Outputs (5)
name — The name of the IAM role created
id — The stable and unique string identifying the role
arn — The Amazon Resource Name (ARN) specifying the role
policy — Role policy document in json format. Outputs always, independent of `enabled` variable
instance_profile — Name of the ec2 profile (if enabled)
Resources (5)
aws_iam_instance_profileaws_iam_policyaws_iam_roleaws_iam_role_policyaws_iam_role_policy_attachment
Details
FrameworkTerraform Module
LanguageHCL
Version0.23.0
Cloud AWS
★ Stars125
Forks83
Total downloads16.4M
Inputs34
Outputs5
Resources5
Examples1
LicenseApache-2.0
Namespacecloudposse
Updated