Git Product home page Git Product logo

terraform-modules's Introduction

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

terraform-modules

Terraform modules to deploy and manage cloud resourcesusing the latest well architected frameworks
Explore the docs »

Zachary Hill · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

These terraform modules were originally created as part of a six month adoption of 'Infrastructure as Code' at Zachary Hill. They serve as the basis to an iterative approach to managing infrastructure. They've grown and expanded to be the workhorse of our organization that we wish to share and collaborate with the world. We are ever evolving and this code will continues to evolve as features, needs, and best practices do.

(back to top)

Built With

  • Terraform

(back to top)

Getting Started

To get a local copy up and running, simply clone this repo.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • MacOS
    brew install terraform
  • Debian/Ubuntu
    apt install terraform
  • Windows
    choco install -y terraform

Installation

  1. Clone the repo
    git clone https://github.com/zachreborn/terraform-modules.git

(back to top)

Usage

Navigate to the folder for the provider and subsequent module, service, or infrastructure you're looking to utilize. Within each module a README.md has documented the usage instructions and examples for that module. Included in each README.md is also an output of automated terraform-docs which has requirements, inputs, and outputs.

Examples:

For more examples, please refer to the Documentation

(back to top)

Roadmap

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thank you!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Zachary Hill - LinkedIn - [email protected]

Project Link: https://github.com/zachreborn/terraform-modules

(back to top)

Acknowledgments

(back to top)

terraform-modules's People

Contributors

github-actions[bot] avatar jakeasarus avatar tgallagher91 avatar thejalpa avatar zachreborn avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

cloudninjadev

terraform-modules's Issues

Github Actions upgrades for Node.js 20

Describe the feature

Update all github actions to the latest release train for Node.js 20

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: hashicorp/setup-terraform@v2, actions/checkout@v3.

tfe_workspace execution_mode deprecated

Describe the bug

execution_mode is deprecated for terraform workspaces in tfe_workspace

Warning: Argument is deprecated
with module.octo_prod_infrastructure.tfe_workspace.this
on .terraform/modules/octo_prod_infrastructure/modules/terraform/workspace/main.tf line 21, in resource "tfe_workspace" "this":
  execution_mode                = var.execution_mode
Use resource tfe_workspace_settings to modify the workspace execution settings. This attribute will be removed in a future release of the provider.

To Reproduce

v2.14.2

module "octo_prod_infrastructure" {
  source                = "github.com/zachreborn/terraform-modules//modules/terraform/workspace?ref=v2.14.2"
  assessments_enabled   = false
  enable_dynamic_auth   = true
  dynamic_auth_role_arn = "arn:aws:iam::1111111111:role/terraform_cloud"
  identifier            = "zachreborn/octo_prod_infrastructure"
  name                  = "octo_prod_infrastructure"
  oauth_token_id        = var.octo_github_oauth_token_id
  organization          = var.octo_organization
  permission_map        = var.octo_admin_only_workspace_permissions_mapping
  terraform_version     = var.terraform_version
}

IAM Role - for_each policy issue

Describe the bug

When using IAM Role module and passing in roles which are being created, the plan fails due to for_each unknown condition.

var.policy_arns is set of string with 1 element
The "for_each" set includes values derived from resource attributes that cannot be determined until apply, and so Terraform cannot determine the full set of keys that will identify the instances of this resource.

When working with unknown values in for_each, it's better to use a map value where the keys are defined statically in your configuration and where only the values contain apply-time results.

Alternatively, you could use the -target planning option to first apply only the resources that the for_each value depends on, and then apply a second time to fully converge.

Transfer family race condition

Describe the bug

The SSH key and the aws_transfer_user enter a race condition. Need to set dependency on theaws_transfer_user

Error: importing ssh public key: ResourceNotFoundException: Unknown user { RespMetadata: { StatusCode: 400, RequestID: "1094818e-bfec-4a40-830a-ac1dbb8221f6" }, Message_: "Unknown user", Resource: "username", ResourceType: "User" }
with module.vendor_sftp.aws_transfer_ssh_key.this["username"]
on .terraform/modules/vendor_sftp/modules/aws/transfer_family/main.tf line 175, in resource "aws_transfer_ssh_key" "this":
resource "aws_transfer_ssh_key" "this" {

Fix code scanning alert - S3 Access block should restrict public bucket to limit access

Guardduty auto_enable is deprecated

Describe the bug

For guardduty usage with organizations, auto_enable is deprecated in favor of auto_enable_organization_members

Warning: Argument is deprecated
with module.guardduty.aws_guardduty_organization_configuration.this
on .terraform/modules/guardduty/modules/aws/guardduty/organization/main.tf line 34, in resource "aws_guardduty_organization_configuration" "this":
  auto_enable = var.auto_enable
Use auto_enable_organization_members instead

To Reproduce

Steps to reproduce the behavior:
Version = v2.11.0

module "guardduty" {
  source = "github.com/zachreborn/terraform-modules//modules/aws/guardduty/organization?ref=v2.11.0"
  providers = {
    aws.organization_management_account = aws.organization_management_account
    aws.organization_security_account   = aws.organization_security_account
  }
  admin_account_id = module.octo_security.id
}

Expected behavior

No errors during planning

Problems

Deprecate auto_enable and transition to auto_enable_organization_members

Solution

Confirmation

IAM Policy Attachment - Lookups for built-in policies

Describe the feature

Add the ability to lookup a built-in policy based on the name of the policy and automatically fetch the ARN to add to the IAM user or group.

Examples

module "example_user_policy" {
  source = "github.com/zachreborn/terraform-modules//modules/aws/iam/user_policy_attachment"

  policy_name = "AWSApplicationDiscoveryAgentAccess"
  user       = module.migration_evaluator_collector.user_name
}

Route53 - Record length split

Describe the feature

Currently, you must manually split the record length for records >255 characters long. This comes into play with SPF records and DKIM records in particular. Allowing a way to input any length of record and split it appropriately within the module configuration would simplify longer records.

AWS Guardduty Organization - auto_enable depreciated

Describe the bug

Warning: Argument is deprecated
with module.guardduty.aws_guardduty_organization_configuration.this
on .terraform/modules/guardduty/modules/aws/guardduty/organization/main.tf line 34, in resource "aws_guardduty_organization_configuration" "this":
auto_enable = var.auto_enable
Use auto_enable_organization_members instead

To Reproduce

v2.11.0 of terraform-modules

Expected behavior

No depreciated error

Problems

Warning: Argument is deprecated
with module.guardduty.aws_guardduty_organization_configuration.this
on .terraform/modules/guardduty/modules/aws/guardduty/organization/main.tf line 34, in resource "aws_guardduty_organization_configuration" "this":
auto_enable = var.auto_enable
Use auto_enable_organization_members instead

Solution

Move to auto_enable_organization_members argument

Confirmation

Run terraform plan and receive no message

Next Steps

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.