-
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 option in IoTHub to Enable Fallback Route #2764
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.
Hi @BlueBasher,
Thank you for the PR, don't worry about the commits I'll squash on merge 🙂 the main things this PR needs is a test and updating the documentation with the new property.
I also question if we shouldn't be exposing the other properties here with those values as defaults? WDYU
Hi @katbyte, |
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.
Hi @BlueBasher,
Thanks for the updates, i've gone over it once more, most of the comments are pretty minor with the main blocker being the missing nil check.
@katbyte, @BlueBasher Hi, I am very interested in this PR, will this be included in 1.23.0? Do you need any help with moving it forward? |
Hi @maxbog, @BlueBasher, I am hoping to have it included in 1.23, right now the only thing holding it up is the tests don't pass: multiple:
|
As well as:
Looks like the API may have changed 🤔 |
I hope you don't mind but i pushed an update to fix the non-empty plan failure. Opted to ignore the default fallback route, another option would be to mark those properties as computed but i'm not sure it makes sense. WDYT? |
@katbyte Do we need anymore change now? Or does this also fix the AccTest? |
I spent some more time trying to figure out why it was 400'ing: updated the API and removed name (it doesn't seem to actually do anything if you set it?) and did a create then update that finally got rid of the 400. However now it doesn't seem to be actually setting enabled to true so i am going to push what i have for now and pick this up later in the week. |
azurerm/resource_arm_iothub.go
Outdated
@@ -313,6 +362,11 @@ func resourceArmIotHubCreateUpdate(d *schema.ResourceData, meta interface{}) err | |||
Tags: expandTags(tags), | |||
} | |||
|
|||
if !d.IsNewResource() { |
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.
I don't really see the point of this diff.
When I removed it and set the Properties.Routing.FallbackRoute
property to fallbackRoute
in the line above, fallback routes started working
@katbyte, @BlueBasher I made some minor modifications to make the code work, please look at my comments |
azurerm/resource_arm_iothub_test.go
Outdated
|
||
fallback_route { | ||
source = "DeviceMessages" | ||
endpoint_names = ["fallback"] |
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.
For the test to pass, this is needed
endpoint_names = ["fallback"] | |
endpoint_names = ["events"] |
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.
Well that was it! thanks
Thank you very much for pointing us in the right direction @maxbog! tests pass and this LGTM now. Will merge it shortly @BlueBasher |
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 ... |
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! |
Added the option to specify if the IoTHub fallback route should be enabled or not.
It defaults to enabled since the Azure Portal, CLI or ARM all default to true. This is a change in the behaviour of Terraform since Terraform used to default to disabled.
See also issue #2719
PS. apologies for the multiple commits, first time Go developer and couldn't get the build to run locally.