{"id":22347753,"url":"https://github.com/wearetechnative/terraform-aws-iam-role","last_synced_at":"2026-01-06T16:19:11.735Z","repository":{"id":258505175,"uuid":"706790225","full_name":"wearetechnative/terraform-aws-iam-role","owner":"wearetechnative","description":"This module implements a module to create roles and easily define trust relationships.","archived":false,"fork":false,"pushed_at":"2025-01-14T10:28:06.000Z","size":159,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-31T12:12:35.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wearetechnative.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-18T16:09:43.000Z","updated_at":"2025-01-14T10:28:10.000Z","dependencies_parsed_at":"2024-10-19T10:13:18.612Z","dependency_job_id":"5fb2f83a-f2c2-414a-9ee1-a32bc7516bf9","html_url":"https://github.com/wearetechnative/terraform-aws-iam-role","commit_stats":null,"previous_names":["wearetechnative/terraform-aws-iam-role"],"tags_count":1,"template":false,"template_full_name":"TechNative-B-V/terraform-aws-module-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-iam-role","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-iam-role/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-iam-role/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-iam-role/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wearetechnative","download_url":"https://codeload.github.com/wearetechnative/terraform-aws-iam-role/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245641317,"owners_count":20648637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T10:10:45.729Z","updated_at":"2026-01-06T16:19:11.700Z","avatar_url":"https://github.com/wearetechnative.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform AWS [iam-role]\n\nThis module implements a module to create roles and easily define trust relationships.\n\n[![](we-are-technative.png)](https://www.technative.nl)\n\n## How does it work\n\n### First use after you clone this repository or when .pre-commit-config.yaml is updated\n\nRun `pre-commit install` to install any guardrails implemented using pre-commit.\n\nSee [pre-commit installation](https://pre-commit.com/#install) on how to install pre-commit.\n\n## Usage\n\nA mostly complete example is demonstrated below.\n\n\n```hcl\nmodule \"dreamlines_website_cicd_build_role\" {\n  source = \"git@github.com:TechNative-B-V/terraform-aws-module-iam-role?ref=HEAD\" # change to commit or version later\n\n  role_name = \"website_stack_role\"\n  role_path = \"/website_stack/ci_cd/\"\n\n  aws_managed_policies      = [ \"AdministratorAccess\" ]\n  customer_managed_policies = {\n    \"website_codebuild_cloudwatch\": jsondecode(data.aws_iam_policy_document.website_codebuild_cloudwatch.json)\n  }\n\n  trust_relationship = {\n    \"codebuild\" : { \"identifier\" : \"codebuild.amazonaws.com\", \"identifier_type\" : \"Service\", \"enforce_mfa\" : false, \"enforce_userprincipal\" : false, \"external_id\" : null, \"prevent_account_confuseddeputy\" : false }\n  }\n}\n\ndata \"aws_iam_policy_document\" \"website_codebuild_cloudwatch\" {\n  statement {\n    actions = [\"logs:CreateLogStream\", \"logs:PutLogEvents\"]\n\n    resources = [ \"arn:${data.aws_partition.current.id}:logs:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:log-group:/aws/codebuild/website_stack_website_*\" ]\n  }\n}\n```\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | \u003e=4.3.0 |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_policy_helper\"\u003e\u003c/a\u003e [policy\\_helper](#module\\_policy\\_helper) | git@github.com:wearetechnative/terraform-aws-iam-helper | b5e28f28c11fd0f5733f0a0c8ad212bed4b99ff6 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_iam_role.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |\n| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |\n| [aws_iam_policy_document.trust_relationship](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_iam_policy_document.useraccount_trust](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_aws_managed_policies\"\u003e\u003c/a\u003e [aws\\_managed\\_policies](#input\\_aws\\_managed\\_policies) | Optional list of AWS managed policies. We assume that these policies already exist. | `list(string)` | `[]` | no |\n| \u003ca name=\"input_customer_managed_policies\"\u003e\u003c/a\u003e [customer\\_managed\\_policies](#input\\_customer\\_managed\\_policies) | Optional map of customer managed policy names. Key is policyname and value is policy object in HCL. | `any` | `{}` | no |\n| \u003ca name=\"input_role_name\"\u003e\u003c/a\u003e [role\\_name](#input\\_role\\_name) | Role name for new role. Required value. | `string` | n/a | yes |\n| \u003ca name=\"input_role_path\"\u003e\u003c/a\u003e [role\\_path](#input\\_role\\_path) | Path for new role. Defaults to \"/\". | `string` | `\"/\"` | no |\n| \u003ca name=\"input_trust_relationship\"\u003e\u003c/a\u003e [trust\\_relationship](#input\\_trust\\_relationship) | Defines trust relationships on this role.\u003cbr\u003eAbout prevent\\_account\\_confuseddeputy see https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html .\u003cbr\u003eTODO: It would be best to remove this parameter and have a list of affected principals within our terraform-aws-module-iam-policy-helper with an override to disable if necessary. | \u003cpre\u003emap(object({\u003cbr\u003e    identifier                     = string\u003cbr\u003e    identifier_type                = string # either AWS or Service\u003cbr\u003e    enforce_mfa                    = bool\u003cbr\u003e    enforce_userprincipal          = bool\u003cbr\u003e    external_id                    = string\u003cbr\u003e    prevent_account_confuseddeputy = bool\u003cbr\u003e  }))\u003c/pre\u003e | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_role_arn\"\u003e\u003c/a\u003e [role\\_arn](#output\\_role\\_arn) | n/a |\n| \u003ca name=\"output_role_name\"\u003e\u003c/a\u003e [role\\_name](#output\\_role\\_name) | n/a |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearetechnative%2Fterraform-aws-iam-role","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwearetechnative%2Fterraform-aws-iam-role","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearetechnative%2Fterraform-aws-iam-role/lists"}