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: can combine include_path with target_url #6175

Merged
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 @@ -3044,6 +3044,7 @@ func expandApplicationGatewayRedirectConfigurations(d *schema.ResourceData, gate
ApplicationGatewayRedirectConfigurationPropertiesFormat: &network.ApplicationGatewayRedirectConfigurationPropertiesFormat{
RedirectType: network.ApplicationGatewayRedirectType(redirectType),
IncludeQueryString: utils.Bool(includeQueryString),
IncludePath: utils.Bool(includePath),
},
}

Expand All @@ -3055,16 +3056,11 @@ func expandApplicationGatewayRedirectConfigurations(d *schema.ResourceData, gate
return nil, fmt.Errorf("Conflict between `target_listener_name` and `target_url` (redirection is either to URL or target listener)")
}

if targetUrl != "" && includePath {
return nil, fmt.Errorf("`include_path` is not a valid option when `target_url` is set")
}

if targetListenerName != "" {
targetListenerID := fmt.Sprintf("%s/httpListeners/%s", gatewayID, targetListenerName)
output.ApplicationGatewayRedirectConfigurationPropertiesFormat.TargetListener = &network.SubResource{
ID: utils.String(targetListenerID),
}
output.ApplicationGatewayRedirectConfigurationPropertiesFormat.IncludePath = utils.Bool(includePath)
}

if targetUrl != "" {
Expand Down