ava-labs / avalanche-docs

Protocol documentation for the Avalanche network.
https://docs.avax.network/
BSD 3-Clause "New" or "Revised" License
158 stars 371 forks source link

Multiple issues with the gcp terraform templates #1538

Open tactical-retreat opened 11 months ago

tactical-retreat commented 11 months ago

Describe the bug

There are a number of problems with the GCP terraform templates. I fixed a few of them as I went along, making other changes, so I don't have a comprehensive list. But I'll note a few that I can quickly pull out of my diff:

meaghanfitzgerald commented 11 months ago

Hey Tactical, thanks for raising this issue.

I'm assuming these comments refer to these example terraform files referenced in this tutorial in our docs.

To the points you made above:

_- p2pport instead of p2p_port_

All the port variables in this repository are consistently named p2p_port. AFAICT, so long as this is defined consistently it shouldn't affect the deployment.

_- bucket_name is referenced in a few place that are irrelevant (e.g. declared in the node module, unused)_

This may have been included by the original writers of this tutorial as a way to provide the reader more clarity. Functionally, it shouldn't affect anything.

_- ip_cidr_range is used in one place, hardcoded in another_

Yes, I found what you were referring to in terraform-gcp/modules/vpc/main.tf. I will raise a PR to correct, unless you'd like to do so and get credit as a contributor.

- reference to "../../../modules/vpc" has an extra ../

Good catch, can also include in the above PR.

meaghanfitzgerald commented 11 months ago

Appreciate the callouts. If you have any more edits to suggest please let us know.

tactical-retreat commented 11 months ago

All the port variables in this repository are consistently named p2p_port. AFAICT, so long as this is defined consistently it shouldn't affect the deployment.

It's incorrectly used here:

https://github.com/ava-labs/avalanche-docs/blob/master/static/scripts/terraform-gcp/modules/node/main.tf#L124

The declaration with the correct name is here:

https://github.com/ava-labs/avalanche-docs/blob/master/static/scripts/terraform-gcp/modules/node/variables.tf#L36

This may have been included by the original writers of this tutorial as a way to provide the reader more clarity. Functionally, it shouldn't affect anything.

I disagree it adds clarity. Why would a GCE instance need a bucket? It's declared, and provided, but unused.

https://github.com/ava-labs/avalanche-docs/blob/master/static/scripts/terraform-gcp/modules/node/variables.tf#L46

I will raise a PR to correct, unless you'd like to do so and get credit as a contributor.

I don't need credit, you can PR the changes.

I have a few other notes, that are more of 'nice to haves' that you could consider if you plan to enhance this repo, although from what I can tell the focus is on the avalanche-cli support. Maybe it should be considered there?