Skip to content

Terraform Cloud Dynamic Credentials module as an IAM OIDC identity provider in AWS

License

Notifications You must be signed in to change notification settings

saidsef/terraform-aws-terraform-cloud-oidc

Terraform AWS Terraform OIDC Provider

CI GitHub issues License

This Terraform module enables you to configure Terraform Cloud as an AWS IAM OIDC identity provider in AWS, which enables Terraform Cloud to access resources within an AWS account(s) without requiring long-lived credentials to be stored as Terraform Cloud Variables.

Prerequisites

  • AWS Account(s) and credentials
  • Terraform Cloud Account(s)
  • GitHub repository
  • Terraform >= 1.x
  • Profit?

Deployment / Usage

provider "aws" {
  region = var.region
}

module "terraform_cloud" {
  source  = "saidsef/terraform-cloud-oidc/aws"
  version = ">= 1"

  attach_read_only_policy = true
  organisation     = "saidsef"
  projects         = [{ "project" : "foo", "workspaces" : ["*"], "run_phase" : "*" }]
  tags             = var.tags
}

Provider Specifications and Requirements

Please see TERRAFORM.md

Terraform Cloud Configure trust variables

After you have create a workspace, navigate to the Variables page and add the following variables:

Category Key Value Sensitive Required
Environment variable TFC_AWS_PROVIDER_AUTH true false Yes
Environment variable TFC_AWS_RUN_ROLE_ARN role_arn false Yes
Environment variable TFC_AWS_PLAN_ROLE_ARN role_arn false No
Environment variable TFC_AWS_APPLY_ROLE_ARN role_arn false No
Environment variable TFC_AWS_WORKLOAD_IDENTITY_AUDIENCE aws.workload.identity false No

Source

Our latest and greatest source of terraform-aws-terraform-cloud-oidc can be found on GitHub. Fork us!

Contributing

We would ❤️ you to contribute by making a pull request.

Please read the official Contribution Guide for more information on how you can contribute.

About

Terraform Cloud Dynamic Credentials module as an IAM OIDC identity provider in AWS

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages