-
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
Add support for status property of azurerm_eventhub #12043
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.
This is mostly good with one minor comment!
"status": { | ||
Type: pluginsdk.TypeString, | ||
Optional: true, | ||
Default: string(eventhubs.EntityStatusActive), | ||
ValidateFunc: validation.StringInSlice([]string{ | ||
string(eventhubs.EntityStatusActive), | ||
string(eventhubs.EntityStatusCreating), | ||
string(eventhubs.EntityStatusDeleting), | ||
string(eventhubs.EntityStatusDisabled), | ||
string(eventhubs.EntityStatusReceiveDisabled), | ||
string(eventhubs.EntityStatusRenaming), | ||
string(eventhubs.EntityStatusRestoring), | ||
string(eventhubs.EntityStatusSendDisabled), | ||
string(eventhubs.EntityStatusUnknown), | ||
}, false), | ||
}, |
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.
what happened when you set this property to creating or deleting? this doesn't seem likea useful property that makes sense to set? more something the service exposes?
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.
After checked, Azure portal and azure cli only exposed the Active
, Disabled
and SendDisabled
. I assume they are more useful to user. In the meanwhile, I will confirm with service team.
.
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.
@katbyte , after confirmed with service team, Active
, Disabled
and SendDisabled
are the only states that the service currently uses for Microsoft.EventHub/namespaces/eventHubs resource. So we just need to support these three values.
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 @neil-yechenwei - LGTM 🚀
This has been released in version 2.63.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.63.0"
}
# ... other configuration ... |
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. |
Currently azurerm_eventhub doesn't support to set event hub status. So I submitted this PR to implement it.
--- PASS: TestAccEventHub_standard (306.97s)
--- PASS: TestAccEventHub_basic (370.29s)
--- PASS: TestAccEventHub_requiresImport (396.79s)
--- PASS: TestAccEventHub_basicOnePartition (415.47s)
--- PASS: TestAccEventHub_eventhubStatus (426.89s)
--- PASS: TestAccEventHub_messageRetentionUpdate (433.99s)
--- PASS: TestAccEventHub_captureDescription (437.25s)
--- PASS: TestAccEventHub_partitionCountUpdate (500.02s)
--- PASS: TestAccEventHub_captureDescriptionDisabled (529.67s)
API spec:
https://github.com/Azure/azure-rest-api-specs/blob/916568aafe943c0be88e7f845d38de5f189d4b68/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2021-01-01-preview/eventhubs.json#L310