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

Add support for status property of azurerm_eventhub #12043

Merged
merged 7 commits into from
Jun 10, 2021

Conversation

neil-yechenwei
Copy link
Contributor

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

@ghost ghost added size/M labels Jun 3, 2021
Copy link
Member

@mbfrahry mbfrahry left a 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!

azurerm/internal/services/eventhub/eventhub_resource.go Outdated Show resolved Hide resolved
Comment on lines 147 to 162
"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),
},
Copy link
Collaborator

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?

Copy link
Contributor Author

@neil-yechenwei neil-yechenwei Jun 4, 2021

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.
image.

Copy link
Contributor Author

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.

neil-yechenwei added 2 commits June 4, 2021 08:19
@neil-yechenwei
Copy link
Contributor Author

@katbyte @mbfrahry , thanks for your comments. I've updated code. Please have an another look. Thanks.

@katbyte katbyte added this to the v2.63.0 milestone Jun 10, 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 @neil-yechenwei - LGTM 🚀

@katbyte katbyte merged commit c5589b6 into hashicorp:master Jun 10, 2021
katbyte added a commit that referenced this pull request Jun 10, 2021
@ghost
Copy link

ghost commented Jun 11, 2021

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 ...

@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 Jul 12, 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.

3 participants