SUSE / ha-sap-terraform-deployments

Automated SAP/HA Deployments in Public/Private Clouds
GNU General Public License v3.0
123 stars 88 forks source link

Disable nw-pas-route creation if nw is not enabled #792

Closed arbulu89 closed 3 years ago

arbulu89 commented 3 years ago

The deployment in AWS is failing if Netweaver is not enabled:

Error: Invalid index

  on modules/netweaver_node/main.tf line 46, in resource "aws_route" "nw-pas-route":
  46:   instance_id            = aws_instance.netweaver.0.id
    |----------------
    | aws_instance.netweaver is empty tuple

The given key does not identify an element in this collection value.

This fix basically checks if there is any NW vm before checking the current condition and create the route

arbulu89 commented 3 years ago

Thanks for finding/fixing this. Could you please also fix this for GCP? It has the exact same logic in it ;)

Good catch. Thanks!

arbulu89 commented 3 years ago

@yeoldegrove Requested change force pushed