Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save msampathkumar/dfaa5f972c02cb49c9930544d8c4edb7 to your computer and use it in GitHub Desktop.
Save msampathkumar/dfaa5f972c02cb49c9930544d8c4edb7 to your computer and use it in GitHub Desktop.

Revisions

  1. msampathkumar created this gist Nov 30, 2021.
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    # Testing https://github.com/GoogleCloudPlatform/magic-modules/pull/5448/files


    # Step by Step - Instructions

    - Step1: Download files

    ```
    wget https://github.com/GoogleCloudPlatform/magic-modules/raw/e8d547a02b95d7a1a650b52c5968404ee57a7b14/mmv1/products/compute/terraform.yaml
    wget https://github.com/GoogleCloudPlatform/magic-modules/raw/e8d547a02b95d7a1a650b52c5968404ee57a7b14/mmv1/templates/terraform/examples/external_ssl_proxy_lb_mig_backend_custom_header.tf.erb
    ```

    - Step2: Using Gcloud shell

    Install & use `tftools` from https://github.com/GoogleCloudPlatform/terraform-sample-tools/tree/main/tools/Magic%20Modules%20-%20Terraform%20Automation%20Tools

    After git clone of above repo, do following in `terraform-sample-tools/tools/Magic Modules - Terraform Automation Tools/`
    ```
    sudo python3 setup.py install
    ```

    - Step3: Prepare terraform executable script

    ```bash
    tftools external_ssl_proxy_lb_mig_backend_custom_header.tf.erb terraform.yaml
    ```
    This tftools is installed in step 2. Using this tools, we run some pre-check validation on config & erb files and then generates a terraform file. In this we should get `external_ssl_proxy_lb_mig_backend_custom_header.tf`

    - Step4: Run terraform init & validation

    ```bash
    terraform init
    terraform validate
    ```
    If `Success` is reported for validate proceed to next steps

    - Step5: Terraform Apply to create & run the infra

    ```bash
    terraform apply
    ```

    - Step6: Terraform detroy to rollback infra setup

    ```bash
    terraform destroy
    ```