-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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_subscription
#10718
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jackofallops - overall looks good and i have soe minor comments i've left inline
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @jackofallops
On the whole this looks pretty good - I've taken a look through and left some comments inline, but if we can fix those up then this should be otherwise good to go 👍
Thanks!
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking a look through on the whole this looks pretty good - but we should update this to use the ID's of these items rather than the Name's, since there's different scopes/options for Billings Accounts etc, which'd help us differentiate these in the future
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/subscription/subscription_resource.go
Outdated
Show resolved
Hide resolved
1afc46b
to
10319ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @jackofallops
Thanks for pushing those changes - I've left some more comments inline but this otherwise LGTM 👍
This has been released in version 2.50.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.50.0"
}
# ... other configuration ... |
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! |
This PR introduces a new resource to manage Subscriptions using the new SubscriptionAlias API.
Note: Creating Subscriptions requires a high level of access to the Azure Billing account in which the Subscription is being created/managed. The level of access is dependent on the account type with Azure (e.g. Enterprise Account, MCA, or Partner Account).
Note: Using this resource will create a Subscription Alias meta resource. Azure allows multiple Aliases per subscription, however, for Terraform to correctly manage this the Provider limits this to a 1:1 relationship. The Alias Meta resource has been introduced to give a common interface for creating Subscriptions across the various account types.
Warning: Destroying anazurerm_subscription
resource will deactivate/cancel your subscription, including all resources contained within, through this resource. See here for what happens when this occurs.Subscriptions containing resources not managed by Terraform will prevent that Subscription from being deleted/destroyed and return an error.
Error: autorest/azure: Service returned an error. Status=400 Code="ResourcesExistingOnSubscription" Message="There are existing resources associated with subscription. Delete them before cancelling the subscription"
closes #1216