Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 981 Bytes

README.md

File metadata and controls

43 lines (28 loc) · 981 Bytes

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 }}"