Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recieving an Error when attempting to provision Viya without a nat gateway #178

Closed
1 task done
MattyStacks opened this issue Jan 13, 2023 · 5 comments · Fixed by #238
Closed
1 task done

Recieving an Error when attempting to provision Viya without a nat gateway #178

MattyStacks opened this issue Jan 13, 2023 · 5 comments · Fixed by #238
Labels
bug Something isn't working

Comments

@MattyStacks
Copy link

Terraform Version Details

➜ tools git:(dev) ✗ ./iac_tooling_version.sh
{
"terraform_version": ""1.3.7"",
"terraform_revision": "null",
"terraform_outdated": "false",
"provider_selections": "{}"
}

Terraform Variable File Details

Cluster config

cluster_api_mode = "private"

Jump Server

create_jump_vm = false
create_jump_public_ip = false
create_nfs_public_ip = false

storage_type = "ha"

Bring your own existing resources

vpc_id = "vpc-" # only needed if using pre-existing VPC
subnet_ids = { # only needed if using pre-existing subnets
"private" : ["subnet-
", "subnet-"],
"database" : ["subnet-
", "subnet-***"]
}

Steps to Reproduce

Run the terraform plan with the vpcid, and subnet ids set without a nat gateway.

Expected Behavior

To run the plan without error. When running the plan without a vpcid it works, but we have a byo vpc we have to include.

Actual Behavior

Recieved this error

│   on modules/aws_vpc/main.tf line 292, in resource "aws_route" "private_nat_gateway":
│  292:   route_table_id         = aws_route_table.private.*.id
│     ├────────────────
│     │ aws_route_table.private is empty tuple
│
│ Inappropriate value for attribute "route_table_id": string required.
╵
╷
│ Error: Incorrect attribute value type
│
│   on modules/aws_vpc/main.tf line 294, in resource "aws_route" "private_nat_gateway":
│  294:   nat_gateway_id         = aws_nat_gateway.nat_gateway.*.id
│     ├────────────────
│     │ aws_nat_gateway.nat_gateway is tuple with 1 element
│
│ Inappropriate value for attribute "nat_gateway_id": string required.

Additional Context

We don't currently run NAT gateways in this account. However, we do have private subnets, and a VPC already set up.

References

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@MattyStacks MattyStacks added bug Something isn't working new Added to an issue when it's new ;) labels Jan 13, 2023
@jograca
Copy link

jograca commented Jan 17, 2023

We're seeing the same behavior with our TF Plan

@manoatsas
Copy link
Member

IMO this is an enhancement request and not a bug and works as designed. See BYO detailed requirements page - https://github.com/sassoftware/viya4-iac-aws/blob/main/docs/user/BYOnetwork.md, that states nat_id is required except for scenario 1, where only vpc_id is provided as an input.

@MattyStacks
Copy link
Author

Would you be able to tell me what the NAT is actually doing? It says it's a requirement, but it doesn't say why it's a requirement.

@MattyStacks
Copy link
Author

I still do think this is a bug, because I don't think it's actually needed unless you are using a public subnet. However, I need someone to confirm what the NAT gateway actually does if you specify a vpc_id.

@dhoucgitter dhoucgitter removed the new Added to an issue when it's new ;) label Dec 6, 2023
@dhoucgitter
Copy link
Member

@MattyStacks, the latest viya4-iac-aws has new behavior related to BYO network input requirements and the BYO network requirements page https://github.com/sassoftware/viya4-iac-aws/blob/main/docs/user/BYOnetwork.md has been updated for the 8.0.0 - December 6, 2023 release to reflect the changes. . Note that nat_id is no longer a required input for byo_network_scenarios 2 & 3 as it used to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants