Git Product home page Git Product logo

terraform-aws-iam-policy's Introduction

License Latest Release Build Status Build Status Build Status Build Status Build Status Build Status Build Status Build Status

Terraform aws IAM Policy module

Description

This module creates IAM policies and policy attachment resources.

Advantage of Using this Module

  • Unified Management: Efficiently manage IAM policies and their attachments within a single module.

Examples available here

Usage

NOTE: These examples use the latest version of this module

module "minimum" {
  source      = "boldlink/iam-policy/aws"
  version     = "<provide_latest_version_here>"
  policy_name = "minimum-policy-example"
  description = "IAM policy to grant EC2 describe permissions"
  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [
      {
        Action = [
          "ec2:Describe*",
        ]
        Effect   = "Allow"
        Resource = "*"
      },
    ]
  })
  tags = {
    environment        = "examples"
    "user::CostCenter" = "terraform-registry"
  }
}

Documentation

AWS Documentation

Terraform module documentation

Requirements

Name Version
terraform >= 0.14.11
aws >= 4.15.1

Providers

Name Version
aws 5.21.0

Modules

No modules.

Resources

Name Type
aws_iam_policy.main resource
aws_iam_policy_attachment.main resource

Inputs

Name Description Type Default Required
description (Optional, Forces new resource) Description of the IAM policy. string null no
groups (Optional) - The group(s) the policy should be applied to list(string) [] no
name_prefix (Optional, Forces new resource) Creates a unique name beginning with the specified prefix. Conflicts with name. string null no
path (Optional, default /) Path in which to create the policy. string null no
policy (Required) The policy document. This is a JSON formatted string. string n/a yes
policy_attachment_name (Optional) - The name of the attachment. Required when users, roles or groups are provided. string null no
policy_name (Optional, Forces new resource) The name of the policy. If omitted, Terraform will assign a random, unique name. string null no
roles (Optional) - The role(s) the policy should be applied to list(string) [] no
tags (Optional) Map of resource tags for the IAM Policy. map(string) {} no
users (Optional) - The user(s) the policy should be applied to list(string) [] no

Outputs

Name Description
aws_policy_id The ARN assigned by AWS to this policy.
policy_arn The ARN assigned by AWS to this policy.
policy_attachment_name The name of the attachment.
policy_description The description of the policy.
policy_document The policy document.
policy_id The policy's ID.
policy_name The name of the policy.
policy_path The path of the policy in IAM.
policy_tags_all A map of tags assigned to the resource, including those inherited from the provider default_tags

Third party software

This repository uses third party software:

  • pre-commit - Used to help ensure code and documentation consistency
    • Install with brew install pre-commit
    • Manually use with pre-commit run
  • terraform 0.14.11 For backwards compatibility we are using version 0.14.11 for testing making this the min version tested and without issues with terraform-docs.
  • terraform-docs - Used to generate the Inputs and Outputs sections
    • Install with brew install terraform-docs
    • Manually use via pre-commit
  • tflint - Used to lint the Terraform code
    • Install with brew install tflint
    • Manually use via pre-commit

Makefile

The makefile contained in this repo is optimized for linux paths and the main purpose is to execute testing for now.

  • Create all tests stacks including any supporting resources:
make tests
  • Clean all tests except existing supporting resources:
make clean
  • Clean supporting resources - this is done separately so you can test your module build/modify/destroy independently.
make cleansupporting
  • !!!DANGER!!! Clean the state files from examples and test/supportingResources - use with CAUTION!!!
make cleanstatefiles

BOLDLink-SIG 2023

terraform-aws-iam-policy's People

Contributors

boldlinksig avatar patrickmukumbu avatar ndegwajohn avatar

Stargazers

 avatar

Watchers

Hugo Almeida avatar

Forkers

aaam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.