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

New resource azurerm_resource_provider #7951

Merged
merged 16 commits into from
Dec 7, 2020
Merged

New resource azurerm_resource_provider #7951

merged 16 commits into from
Dec 7, 2020

Conversation

Humoiz
Copy link
Contributor

@Humoiz Humoiz commented Jul 29, 2020

Implementing feature mentioned in the feature request: #1832

This PR adds following new resource, tests and its documentation:
azurerm_resource_provider_registration

It allows to register specified resource providers.

(fixes #1832)

Copy link
Contributor

@ArcturusZhang ArcturusZhang left a comment

Choose a reason for hiding this comment

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

Hi @Humoiz thanks for this PR! This new resource is very useful.

But I suppose the resource name azurerm_resource_provider is not quite clear enough since this resource does not really manage all of the things from a resource provider (it cannot manage features for example) but only the registration, how about rename this to azurerm_resource_provider_registration which should be more specific?

Also I think maybe this resource could just go to the resources category, what do you think?

Copy link
Contributor

@ArcturusZhang ArcturusZhang left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Collaborator

@WodansSon WodansSon left a comment

Choose a reason for hiding this comment

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

@Humoiz, thanks for the PR, this LGTM! 🚀

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.

Thank you for this pr @Humoiz! overall looks good but i have a few UX concerns that i've commented on inline

@tombuildsstuff tombuildsstuff self-assigned this Aug 18, 2020
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @Humoiz

Thanks for pushing those changes - I've taken a look through and left some comments inline but if we can fix those up (and the tests pass) then this otherwise looks good to me 👍

Thanks!

@tombuildsstuff tombuildsstuff removed their assignment Aug 18, 2020
@tombuildsstuff tombuildsstuff dismissed katbyte’s stale review August 18, 2020 10:34

dismissing since changes have been pushed

@Humoiz
Copy link
Contributor Author

Humoiz commented Aug 20, 2020

@tombuildsstuff Thanks for the feedback. I`ll review it and address it soon.

@ghost ghost removed the waiting-response label Aug 20, 2020
@Humoiz Humoiz requested a review from tombuildsstuff August 23, 2020 07:47
@Humoiz
Copy link
Contributor Author

Humoiz commented Aug 23, 2020

hey @Humoiz

Thanks for pushing those changes - I've taken a look through and left some comments inline but if we can fix those up (and the tests pass) then this otherwise looks good to me 👍

Thanks!

@tombuildsstuff - Thank you for your feedback. I have addressed all the code comments. Tests are passing after making the changes.

$ TF_ACC=1 go test -v ./azurerm/internal/services/resource/tests/ -run='(TestAccAzureRMResourceProviderRegistration)' === RUN TestAccAzureRMResourceProviderRegistration_basic === PAUSE TestAccAzureRMResourceProviderRegistration_basic === RUN TestAccAzureRMResourceProviderRegistration_requiresImport === PAUSE TestAccAzureRMResourceProviderRegistration_requiresImport === CONT TestAccAzureRMResourceProviderRegistration_basic === CONT TestAccAzureRMResourceProviderRegistration_requiresImport --- PASS: TestAccAzureRMResourceProviderRegistration_requiresImport (78.37s) --- PASS: TestAccAzureRMResourceProviderRegistration_basic (98.71s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/resource/tests 106.920s

@tombuildsstuff
Copy link
Contributor

hey @Humoiz

Apologies for the delayed response here - thought I'd replied to this - but thanks for pushing those changes.

Chatting with @grayzu last week, we think there's 4 scenarios we need to cover:

  • if auto-registration is enabled, and a user tries to enable an RP (which we would auto-register) - error
  • if auto-registration is enabled, and a user tries to register an RP we're not auto-registering (that's not already registered) - allow/register
  • if auto-registration is disabled, and a user tries to register an RP that's already registered - raise a "requires import" error
  • if auto-registration is disabled, and a user tries to register an RP that's not already registered - allow/register

Does that make sense?

@Humoiz
Copy link
Contributor Author

Humoiz commented Aug 24, 2020

hey @Humoiz

Apologies for the delayed response here - thought I'd replied to this - but thanks for pushing those changes.

Chatting with @grayzu last week, we think there's 4 scenarios we need to cover:

  • if auto-registration is enabled, and a user tries to enable an RP (which we would auto-register) - error
  • if auto-registration is enabled, and a user tries to register an RP we're not auto-registering (that's not already registered) - allow/register
  • if auto-registration is disabled, and a user tries to register an RP that's already registered - raise a "requires import" error
  • if auto-registration is disabled, and a user tries to register an RP that's not already registered - allow/register

Does that make sense?

@tombuildsstuff - For the scenario, where auto-registration is enabled, and a user tries to register an RP. How do I determine the ones which terraform is registering or not registering?

@ghost ghost removed the waiting-response label Aug 24, 2020
@tombuildsstuff
Copy link
Contributor

@Humoiz at the moment that's a little tricky since you'll have a circular reference - I'll refactor this tomorrow so that's not the case but in theory you'd get this list and string compare them (but as mentioned before, that's not possible right now due to a circular reference).

I'll post an update in the morning once that's been moved which'll make this possible - sorry for the delay.

tombuildsstuff added a commit that referenced this pull request Sep 1, 2020
This is required to unblock #7951, which has a circular reference otherwise
@tombuildsstuff tombuildsstuff dismissed stale reviews from katbyte and themself December 4, 2020 10:43

dismissing since changes have been pushed

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.

LGTM 👍

@tombuildsstuff tombuildsstuff merged commit 360d204 into hashicorp:master Dec 7, 2020
tombuildsstuff added a commit that referenced this pull request Dec 7, 2020
@Humoiz Humoiz deleted the hussain/register_providers branch December 8, 2020 17:51
@ghost
Copy link

ghost commented Dec 10, 2020

This has been released in version 2.40.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.40.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jan 6, 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 Jan 6, 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.

Resource to Enable Azure Providers
8 participants