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

azurerm_role_assignment - supports "description", "condition", "condition_version" #10804

Merged
merged 6 commits into from
Mar 12, 2021

Conversation

njuCZ
Copy link
Contributor

@njuCZ njuCZ commented Mar 3, 2021

upgrade version for authorization from 2018-09-01-preview to 2020-04-01-preview

support property: "description", "condition", "condition_version"

docs about condition: https://review.docs.microsoft.com/en-us/azure/role-based-access-control/conditions-overview?branch=pr-en-us-119593

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @njuCZ - left a couple minor comments inline

Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we validate this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have asked the service team, they say it's a new syntax format. It's not easy to write the validation func

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it at least be no emptry strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Optional: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{
"1.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does am empty value for this properyt mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

condition and condition_version should be both set or unset. When condition_version is empty, it means not set condition and condition_version

Copy link
Collaborator

@katbyte katbyte Mar 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COuld we use RequiredWith to ensure this during plan?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@katbyte
Copy link
Collaborator

katbyte commented Mar 10, 2021

Could we also ensure all role definition tests pass to ensure the API upgrade isn't breaking anything? i see these two failing:

TestAccAzureRMRoleDefinition_update
TestAccAzureRMRoleDefinition_updateEmptyId

@njuCZ
Copy link
Contributor Author

njuCZ commented Mar 11, 2021

@katbyte it seems in the new api version, the update api needs more time to become eventually consistency. I have changed the ContinuousTargetOccurence from 6 to 10, all acctest in teamcity have passed.

@ghost ghost removed the waiting-response label Mar 11, 2021
@njuCZ njuCZ requested a review from katbyte March 11, 2021 11:35
@katbyte katbyte added this to the v2.51.0 milestone Mar 11, 2021
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @njuCZ - LGTM 👍

@katbyte katbyte merged commit 74e5a57 into hashicorp:master Mar 12, 2021
katbyte added a commit that referenced this pull request Mar 12, 2021
@ghost
Copy link

ghost commented Mar 12, 2021

This has been released in version 2.51.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.51.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Apr 11, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants