Skip to content

Drift in stackit_authorization_organization_role_assignment are not handled #1067

@HartmannVolker

Description

@HartmannVolker

Description

If I create an organisation role assignment via using stackit_authorization_organization_role_assignment and delete the assignment e.g. in the STACKIT Portal the next plan breaks instead of handling this drift gracefully.

I assume this might be due to unfinished implementation since the resource is part of an iam experiment.

Steps to reproduce

  1. Create an organisation role assignment using the resource stackit_authorization_organization_role_assignment
  2. Delete the assignment in the STACKIT Portal
  3. Run terraform plan or apply
resource "stackit_authorization_organization_role_assignment" "user_org_access" {
  resource_id = local.organisation_id
  role        = "organization.auditor"
  subject     = "<redacted user email>"
}

You will get the error:

│ Error: Error reading authorization
│ 
│   with stackit_authorization_organization_role_assignment.user_org_access,
│   on project_access.tf line 81, in resource "stackit_authorization_organization_role_assignment" "user_org_access":
│   81: resource "stackit_authorization_organization_role_assignment" "user_org_access" {
│ 
│ Processing API payload: response members did not contain expected role assignment

Actual behavior

The provider is throwing an error.

Expected behavior

I would expect the provider to update the state according to the real world state. If the resource has been deleted in STACKIT, terraform should propose to recreate it.

Environment

  • OS: MacOS
  • Terraform version (see terraform --version): v1.13.5
  • Version of the STACKIT Terraform provider: v0.71.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions