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

Importing an AuthN mapping ignores team assignment #2685

Closed
chris-pinola-rf opened this issue Nov 20, 2024 · 0 comments · Fixed by #2686
Closed

Importing an AuthN mapping ignores team assignment #2685

chris-pinola-rf opened this issue Nov 20, 2024 · 0 comments · Fixed by #2686
Labels

Comments

@chris-pinola-rf
Copy link
Contributor

Datadog Terraform Provider Version

3.48.1

Terraform Version

1.9.8

What resources or data sources are affected?

  • datadog_authn_mapping

Terraform Configuration Files

resource "datadog_authn_mapping" "team_mapping" {
  key   = "..."
  value = "..."
  team  = datadog_team.team.id
}

Relevant debug or panic output

No response

Expected Behavior

The imported datadog_authn_mapping includes the team ID and thus terraform plan returns cleanly with no planned changes.

Actual Behavior

Output of terraform state show datadog_authn_mapping.team_mapping confirms that the team ID was not added to the Terraform state:

# datadog_authn_mapping.team_mapping:
resource "datadog_authn_mapping" "team_mapping" {
    id    = "..."
    key   = "http://schemas.microsoft.com/ws/2008/06/identity/claims/groups"
    role  = null
    value = "..."
}

Output of terraform plan:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # datadog_authn_mapping.team_mapping will be updated in-place
  ~ resource "datadog_authn_mapping" "team_mapping" {
        id    = "<UUID>"
      + team  = "<UUID>"
        # (3 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

  1. Define a datadog_authn_mapping resource for the existing Team AuthN mapping, as shown above
  2. Import the existing mapping by ID: terraform import datadog_authn_mapping.team_mapping <UUID>
  3. Observe that the resource is dirty: terraform plan

Where <UUID> refers to the ID of an AuthN team (i.e. not a role) mapping.

Important Factoids

No response

References

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant