Replaces the specified properties of the specified rule. Any properties that you do not specify are unchanged.
elbv2_modify_rule(RuleArn, Conditions, Actions)
[required] The Amazon Resource Name (ARN) of the rule.
The conditions. Each rule can include zero or one of the following
conditions: http-request-method
, host-header
, path-pattern
, and
source-ip
, and zero or more of the following conditions: http-header
and query-string
.
The actions. Each rule must include exactly one of the following types
of actions: forward
, fixed-response
, or redirect
, and it must be
the last action to be performed.
If the action type is forward
, you specify one or more target groups.
The protocol of the target group must be HTTP or HTTPS for an
Application Load Balancer. The protocol of the target group must be TCP,
TLS, UDP, or TCP\_UDP for a Network Load Balancer.
[HTTPS listeners] If the action type is authenticate-oidc
, you
authenticate users through an identity provider that is OpenID Connect
(OIDC) compliant.
[HTTPS listeners] If the action type is authenticate-cognito
, you
authenticate users through the user pools supported by Amazon Cognito.
[Application Load Balancer] If the action type is redirect
, you
redirect specified client requests from one URL to another.
[Application Load Balancer] If the action type is fixed-response
,
you drop specified client requests and return a custom HTTP response.
svc$modify_rule( RuleArn = "string", Conditions = list( list( Field = "string", Values = list( "string" ), HostHeaderConfig = list( Values = list( "string" ) ), PathPatternConfig = list( Values = list( "string" ) ), HttpHeaderConfig = list( HttpHeaderName = "string", Values = list( "string" ) ), QueryStringConfig = list( Values = list( list( Key = "string", Value = "string" ) ) ), HttpRequestMethodConfig = list( Values = list( "string" ) ), SourceIpConfig = list( Values = list( "string" ) ) ) ), Actions = list( list( Type = "forward"|"authenticate-oidc"|"authenticate-cognito"|"redirect"|"fixed-response", TargetGroupArn = "string", AuthenticateOidcConfig = list( Issuer = "string", AuthorizationEndpoint = "string", TokenEndpoint = "string", UserInfoEndpoint = "string", ClientId = "string", ClientSecret = "string", SessionCookieName = "string", Scope = "string", SessionTimeout = 123, AuthenticationRequestExtraParams = list( "string" ), OnUnauthenticatedRequest = "deny"|"allow"|"authenticate", UseExistingClientSecret = TRUE|FALSE ), AuthenticateCognitoConfig = list( UserPoolArn = "string", UserPoolClientId = "string", UserPoolDomain = "string", SessionCookieName = "string", Scope = "string", SessionTimeout = 123, AuthenticationRequestExtraParams = list( "string" ), OnUnauthenticatedRequest = "deny"|"allow"|"authenticate" ), Order = 123, RedirectConfig = list( Protocol = "string", Port = "string", Host = "string", Path = "string", Query = "string", StatusCode = "HTTP_301"|"HTTP_302" ), FixedResponseConfig = list( MessageBody = "string", StatusCode = "string", ContentType = "string" ), ForwardConfig = list( TargetGroups = list( list( TargetGroupArn = "string", Weight = 123 ) ), TargetGroupStickinessConfig = list( Enabled = TRUE|FALSE, DurationSeconds = 123 ) ) ) ) )
To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.
To modify the actions for the default rule, use ModifyListener.
# NOT RUN {
# This example modifies the condition for the specified rule.
svc$modify_rule(
Conditions = list(
list(
Field = "path-pattern",
Values = list(
"/images/*"
)
)
),
RuleArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-b..."
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab