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_lighthouse_definition - support the eligible_authorization property #19569

Merged
merged 5 commits into from
Dec 12, 2022

Conversation

neil-yechenwei
Copy link
Contributor

@neil-yechenwei neil-yechenwei commented Dec 6, 2022

This PR is to support new property eligible_authorization for azurerm_lighthouse_definition.

Note: As the TCs related with Lighthouse Definition are skipped in Teamcity due to test data issue, so I ran them on my local and they passed.

--- PASS: TestAccLighthouseDefinition_plan (134.77s)
--- PASS: TestAccLighthouseDefinition_basic (135.99s)
--- PASS: TestAccLighthouseDefinition_emptyID (138.56s)
--- PASS: TestAccLighthouseDefinition_eligibleAuthorization (157.81s)
--- PASS: TestAccLighthouseDefinition_complete (160.86s)
--- PASS: TestAccLighthouseDefinition_requiresImport (184.04s)
--- PASS: TestAccLighthouseDefinition_update (527.25s)

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Thanks @neil-yechenwei
This looks off to a good start, some questions below on the new schema if you could take a look.

Thanks!

ValidateFunc: validation.IsUUID,
},

"principal_display_name": {
Copy link
Member

Choose a reason for hiding this comment

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

Does this provide any additional benefit to just using the principal_id? What happens if the id and display name do not match?

Copy link
Contributor Author

@neil-yechenwei neil-yechenwei Dec 7, 2022

Choose a reason for hiding this comment

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

The resource still can be created successfully if the id and display name do not match.

Service team confirmed they don't have any strong validation enforced for PrincipalIdDisplayName with Azure Active directory to cross check the name correctness.
The display name in AzureLighthouse resource is that customers can be able to have some mapping to this principalId given and not has any tight dependency with actual name of the principal itself.

To align with the previous style and official sample, so I added it here.

Comment on lines +103 to +106
"eligible_authorization": {
Type: pluginsdk.TypeSet,
Optional: true,
Elem: &pluginsdk.Resource{
Copy link
Member

Choose a reason for hiding this comment

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

Are there a maximum number of elements this Set allows in the API?

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 didn't find the maximum number from anywhere. The autorization previously added also didn't mention the maximum number.

website/docs/r/lighthouse_definition.html.markdown Outdated Show resolved Hide resolved
},
},

"principal_display_name": {
Copy link
Member

Choose a reason for hiding this comment

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

as above, what happens if this does not match the display name of the principal_id?

Copy link
Contributor Author

@neil-yechenwei neil-yechenwei Dec 7, 2022

Choose a reason for hiding this comment

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

Same as above

principal_display_name = "Reader"
}

eligible_authorization {
Copy link
Member

Choose a reason for hiding this comment

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

Should we have a test with multiple entries for this new block?

Copy link
Contributor Author

@neil-yechenwei neil-yechenwei Dec 7, 2022

Choose a reason for hiding this comment

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

Given test data limitation, there is no more principal for testing. So we cannot add one more block. As you can see, we only can test them on local with limited test data. And per my understanding, I assume it's not a required thing to test multiple entries for new block.

@neil-yechenwei
Copy link
Contributor Author

@jackofallops , thanks for the comment. I've updated PR and left some suggestion.

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.

LGTM ⛵

@katbyte katbyte merged commit 871816a into hashicorp:main Dec 12, 2022
katbyte added a commit that referenced this pull request Dec 12, 2022
favoretti pushed a commit to favoretti/terraform-provider-azurerm that referenced this pull request Jan 12, 2023
favoretti pushed a commit to favoretti/terraform-provider-azurerm that referenced this pull request Jan 12, 2023
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Jan 13, 2023
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.

3 participants