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

[BUG] - Project Names and Namespaces with Underscores Break in Certain Providers #2001

Open
kenafoster opened this issue Sep 12, 2023 · 1 comment
Labels
area: terraform 💾 needs: tests ✅ This contribution is missing tests type: bug 🐛 Something isn't working

Comments

@kenafoster
Copy link
Contributor

Describe the bug

Project names and namespaces with underscores break because they're not DNS compliant (or escaped). The first time this issue is encountered when deploying in AWS is trying to create S3 bucket because it used the pattern [project_name]-[namespace]-terraform-state. But if that were updated there would surely be others in later stages (most K8S resource names must be DNS compliant, and so _ are illegal).

Expected behavior

Project names and namespaces that are legal as defined by Nebari should be able to successfully create resources.

OS and architecture in which you are running Nebari

Ubuntu 22.04 amd64

How to Reproduce the problem?

nebari init aws -p test_project
nebari deploy -c nebari-config.yaml

Command output

[terraform]: │ Error: validating S3 Bucket (test_project-dev-terraform-state) name: only lowercase alphanumeric characters and hyphens allowed in "test_project-dev-terraform-state"
[terraform]: │ 
[terraform]: │   with module.terraform-state.aws_s3_bucket.terraform-state,
[terraform]: │   on modules/terraform-state/main.tf line 1, in resource "aws_s3_bucket" "terraform-state":
[terraform]: │    1: resource "aws_s3_bucket" "terraform-state" {

Versions and dependencies used.

No response

Compute environment

None

Integrations

No response

Anything else?

No response

@kenafoster kenafoster added needs: triage 🚦 Someone needs to have a look at this issue and triage type: bug 🐛 Something isn't working labels Sep 12, 2023
@pavithraes pavithraes added area: terraform 💾 project: JATIC Work item needed for the JATIC project and removed needs: triage 🚦 Someone needs to have a look at this issue and triage labels Sep 14, 2023
@pavithraes pavithraes moved this from New 🚦 to TODO 📬 in 🪴 Nebari Project Management Sep 14, 2023
@iameskild iameskild removed this from the Release 2023.9.1 milestone Sep 18, 2023
@pt247
Copy link
Contributor

pt247 commented Dec 20, 2023

We are using the terraform version
From terraform version v3.28.0 terraform plan will fail if the bucket name has underscores for AWS.
Link to bugfix in terrafrom ticket.

But upgrading the Terraform will not prevent nebari deploy from failing.
I would recommend that we add validations in Nebari Wizard.

  1. Add validation in Wizard to check if the provider is AWS, then don't allow _s in the project name.

    • Pro: It's an easy fix.
    • Con: Naming conventions can differ for different cloud providers.
  2. Enforce validation for all providers.

    • Pro:
      • Even easier to add it to Wizard.
      • Consistent naming conventions across all providers.
      • Switching providers can become easier.
    • Con:
      • All the providers need to be tested.

@viniciusdc viniciusdc added the needs: tests ✅ This contribution is missing tests label Mar 24, 2024
@kcpevey kcpevey removed the project: JATIC Work item needed for the JATIC project label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: terraform 💾 needs: tests ✅ This contribution is missing tests type: bug 🐛 Something isn't working
Projects
Status: TODO 📬
Development

No branches or pull requests

6 participants