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

deprecate(is-lb-listener-redirect): Deprecate lb listener https redirect flattened structure #5140

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
37 changes: 0 additions & 37 deletions ibm/flex/structures.go
Original file line number Diff line number Diff line change
Expand Up @@ -2714,43 +2714,6 @@ func ResourceValidateAccessTags(diff *schema.ResourceDiff, meta interface{}) err
return nil
}

func ResourceLBListenerPolicyCustomizeDiff(diff *schema.ResourceDiff) error {
policyActionIntf, _ := diff.GetOk(isLBListenerPolicyAction)
policyAction := policyActionIntf.(string)

if policyAction == "forward" {
_, policyTargetIDSet := diff.GetOk(isLBListenerPolicyTargetID)

if !policyTargetIDSet && diff.NewValueKnown(isLBListenerPolicyTargetID) {
return fmt.Errorf("Load balancer listener policy: When action is forward please specify target_id")
}
} else if policyAction == "redirect" {
_, httpsStatusCodeSet := diff.GetOk(isLBListenerPolicyTargetHTTPStatusCode)
_, targetURLSet := diff.GetOk(isLBListenerPolicyTargetURL)

if !httpsStatusCodeSet && diff.NewValueKnown(isLBListenerPolicyTargetHTTPStatusCode) {
return fmt.Errorf("Load balancer listener policy: When action is redirect please specify target_http_status_code")
}

if !targetURLSet && diff.NewValueKnown(isLBListenerPolicyTargetURL) {
return fmt.Errorf("Load balancer listener policy: When action is redirect please specify target_url")
}
} else if policyAction == "https_redirect" {
_, listenerSet := diff.GetOk(isLBListenerPolicyHTTPSRedirectListener)
_, httpsStatusSet := diff.GetOk(isLBListenerPolicyHTTPSRedirectStatusCode)

if !listenerSet && diff.NewValueKnown(isLBListenerPolicyHTTPSRedirectListener) {
return fmt.Errorf("Load balancer listener policy: When action is https_redirect please specify target_https_redirect_listener")
}

if !httpsStatusSet && diff.NewValueKnown(isLBListenerPolicyHTTPSRedirectStatusCode) {
return fmt.Errorf("When action is https_redirect please specify target_https_redirect_status_code")
}
}

return nil
}

func ResourceIBMISLBPoolCookieValidate(diff *schema.ResourceDiff) error {
_, sessionPersistenceTypeIntf := diff.GetChange(isLBPoolSessPersistenceType)
_, sessionPersistenceCookieNameIntf := diff.GetChange(isLBPoolSessPersistenceAppCookieName)
Expand Down
Loading
Loading