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

Missing validation on spec.infrastructure.vpc.network.cidr #297

Open
g-iannelli opened this issue Feb 22, 2023 · 1 comment
Open

Missing validation on spec.infrastructure.vpc.network.cidr #297

g-iannelli opened this issue Feb 22, 2023 · 1 comment
Labels

Comments

@g-iannelli
Copy link
Contributor

As [documented] (https://aws.amazon.com/vpc/faqs), the VPC length must be a value between /16 and /28. Furthermore, it is not possible to specify the 4 additional CIDRs.

cat barebone.eu-west-1.yml| yq -e .spec.infrastructure.vpc.network.cidr && AWS_DEFAULT_REGION=us-east-1 AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY furyctl-ng validate config -c barebone.eu-west-1.yml --distro-location 'git::[email protected]:sighupio/fury-distribution.git?depth=1&ref=feature/furyctl-next'
10.10.0.0/15
INFO Downloading distribution...
INFO configuration file validation succeeded

AWS_REGION=us-east-1 AWS_DEFAULT_REGION=us-east-1 AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY furyctl-ng create cluster -c barebone.eu-west-1.yml --distro-location 'git::[email protected]:sighupio/fury-distribution.git?depth=1&ref=feature/furyctl-next'

INFO Downloading distribution...
INFO Validating configuration file...
INFO Downloading dependencies...
INFO Validating dependencies...
INFO Creating cluster...
INFO Running infrastructure phase...
ERRO error while creating cluster: error while executing infrastructure phase: error running terraform plan: error running terraform plan: /Users/giuseppe.iannelli/.furyctl/bin/terraform/0.15.4/terraform /Users/giuseppe.iannelli/.furyctl/bin/terraform/0.15.4/terraform plan -no-color -out plan/terraform.plan: command failed - exit status 1
out:
err:
Error: expected "cidr_block" to contain a network Value with between 16 and 28 significant bits, got: 15

  with module.vpc-and-vpn.module.vpc.aws_vpc.this[0],
  on .terraform/modules/vpc-and-vpn.vpc/main.tf line 32, in resource "aws_vpc" "this":
  32:   cidr_block                       = var.cidr
@omissis
Copy link
Contributor

omissis commented Feb 28, 2023

there are three things to do here:

  • update the eks installer to accept additional cidrs
  • update the schema validation to make more strict
  • implement custom validation in furyctl to ensure the specified cidrs do not overlap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants