nebari-dev / nebari

🪴 Nebari - your open source data science platform
https://nebari.dev
BSD 3-Clause "New" or "Revised" License
275 stars 88 forks source link

[BUG] - AWS resource group doesn't follow the project-namespace convention #2139

Open sblair-metrostar opened 9 months ago

sblair-metrostar commented 9 months ago

Describe the bug

It seems that everything created in AWS by Nebari follows the project-namespace naming convention except for the resource group. Assuming this convention was established to allow for multiple environments with the same project name but different namespaces to co-exist, this exception creates a conflict when deploying the second.

Expected behavior

Should be able to create two environments of the same project with different namespaces in AWS.

OS and architecture in which you are running Nebari

Linux, x64

How to Reproduce the problem?

Create two Nebari AWS deployments in the same account with the following configurations:

provider: aws
namespace: one
nebari_version: 2023.11.1
project_name: <project name>
provider: aws
namespace: two
nebari_version: 2023.11.1
project_name: <project name>

Command output

[terraform]: ╷
[terraform]: │ Error: error creating resource group: BadRequestException: Cannot create group: group already exists
[terraform]: │ 
[terraform]: │   with module.accounting.aws_resourcegroups_group.main,
[terraform]: │   on modules/accounting/main.tf line 1, in resource "aws_resourcegroups_group" "main":
[terraform]: │    1: resource "aws_resourcegroups_group" "main" {
[terraform]: │

Versions and dependencies used.

Nebari: 2023.11.1

Compute environment

AWS

Integrations

No response

Anything else?

No response

Adam-D-Lewis commented 3 months ago

Thanks for opening the issue @sblair-metrostar.

Assuming this convention was established to allow for multiple environments with the same project name but different namespaces to co-exist.

I believe you'd like to deploy multiple Nebari deployments on a single AKS cluster. It seems that with both deployments, you are using the aws provider. This should be possible, and we have some docs on this here, but the 2nd deployment would use the existing provider.

Does the method in the example in the docs work for you?