Skip to content

suzuki-shunsuke/terraform-aws-tfaction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-tfaction

Terraform Modules for tfaction (AWS resources)

https://suzuki-shunsuke.github.io/tfaction/docs/config/add-working-directory/#aws-iam-role

Example

module "aws" {
  source = "github.com/suzuki-shunsuke/terraform-aws-tfaction"

  name                               = "AWS"
  repo                               = "suzuki-shunsuke/tfaction-example"
  main_branch                        = "main"
  s3_bucket_tfmigrate_history_name   = "<S3 Bucket Name for tfmigrate hisotry>"
  s3_bucket_terraform_state_name     = "<S3 Bucket Name for terraform state>"
}

# Attach Policies

resource "aws_iam_role_policy_attachment" "terraform_apply_admin" {
  role       = module.aws.aws_iam_role_terraform_apply_name
  policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess"
}

resource "aws_iam_role_policy_attachment" "terraform_plan_readonly" {
  role       = module.aws.aws_iam_role_terraform_plan_name
  policy_arn = "arn:aws:iam::aws:policy/ReadOnlyAccess"
}

resource "aws_iam_role_policy_attachment" "tfmigrate_plan_readonly" {
  role       = module.aws.aws_iam_role_tfmigrate_plan_name
  policy_arn = "arn:aws:iam::aws:policy/ReadOnlyAccess"
}

resource "aws_iam_role_policy_attachment" "tfmigrate_apply_readonly" {
  role       = module.aws.aws_iam_role_tfmigrate_apply_name
  policy_arn = "arn:aws:iam::aws:policy/ReadOnlyAccess"
}

Requirements

Name Version
terraform >= 0.13.1
aws >= 3.63

Providers

Name Version
aws >= 3.63

Modules

No modules.

Resources

Name Type
aws_iam_openid_connect_provider.github resource
aws_iam_policy.put_terraform_state resource
aws_iam_policy.put_tfmigrate_history resource
aws_iam_policy.read_terraform_state resource
aws_iam_policy.read_tfmigrate_history resource
aws_iam_role.terraform_apply resource
aws_iam_role.terraform_plan resource
aws_iam_role.tfmigrate_apply resource
aws_iam_role.tfmigrate_plan resource
aws_iam_role_policy_attachment.terraform_apply_put_terraform_state resource
aws_iam_role_policy_attachment.terraform_apply_read_terraform_state resource
aws_iam_role_policy_attachment.terraform_plan_read_terraform_state resource
aws_iam_role_policy_attachment.tfmigrate_apply_put_terraform_state resource
aws_iam_role_policy_attachment.tfmigrate_apply_put_tfmigrate_history resource
aws_iam_role_policy_attachment.tfmigrate_apply_read_terraform_state resource
aws_iam_role_policy_attachment.tfmigrate_apply_read_tfmigrate_history resource
aws_iam_role_policy_attachment.tfmigrate_plan_read_terraform_state resource
aws_iam_role_policy_attachment.tfmigrate_plan_read_tfmigrate_history resource
aws_caller_identity.current data source
aws_iam_policy_document.assume_role_policy_main data source
aws_iam_policy_document.assume_role_policy_pr data source
aws_iam_policy_document.put_terraform_state data source
aws_iam_policy_document.put_tfmigrate_history data source
aws_iam_policy_document.read_terraform_state data source
aws_iam_policy_document.read_tfmigrate_history data source

Inputs

Name Description Type Default Required
assume_role_policy_main_conditions n/a
list(object({
test = string
variable = string
values = list(string)
}))
null no
assume_role_policy_pr_conditions n/a
list(object({
test = string
variable = string
values = list(string)
}))
null no
create_oidc_provider n/a bool false no
main_branch n/a string "main" no
name n/a string n/a yes
repo n/a string n/a yes
s3_bucket_terraform_state_name n/a string "" no
s3_bucket_tfmigrate_history_name n/a string n/a yes

Outputs

Name Description
aws_iam_role_terraform_apply_arn AWS IAM Role ARN for terraform apply
aws_iam_role_terraform_apply_name AWS IAM Role name for terraform apply
aws_iam_role_terraform_plan_arn AWS IAM Role ARN for terraform plan
aws_iam_role_terraform_plan_name AWS IAM Role name for terraform plan
aws_iam_role_tfmigrate_apply_arn AWS IAM Role ARN for tfmigrate apply
aws_iam_role_tfmigrate_apply_name AWS IAM Role name for tfmigrate apply
aws_iam_role_tfmigrate_plan_arn AWS IAM Role ARN for tfmigrate plan
aws_iam_role_tfmigrate_plan_name AWS IAM Role name for tfmigrate plan

LICENSE

MIT


This document is generated by terraform-docs