Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hadenlabs/terraform-aws-iam-role

A Terraform module to create an Identity and Access Management (IAM) Role on Amazon Web Services (AWS).
https://github.com/hadenlabs/terraform-aws-iam-role

amazon-web-services aws hadenlabs iac iam peru role terraform terraform-modules

Last synced: 1 day ago
JSON representation

A Terraform module to create an Identity and Access Management (IAM) Role on Amazon Web Services (AWS).

Awesome Lists containing this project

README

        

[![Latest Release](https://img.shields.io/github/release/hadenlabs/terraform-aws-iam-role)](https://github.com/hadenlabs/terraform-aws-iam-role/releases) [![Lint](https://img.shields.io/github/workflow/status/hadenlabs/terraform-aws-iam-role/lint-code)](https://github.com/hadenlabs/terraform-aws-iam-role/actions?workflow=lint-code) [![CI](https://img.shields.io/github/workflow/status/hadenlabs/terraform-aws-iam-role/ci)](https://github.com/hadenlabs/terraform-aws-iam-role/actions?workflow=ci) [![Test](https://img.shields.io/github/workflow/status/hadenlabs/terraform-aws-iam-role/test)](https://github.com/hadenlabs/terraform-aws-iam-role/actions?workflow=test) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow)](https://conventionalcommits.org) [![KeepAChangelog](https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.0.0-orange)](https://keepachangelog.com) [![Terraform Version](https://img.shields.io/badge/terraform-1.x%20|%200.15%20|%200.14%20|%200.13%20|%200.12.20+-623CE4.svg?logo=terraform)](https://github.com/hashicorp/terraform/releases) [![AWS Provider Version](https://img.shields.io/badge/AWS-3%20and%202.0+-F8991D.svg?logo=terraform)](https://github.com/terraform-providers/terraform-provider-aws/releases)

# terraform-aws-iam-role

terraform-aws-iam-role for project

## Requirements

This is a list of plugins that need to be installed previously to enjoy all the goodies of this configuration:

- [gomplate](https://github.com/hairyhenderson/gomplate)
- [terraform](https://github.com/hashicorp/terraform)
- [python](https://www.python.org)
- [taskfile](https://github.com/go-task/task)

## Usage

# How to use this project

```hcl
module "main" {
source = "hadenlabs/terraform-aws-iam-role/aws"
version = "0.1.0"
}
```

Full working examples can be found in [examples](./examples) folder.

## Examples

### common

```hcl
module "main" {
source = "hadenlabs/terraform-aws-iam-role/aws"
version = "0.1.0"
}
```

## Requirements

| Name | Version |
| --------- | ----------------- |
| terraform | >= 0.12.20, < 2.0 |
| aws | >= 2.51, < 4.0 |
| null | >=0.1.0 |

## Providers

| Name | Version |
| ---- | -------------- |
| aws | >= 2.51, < 4.0 |

## Modules

| Name | Source | Version |
| ---- | ------------------- | ------- |
| tags | hadenlabs/tags/null | >=0.2 |

## Resources

| Name | Type |
| --- | --- |
| [aws_iam_instance_profile.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_instance_profile) | resource |
| [aws_iam_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_role.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.assume_role_aggregated](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |

## Inputs

| Name | Description | Type | Default | Required |
| --- | --- | --- | --- | :-: |
| assume_role_actions | The IAM action to be granted by the AssumeRole policy | `list(string)` |

[
"sts:AssumeRole",
"sts:TagSession"
]
| no |
| enabled | Set to false to prevent the module from creating any resources | `bool` | `true` | no |
| instance_profile_enabled | Create EC2 Instance Profile for the role | `bool` | `false` | no |
| max_session_duration | The maximum session duration (in seconds) for the role. Can have a value from 1 hour to 12 hours | `number` | `3600` | no |
| name | Bucket name. If provided, the bucket will be created with this name instead of generating the name from the context | `string` | n/a | yes |
| namespace | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
| permissions_boundary | ARN of the policy that is used to set the permissions boundary for the role | `string` | `""` | no |
| policy_description | The description of the IAM policy that is visible in the IAM policy manager | `string` | `""` | no |
| policy_documents | List of JSON IAM policy documents | `list(string)` | `[]` | no |
| principals | Map of service name as key and a list of ARNs to allow assuming the role as value (e.g. map(`AWS`, list(`arn:aws:iam:::role/admin`))) | `map(list(string))` | n/a | yes |
| role_description | The description of the IAM role that is visible in the IAM role manager | `string` | n/a | yes |
| stage | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no |
| use_fullname | If set to 'true' then the full ID for the IAM role name (e.g. `[var.namespace]-[var.stage]-[var.name]`) will be used. | `bool` | `false` | no |

## Outputs

| Name | Description |
| ---------------- | -------------------------------------------------------------------------------------- |
| arn | The Amazon Resource Name (ARN) specifying the role |
| enabled | Enabled property of module |
| id | The stable and unique string identifying the role |
| instance_profile | Name of the ec2 profile (if enabled) |
| name | The name of the IAM role created |
| policy | Role policy document in json format. Outputs always, independent of `enabled` variable |
| use_fullname | return if enabled use fullname |

## Help

**Got a question?**

File a GitHub [issue](https://github.com/hadenlabs/terraform-aws-iam-role/issues).

## Contributing

See [Contributing](./docs/contributing.md).

## Module Versioning

This Module follows the principles of [Semantic Versioning (SemVer)](https://semver.org/).

Using the given version number of `MAJOR.MINOR.PATCH`, we apply the following constructs:

1. Use the `MAJOR` version for incompatible changes.
1. Use the `MINOR` version when adding functionality in a backwards compatible manner.
1. Use the `PATCH` version when introducing backwards compatible bug fixes.

### Backwards compatibility in `0.0.z` and `0.y.z` version

- In the context of initial development, backwards compatibility in versions `0.0.z` is **not guaranteed** when `z` is increased. (Initial development)
- In the context of pre-release, backwards compatibility in versions `0.y.z` is **not guaranteed** when `y` is increased. (Pre-release)

## Copyright

Copyright © 2018-2022 [Hadenlabs](https://hadenlabs.com)

## Trademarks

All other trademarks referenced herein are the property of their respective owners.

## License

The code and styles are licensed under the LGPL-3.0 license [See project license.](LICENSE).

## Don't forget to 🌟 Star 🌟 the repo if you like terraform-aws-iam-role

[Your feedback is appreciated](https://github.com/hadenlabs/terraform-aws-iam-role/issues)