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

Consistent Identity Blocks across the provider #15187

Closed
opslivia opened this issue Jan 31, 2022 · 2 comments · Fixed by #15800
Closed

Consistent Identity Blocks across the provider #15187

opslivia opened this issue Jan 31, 2022 · 2 comments · Fixed by #15800
Assignees
Milestone

Comments

@opslivia
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Background

In 2.x versions of the Provider, the identity block differs depending on the resource being used, such that the following combinations are possible:

Current Behavior

No identity (by omitting the block):

resource "foo" "bar" {
  # ...
}

No identity (by specifying 'type = None'):

resource "foo" "bar" {
  # ...
  
  identity {
    type = "None"
  }
}

System Assigned Identity:

resource "foo" "bar" {
  # ...
  
  identity {
    type = "SystemAssigned"
  }
}

User Assigned Identity:

resource "foo" "bar" {
  # ...
  
  identity {
    type = "UserAssigned"
    identity_ids = ["..."]
  }
}

System Assigned, User Assigned Identity:

resource "foo" "bar" {
  # ...
  
  identity {
    type = "SystemAssigned, UserAssigned"
    identity_ids = ["..."]
  }
}

While the two "No identity" blocks carry the same result, they currently aren't reconciled into Terraform correctly. Some resources require specifying the block and others omitting it, which is confusing.

New or Affected Resource(s)

  • all resources that use the identity block

Proposed Behavior

As a part of the upcoming 3.0 we'll be making these behaviorally consistent in the Provider, such that:

  • When the resource should have no identity (e.g. where the block is currently omitted or set to type = "None"), the identity block should be omitted.

No identity (by omitting the block):

resource "foo" "bar" {
  # ...
}
  • When a System Assigned, User Assigned or SystemAssigned, UserAssigned identity, the block must be specified as it is today.

System Assigned Identity:

resource "foo" "bar" {
  # ...
  
  identity {
    type = "SystemAssigned"
  }
}

User Assigned Identity:

resource "foo" "bar" {
  # ...
  
  identity {
    type = "UserAssigned"
    identity_ids = ["..."]
  }
}

System Assigned, User Assigned Identity:

resource "foo" "bar" {
  # ...
  
  identity {
    type = "SystemAssigned, UserAssigned"
    identity_ids = ["..."]
  }
}
@opslivia opslivia added this to the v3.0.0 milestone Jan 31, 2022
tombuildsstuff added a commit to xiaxyi/terraform-provider-azurerm that referenced this issue Feb 15, 2022
@github-actions
Copy link

This functionality has been released in v3.0.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants