Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Here's an improved version of your README file that includes instructions for running Terraform plans for the entire configuration as well as specific modules with dynamic variables:

Module Testing

Use this folder to run local testing of the modules.

Setup

  1. Navigate to the GCP Directory:

    cd gcp
  2. Initialize Terraform:

    Initialize the Terraform working directory. This step downloads the necessary provider plugins.

    terraform init
  3. Validate Configuration:

    Validate the Terraform files to ensure the configuration is syntactically valid and internally consistent.

    terraform validate

Run Terraform Plan

Whole Plan

To generate an execution plan for the entire configuration, run:

terraform plan

Specific Modules

To generate an execution plan targeting a specific module, use the -target option along with dynamic variable values:

terraform plan --target="module.cloud-cloudbuild-trigger" -var "gcp_project=infra-dev-migue-93b99628" -var "gcp_region=europe-west2"

Notes

  • Ensure that the gcp_project and gcp_region variables are set appropriately for your environment. These can be passed directly in the command line as shown above, or set in a terraform.tfvars file.
  • If all validations and plans are successful, the configuration is ready to be applied.

Future Improvements

  • CI Integration: Plan to integrate this process into a Continuous Integration (CI) pipeline to automatically build and test the module examples in a dedicated project environment.