IBM/automation-aws-infra-openshift

Cluster creation not following region requested

Closed this issue · 2 comments

After running setup-workspace.sh and setting region to us-west-2 the cluster.tfvars file contains:

cat ../cluster.tfvars 
## name_prefix: Prefix to be added to the names of resources which are being provisioned
name_prefix="tor-wnlp-qs"

## resource_group_name: The name of the resource group where the VPC is deployed. On AWS this value becomes a tag.
resource_group_name="tor-wnlp-qs"

## region: the value of region
region="us-west-2"

## multi-zone: Create subnets in multiple zones
#multi-zone="true"
...

However terraform plan shows all resources being created in ap-south-1 ex:

  # module.cluster.null_resource.create_rosa_user will be created
  + resource "null_resource" "create_rosa_user" {
      + id       = (known after apply)
      + triggers = {
          + "cluster_info_file_name" = "cluster_info.json"
          + "cluster_name"           = "tor-rosa-cluster"
          + "cred_file_name"         = "rosa_admin_cred.json"
          + "region"                 = "ap-south-1"
          + "tmp_dir"                = "/workspaces/current/105-aws-vpc-openshift/.tmp"
        }
    }

Based on other data in the plan, including the user_arn for the KMS key, it appears that none of the values contained in cluster.tfvars is overriding the contents of /workspaces/current/105-aws-vpc-openshift/variables.tf

Cause appears to be that setup-workspace.sh script is over-writing the layer-level apply.sh script here:

cp -f "${SCRIPT_DIR}/apply.sh" "${name}/apply.sh"

fixed by: a3337f4