Terraform Module for AWS IAM Role Policy
This is a stable example. It should successfully build out of the box
This examples does is built on Construct Libraries marked "Stable" and does not have any infrastructure prerequisites to build.
This module needs Terraform 0.12.19 or newer. You can download the latest Terraform version from here.
Below we are able to check the resources that are being created as part of this module call:
- IAM Role Policy
To use this module, add the following call to your code:
module "iam_role_policy" {
source = "git::https://github.com/nitinda/terraform-module-aws-iam-role-policy.git?ref=terraform-12/master"
providers = {
aws = aws.services
}
## IAM Role Policy
name_prefix = "iam-role-policy-serice"
policy = var.iam_policy_document_json
role = var.iam_role_id
}
The variables required in order for the module to be successfully called from the deployment repository are the following:
Variable | Description | Type | Argument Status | Default Value |
---|---|---|---|---|
name | The name of the role policy. If omitted, Terraform will assign a random, unique name | string | Optional | null |
name_prefix | Creates a unique name beginning with the specified prefix. Conflicts with name | string | Optional | null |
policy | The inline policy document. This is a JSON formatted string | string | Required | |
role | The IAM role to attach to the policy | string | Required |
This module has the following outputs:
- name
- fqdn
In order for the variables to be accessed on module level please use the syntax below:
module.<module_name>.<output_variable_name>
The output variable is able to be accessed through terraform state file using the syntax below:
data.terraform_remote_state.<module_name>.<output_variable_name>
Module maintained by Module maintained by the - Nitin Das