Skip to content

GitHub Action to pull the region from AWS provider block in Terraform/OpenToFu

License

Notifications You must be signed in to change notification settings

ego93/tf-get-region

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Get Region Action

GitHub Action to scans Terraform files in a specified directory to find and extract the AWS region configuration from the aws provider block. This is useful for workflows that need to know which AWS region is being used in a monorepo Terraform project without manually specifying it.

Works with both Terraform and OpenToFu

Outputs

region

The AWS region extracted from the Terraform files.

Inputs

terraform_directory

Required: false

Default: "."

Directory to search for Terraform files

tfvars_file

Required: false

Name of tfvars file within the terraform_directory

Example usage

steps:
  - uses: actions/checkout@v4
  - name: Get AWS Region
    uses: VIOOH/get-region-action@v1
    id: get-region
    with:
      terraform_directory: 'path/to/terraform/files'
      tfvars_file: 'terraform.tfvars'
  - name: Use the region
    run: |
      echo "The region is ${{ steps.get-region.outputs.region }}"

About

GitHub Action to pull the region from AWS provider block in Terraform/OpenToFu

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published