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 azurerm_express_route_circuit_connection #11303

Merged
merged 31 commits into from
Jun 30, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ func resourceExpressRouteCircuitConnectionRead(d *pluginsdk.ResourceData, meta i
if props := resp.ExpressRouteCircuitConnectionPropertiesFormat; props != nil {
d.Set("address_prefix_ipv4", props.AddressPrefix)

// The ExpressRoute Circuit Connection API returns "*****************" for AuthorizationKey when it's changed from a valid value to `nil`
// See more details from https://github.com/Azure/azure-rest-api-specs/issues/15030
authorizationKey := ""
if props.AuthorizationKey != nil {
if props.AuthorizationKey != nil && *props.AuthorizationKey != "*****************" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we ignore those invalid value to be specified at the first place?

Copy link
Contributor

@neil-yechenwei neil-yechenwei Jun 30, 2021

Choose a reason for hiding this comment

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

We cannot ignore it at the beginning. Because "*****************" is returned only when authorizationKey is changed from "xxxxx" to nil.

Scenario 1:
when authorizationKey isn't specified in tf, api returns nil

Scenario 2:
When authorizationKey is specified in tf, api returns "xxxxx"

Scenario 3:
When authorizationKey is changed from "xxxx" to nil in tf, api returns "*****************"

authorizationKey = *props.AuthorizationKey
}
d.Set("authorization_key", authorizationKey)
Expand Down