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: event_grid_domain #2884

Merged
merged 3 commits into from
Feb 19, 2019
Merged

New Resource: event_grid_domain #2884

merged 3 commits into from
Feb 19, 2019

Conversation

mbfrahry
Copy link
Member

This PR adds the EventGrid Domain resource to the azure provider.

--- PASS: TestAccAzureRMEventGridDomain_basicWithTags (142.37s)
--- PASS: TestAccAzureRMEventGridDomain_basic (152.01s)
--- PASS: TestAccAzureRMEventGridDomain_mapping (152.39s)

@mbfrahry mbfrahry requested a review from a team February 13, 2019 05:35
@tombuildsstuff tombuildsstuff added this to the 1.23.0 milestone Feb 13, 2019
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 @mbfrahry aside from a couple small nits 👍

azurerm/resource_arm_eventgrid_domain_test.go Show resolved Hide resolved
azurerm/resource_arm_eventgrid_domain_test.go Outdated Show resolved Hide resolved
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 @mbfrahry

I've taken a look through and left some minor comments in line but this is otherwise looking good to me; if we can fix up the minor comments this should be good to go 👍

Thanks!

string(eventgrid.InputSchemaCloudEventV01Schema),
string(eventgrid.InputSchemaCustomEventSchema),
string(eventgrid.InputSchemaEventGridSchema),
}, true),
Copy link
Contributor

Choose a reason for hiding this comment

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

could we make this case-sensitive?

Suggested change
}, true),
}, false),

}

if err = future.WaitForCompletionRef(ctx, client.Client); err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

could we wrap this error to make this easier to debug when it happens:

Suggested change
return err
return fmt.Errorf("Error waiting for EventGrid Domain %q (Resource Group %q) to become available: %s", name, resourceGroup, err)


future, err := client.CreateOrUpdate(ctx, resourceGroup, name, domain)
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

could we wrap this error to make this easier to debug when it happens:

Suggested change
return err
return fmt.Errorf("Error creating/updating EventGrid Domain %q (Resource Group %q): %s", name, resourceGroup, err)


read, err := client.Get(ctx, resourceGroup, name)
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

could we wrap this error to make this easier to debug when it happens:

Suggested change
return err
return fmt.Errorf("Error retrieving EventGrid Domain %q (Resource Group %q): %s", name, resourceGroup, err)

resp, err := client.Get(ctx, resourceGroup, name)
if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
log.Printf("[WARN] EventGrid Domain '%s' was not found (resource group '%s')", name, resourceGroup)
Copy link
Contributor

Choose a reason for hiding this comment

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

minor we can use %q rather than '%s'

Suggested change
log.Printf("[WARN] EventGrid Domain '%s' was not found (resource group '%s')", name, resourceGroup)
log.Printf("[WARN] EventGrid Domain %q was not found (Resource Group %q)", name, resourceGroup)


`input_mapping_fields` supports the following:

* `id` - (Optional) Specifies the id of the EventGrid Event to associate with the domain
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `id` - (Optional) Specifies the id of the EventGrid Event to associate with the domain
* `id` - (Optional) Specifies the id of the EventGrid Event to associate with the domain. Changing this forces a new resource to be created.


`input_mapping_default_values` supports the following:

* `event_type` - (Optional) Specifies the default event type of the EventGrid Event to associate with the domain
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `event_type` - (Optional) Specifies the default event type of the EventGrid Event to associate with the domain
* `event_type` - (Optional) Specifies the default event type of the EventGrid Event to associate with the domain. Changing this forces a new resource to be created.


* `event_type` - (Optional) Specifies the default event type of the EventGrid Event to associate with the domain

* `data_version` - (Optional) Specifies the default data version of the EventGrid Event to associate with the domain
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `data_version` - (Optional) Specifies the default data version of the EventGrid Event to associate with the domain
* `data_version` - (Optional) Specifies the default data version of the EventGrid Event to associate with the domain. Changing this forces a new resource to be created.


* `data_version` - (Optional) Specifies the default data version of the EventGrid Event to associate with the domain

* `subject` - (Optional) Specifies the default subject of the EventGrid Event to associate with the domain
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `subject` - (Optional) Specifies the default subject of the EventGrid Event to associate with the domain
* `subject` - (Optional) Specifies the default subject of the EventGrid Event to associate with the domain. Changing this forces a new resource to be created.


The following attributes are exported:

* `id` - The EventGrid Domain ID.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this'd be clearer as:

Suggested change
* `id` - The EventGrid Domain ID.
* `id` - The ID of the EventGrid Domain.

@mbfrahry
Copy link
Member Author

Addressed!

@katbyte katbyte merged commit de2a57b into master Feb 19, 2019
@katbyte katbyte deleted the f-eventgrid-domain branch February 19, 2019 06:35
katbyte added a commit that referenced this pull request Feb 19, 2019
@ghost
Copy link

ghost commented Mar 8, 2019

This has been released in version 1.23.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 = "~> 1.23.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 21, 2019

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 and limited conversation to collaborators Mar 21, 2019
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