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

azurerm_application_gateway - Add support for probe.properties.port #8278

Merged
merged 1 commit into from
Aug 28, 2020
Merged

azurerm_application_gateway - Add support for probe.properties.port #8278

merged 1 commit into from
Aug 28, 2020

Conversation

simnyc
Copy link
Contributor

@simnyc simnyc commented Aug 28, 2020

Fixes #7557.

  • add support for the property
  • create an acceptance test
  • add an entry in the documentation

From Azure API doc:

Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, port from http settings will be used.

@ghost ghost added the size/M label Aug 28, 2020
@simnyc
Copy link
Contributor Author

simnyc commented Aug 28, 2020

I'm still having some issues with the acceptance test:

The AG is created properly with the port set to 8082:

terraform-provider-azurerm git:(simon/app-gw-probe-port) ✗ make acctests SERVICE='network' TESTARGS='-run=TestAccAzureRMApplicationGateway_probesWithPort' TESTTIMEOUT='60m'
...
CREATE: azurerm_application_gateway.test
...
  name:                                                        "" => "acctestag-200827185432169246"
  probe.#:                                                     "" => "1"
  probe.0.host:                                                "" => "azure.com"
  probe.0.id:                                                  "" => "<computed>"
  probe.0.interval:                                            "" => "300"
  probe.0.match:                                               "" => "<computed>"
  probe.0.minimum_servers:                                     "" => "0"
  probe.0.name:                                                "" => "acctest-vnet-200827185432169246-probe1"
  probe.0.path:                                                "" => "/test"
  probe.0.pick_host_name_from_backend_http_settings:           "" => "false"
  probe.0.port:                                                "" => "8082"

I can confirm that the port is set properly using the CLI or the Portal:

az network application-gateway show --name acctestag-200827185432169246 -g acctestRG-200827185432169246
...
  "probes": [
    {
...
      "name": "acctest-vnet-200827185432169246-probe1",
      "path": "/test",
      "pickHostNameFromBackendHttpSettings": false,
      "port": 8082,
      "protocol": "Http",
      "provisioningState": "Updating",
      "resourceGroup": "acctestRG-200827185432169246",
      "timeout": 120,
      "type": "Microsoft.Network/applicationGateways/probes",
      "unhealthyThreshold": 8
    }

But later on the test ignores the value:

2020/08/27 18:59:02 [WARN] Provider "azurerm" produced an unexpected new value for azurerm_application_gateway.test, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .enable_http2: was null, but now cty.False
      - .probe[0].port: was cty.NumberIntVal(8082), but now cty.NumberIntVal(0)
      - .backend_http_settings[0].host_name: was null, but now cty.StringVal("")
      - .backend_http_settings[0].affinity_cookie_name: was null, but now cty.StringVal("")
      - .backend_http_settings[0].path: was null, but now cty.StringVal("")
      - .http_listener[0].ssl_certificate_name: was null, but now cty.StringVal("")
      - .http_listener[0].host_name: was null, but now cty.StringVal("")
      - .http_listener[0].require_sni: was null, but now cty.False
      - .http_listener[0].firewall_policy_id: was null, but now cty.StringVal("")
    TestAccAzureRMApplicationGateway_probesWithPort: testing.go:684: Step 0 error: Check failed: Check 2/2 error: azurerm_application_gateway.test: Attribute 'probe.0.port' expected "8082", got "0"

Not sure what's going on here, would appreciate some help.

Copy link
Member

@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 @simnyc

Thanks for this PR :)

Taking a look through this mostly LGTM - if we can fix up the comments then this otherwise LGTM 👍

Thanks!

Copy link
Member

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

LGTM - thanks for pushing those changes @simnyc

@simnyc
Copy link
Contributor Author

simnyc commented Aug 28, 2020

Hey @tombuildsstuff , what's the process now, do you need anything else from me? When can we expect it to be released?
Thanks

@ghost ghost removed the waiting-response label Aug 28, 2020
@tombuildsstuff
Copy link
Member

@simnyc just waiting for the acctests to pass, we should be good once they're done :)

* add support for the property
* create an acceptance test
* add an entry in the documentation

From Azure API doc:

> Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, port from http settings will be used.
@tombuildsstuff tombuildsstuff added this to the v2.26.0 milestone Aug 28, 2020
@simnyc
Copy link
Contributor Author

simnyc commented Aug 28, 2020

Not sure what's going on with the CI but the test is finally passing in my subscription:

 make acctests SERVICE='network' TESTARGS='-run=TestAccAzureRMApplicationGateway_probesWithPort' TESTTIMEOUT='60m'
--- PASS: TestAccAzureRMApplicationGateway_probesWithPort (772.44s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/tests	773.665s

Thanks for the help @tombuildsstuff !

@mbfrahry mbfrahry changed the title Add support for probe.properties.port azurerm_application_gateway - Add support for probe.properties.port Aug 28, 2020
@mbfrahry mbfrahry merged commit 86cf281 into hashicorp:master Aug 28, 2020
mbfrahry added a commit that referenced this pull request Aug 28, 2020
@ghost
Copy link

ghost commented Sep 4, 2020

This has been released in version 2.26.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.26.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Sep 28, 2020

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 28, 2020
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.

Application Gateway, Health Probe does not support custom port.
3 participants