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] Spark Operator stack fails to create if spark-operator-doeks-spark-irsa already exists #668

Closed
1 task done
alanty opened this issue Oct 10, 2024 · 2 comments
Closed
1 task done
Assignees

Comments

@alanty
Copy link
Contributor

alanty commented Oct 10, 2024

Description

When creating a duplicate Spark operator stack the creation fails with an error on the IAM policy for Spark:

│ Error: creating IAM Policy (spark-operator-doeks-spark-irsa): operation error IAM: CreatePolicy, https response error StatusCode: 409, ..., EntityAlreadyExists: A policy called spark-operator-doeks-spark-irsa already exists. Duplicate names are not allowed.
│
│   with aws_iam_policy.spark,
│   on spark-team.tf line 66, in resource "aws_iam_policy" "spark":
│   66: resource "aws_iam_policy" "spark" {
│
  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: v1.0.3 (latest)

  • Terraform version: v1.9.5

  • Provider version(s):
  • provider registry.terraform.io/gavinbunney/kubectl v1.14.0
  • provider registry.terraform.io/hashicorp/aws v5.70.0
  • provider registry.terraform.io/hashicorp/cloudinit v2.3.5
  • provider registry.terraform.io/hashicorp/helm v2.15.0
  • provider registry.terraform.io/hashicorp/kubernetes v2.32.0
  • provider registry.terraform.io/hashicorp/random v3.3.2
  • provider registry.terraform.io/hashicorp/time v0.12.1
  • provider registry.terraform.io/hashicorp/tls v4.0.6

Reproduction Code [Required]

Steps to reproduce the behavior:

create two copies of the Spark operator (v4) stack in the same account (i was using a different region)

Expected behavior

we should use a unique name for that policy to avoid conflicts

@alanty alanty self-assigned this Oct 10, 2024
@alanty
Copy link
Contributor Author

alanty commented Oct 10, 2024

i think it's this resource giving me a headache:

resource "aws_iam_policy" "spark" {

We can probably use name_prefix instead of name to ensure uniqueness on the policy, even when someone uses the same name for the stack. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy#argument-reference

@alanty
Copy link
Contributor Author

alanty commented Oct 30, 2024

solved in #672 for the spark operator blueprint, we may need to check others

@alanty alanty closed this as completed Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant