github.com/pbs/terraform-aws-iam-role-module?ref=x.y.z
More information can be found on these install methods and more in the documentation here.
This module provisions an IAM role.
It is assumed that this role will be used by an AWS service. As such, the optional aws_services
parameter is frequently used. This parameter populates the trust relationship that allows AWS services to assume the role.
It is recommended that you use the aws_iam_policy_document
data source to generate the JSON string passed into policy_json
. This ensures that changes to your policy are detected and rendered correctly on plans and applies.
The exception to this recommendation is when some complex logic is involved in resolving a dynamic policy. In this case, it can be advantageous to use the jsonencode
function to encode the Terraform dictionary as a json string.
Integrate this module like so:
module "role" {
source = "github.com/pbs/terraform-aws-iam-role-module?ref=x.y.z"
policy_json = data.aws_iam_policy_document.policy_document.json
# Tagging Parameters
organization = var.organization
environment = var.environment
product = var.product
repo = var.repo
# Optional Parameters
aws_services = ["lambda"]
}
If this repo is added as a subtree, then the version of the module should be close to the version shown here:
x.y.z
Note, however that subtrees can be altered as desired within repositories.
Further documentation on usage can be found here.
Below is automatically generated documentation on this Terraform module using terraform-docs