{"id":26959325,"url":"https://github.com/tmknom/terraform-aws-iam-role","last_synced_at":"2025-04-03T04:37:32.536Z","repository":{"id":41162215,"uuid":"154941570","full_name":"tmknom/terraform-aws-iam-role","owner":"tmknom","description":"Terraform module which creates IAM Role and IAM Policy resources on AWS.","archived":false,"fork":false,"pushed_at":"2020-05-03T09:06:04.000Z","size":46,"stargazers_count":11,"open_issues_count":0,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-15T19:38:06.377Z","etag":null,"topics":["aws","iam","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"","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/tmknom.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}},"created_at":"2018-10-27T08:17:05.000Z","updated_at":"2023-08-15T19:38:06.378Z","dependencies_parsed_at":"2022-09-09T04:21:15.366Z","dependency_job_id":null,"html_url":"https://github.com/tmknom/terraform-aws-iam-role","commit_stats":null,"previous_names":[],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-iam-role","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-iam-role/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-iam-role/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-iam-role/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmknom","download_url":"https://codeload.github.com/tmknom/terraform-aws-iam-role/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246939173,"owners_count":20857916,"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":["aws","iam","terraform","terraform-module"],"created_at":"2025-04-03T04:37:30.774Z","updated_at":"2025-04-03T04:37:32.524Z","avatar_url":"https://github.com/tmknom.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-aws-iam-role\n\n[![Terraform Actions Status](https://github.com/tmknom/terraform-aws-iam-role/workflows/Terraform/badge.svg)](https://github.com/tmknom/terraform-aws-iam-role/actions?query=workflow%3ATerraform)\n[![Markdown Actions Status](https://github.com/tmknom/terraform-aws-iam-role/workflows/Markdown/badge.svg)](https://github.com/tmknom/terraform-aws-iam-role/actions?query=workflow%3AMarkdown)\n[![YAML Actions Status](https://github.com/tmknom/terraform-aws-iam-role/workflows/YAML/badge.svg)](https://github.com/tmknom/terraform-aws-iam-role/actions?query=workflow%3AYAML)\n[![JSON Actions Status](https://github.com/tmknom/terraform-aws-iam-role/workflows/JSON/badge.svg)](https://github.com/tmknom/terraform-aws-iam-role/actions?query=workflow%3AJSON)\n[![GitHub tag](https://img.shields.io/github/tag/tmknom/terraform-aws-iam-role.svg)](https://registry.terraform.io/modules/tmknom/iam-role/aws)\n[![License](https://img.shields.io/github/license/tmknom/terraform-aws-iam-role.svg)](https://opensource.org/licenses/Apache-2.0)\n\nTerraform module which creates IAM Role and IAM Policy resources on AWS.\n\n## Description\n\nProvision [IAM Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)\nand its own [Customer Managed Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#customer-managed-policies).\nThis module provides recommended settings.\n\n- Use managed policies instead of inline policies\n\n## Usage\n\n### Minimal\n\n```hcl\nmodule \"iam_role\" {\n  source             = \"git::https://github.com/tmknom/terraform-aws-iam-role.git?ref=tags/2.0.0\"\n  name               = \"minimal\"\n  assume_role_policy = data.aws_iam_policy_document.assume_role_policy.json\n  policy             = data.aws_iam_policy_document.policy.json\n}\n\ndata \"aws_iam_policy_document\" \"assume_role_policy\" {\n  statement {\n    effect = \"Allow\"\n\n    principals {\n      type        = \"Service\"\n      identifiers = [\"ec2.amazonaws.com\"]\n    }\n\n    actions = [\n      \"sts:AssumeRole\",\n    ]\n  }\n}\n\ndata \"aws_iam_policy_document\" \"policy\" {\n  statement {\n    effect = \"Allow\"\n\n    actions = [\n      \"ec2:Describe*\",\n    ]\n\n    resources = [\"*\"]\n  }\n}\n```\n\n### Complete\n\n```hcl\nmodule \"iam_role\" {\n  source             = \"git::https://github.com/tmknom/terraform-aws-iam-role.git?ref=tags/2.0.0\"\n  name               = \"complete\"\n  assume_role_policy = data.aws_iam_policy_document.assume_role_policy.json\n  policy             = data.aws_iam_policy_document.policy.json\n\n  path        = \"/ec2/\"\n  description = \"Describe EC2\"\n\n  max_session_duration  = 7200\n  force_detach_policies = true\n}\n\ndata \"aws_iam_policy_document\" \"assume_role_policy\" {\n  # Omitted below.\n}\n\ndata \"aws_iam_policy_document\" \"policy\" {\n  # Omitted below.\n}\n```\n\n## Examples\n\n- [Minimal](https://github.com/tmknom/terraform-aws-iam-role/tree/master/examples/minimal)\n- [Complete](https://github.com/tmknom/terraform-aws-iam-role/tree/master/examples/complete)\n\n\u003c!-- BEGINNING OF GENERATED BY TERRAFORM-DOCS --\u003e\n\n## Requirements\n\n| Name      | Version |\n| --------- | ------- |\n| terraform | \u003e= 0.12 |\n\n## Providers\n\n| Name | Version |\n| ---- | ------- |\n| aws  | n/a     |\n\n## Inputs\n\n| Name                  | Description                                                                            | Type     | Default                  | Required |\n| --------------------- | -------------------------------------------------------------------------------------- | -------- | ------------------------ | :------: |\n| assume_role_policy    | The policy that grants an entity permission to assume the role.                        | `string` | n/a                      |   yes    |\n| name                  | The name of the role. If omitted, Terraform will assign a random, unique name.         | `string` | n/a                      |   yes    |\n| policy                | The policy document. This is a JSON formatted string.                                  | `string` | n/a                      |   yes    |\n| description           | The description of the role and the policy.                                            | `string` | `\"Managed by Terraform\"` |    no    |\n| force_detach_policies | Specifies to force detaching any policies the role has before destroying it.           | `bool`   | `false`                  |    no    |\n| max_session_duration  | The maximum session duration (in seconds) that you want to set for the specified role. | `string` | `\"3600\"`                 |    no    |\n| path                  | Path in which to create the role and the policy.                                       | `string` | `\"/\"`                    |    no    |\n\n## Outputs\n\n| Name                   | Description                                         |\n| ---------------------- | --------------------------------------------------- |\n| iam_policy_arn         | The ARN assigned by AWS to this policy.             |\n| iam_policy_description | The description of the policy.                      |\n| iam_policy_document    | The policy document.                                |\n| iam_policy_id          | The policy's ID.                                    |\n| iam_policy_name        | The name of the policy.                             |\n| iam_policy_path        | The path of the policy in IAM.                      |\n| iam_role_arn           | The Amazon Resource Name (ARN) specifying the role. |\n| iam_role_create_date   | The creation date of the IAM role.                  |\n| iam_role_description   | The description of the role.                        |\n| iam_role_name          | The name of the role.                               |\n| iam_role_unique_id     | The stable and unique string identifying the role.  |\n\n\u003c!-- END OF GENERATED BY TERRAFORM-DOCS --\u003e\n\n## Development\n\n### Development Requirements\n\n- [Docker](https://www.docker.com/)\n\n### Configure environment variables\n\n```shell\nexport AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE\nexport AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\nexport AWS_DEFAULT_REGION=ap-northeast-1\n```\n\n### Installation\n\n```shell\ngit clone git@github.com:tmknom/terraform-aws-iam-role.git\ncd terraform-aws-iam-role\nmake install\n```\n\n### Makefile targets\n\n```text\napply-complete                 Run terraform apply examples/complete\napply-minimal                  Run terraform apply examples/minimal\nbump-version                   Bump version (Required argument 'VERSION')\ncheck-format                   Check format code\nclean                          Clean .terraform\ndestroy-complete               Run terraform destroy examples/complete\ndestroy-minimal                Run terraform destroy examples/minimal\ndiff                           Word diff\ndocs                           Generate docs\nformat                         Format code\nhelp                           Show help\ninstall                        Install requirements\nlint                           Lint code\nplan-complete                  Run terraform plan examples/complete\nplan-minimal                   Run terraform plan examples/minimal\nrelease                        Release GitHub and Terraform Module Registry\nupgrade                        Upgrade makefile\n```\n\n### Releasing new versions\n\nBump VERSION file, and run `make release`.\n\n### Terraform Module Registry\n\n- \u003chttps://registry.terraform.io/modules/tmknom/iam-role/aws\u003e\n\n## License\n\nApache 2 Licensed. See LICENSE for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmknom%2Fterraform-aws-iam-role","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmknom%2Fterraform-aws-iam-role","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmknom%2Fterraform-aws-iam-role/lists"}