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

juju_access_offer tries to remove admin access #662

Open
amandahla opened this issue Jan 30, 2025 · 0 comments
Open

juju_access_offer tries to remove admin access #662

amandahla opened this issue Jan 30, 2025 · 0 comments
Labels
kind/bug indicates a bug in the project state/untriaged untriaged bug report

Comments

@amandahla
Copy link
Contributor

amandahla commented Jan 30, 2025

Description

After applying a resource change, the juju_access_offer tries to remove admin access (added by default while creating an offer).

# module.postgresql.juju_access_offer.postgresql_to_operator will be updated in-place
  ~ resource "juju_access_offer" "postgresql_to_operator" {
      - admin     = [
          - "des-database",
        ] -> null
        id        = "admin/des-database.postgresql"
        # (2 unchanged attributes hidden)
    }
$ juju show-offer postgresql --format json|jq
{
  "microk8s-localhost:admin/des-database.postgresql": {
    "description": "Charm to operate the PostgreSQL database on Kubernetes clusters\n",
    "access": "admin",
    "endpoints": {
      "database": {
        "interface": "postgresql_client",
        "role": "provider"
      }
    },
    "users": {
      "admin": {
        "display-name": "admin",
        "access": "admin"
      },
      "des-application": {
        "access": "consume"
      },
      "des-database": {
        "access": "admin"
      },
      "everyone@external": {
        "access": "read"
      }
    }
  }
}

Workaround

Add the user defined in provider (the one that will create the offer) as admin in the plan:

resource "juju_access_offer" "postgresql_to_operator" {
  offer_url = juju_offer.postgresql.url
  consume   = [var.juju_offer_user]
  admin     = ["des-database"]
}

Urgency

Casually reporting

Terraform Juju Provider version

0.16.0

Terraform version

1.7.4

Juju version

3.6.2

Terraform Configuration(s)

https://github.com/amandahla/cmr-terraform-test/tree/main

Reproduce / Test

https://github.com/amandahla/cmr-terraform-test/tree/main

Debug/Panic Output

Notes & References

No response

@amandahla amandahla added kind/bug indicates a bug in the project state/untriaged untriaged bug report labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug indicates a bug in the project state/untriaged untriaged bug report
Projects
None yet
Development

No branches or pull requests

1 participant