Class CfnListenerRule
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::ElasticLoadBalancingV2::ListenerRule
.
Specifies a listener rule. The listener must be associated with an Application Load Balancer. Each rule consists of a priority, one or more actions, and one or more conditions.
For more information, see Quotas for your Application Load Balancers in the User Guide for Application Load Balancers .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.elasticloadbalancingv2.*; CfnListenerRule cfnListenerRule = CfnListenerRule.Builder.create(this, "MyCfnListenerRule") .actions(List.of(ActionProperty.builder() .type("type") // the properties below are optional .authenticateCognitoConfig(AuthenticateCognitoConfigProperty.builder() .userPoolArn("userPoolArn") .userPoolClientId("userPoolClientId") .userPoolDomain("userPoolDomain") // the properties below are optional .authenticationRequestExtraParams(Map.of( "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams")) .onUnauthenticatedRequest("onUnauthenticatedRequest") .scope("scope") .sessionCookieName("sessionCookieName") .sessionTimeout(123) .build()) .authenticateOidcConfig(AuthenticateOidcConfigProperty.builder() .authorizationEndpoint("authorizationEndpoint") .clientId("clientId") .issuer("issuer") .tokenEndpoint("tokenEndpoint") .userInfoEndpoint("userInfoEndpoint") // the properties below are optional .authenticationRequestExtraParams(Map.of( "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams")) .clientSecret("clientSecret") .onUnauthenticatedRequest("onUnauthenticatedRequest") .scope("scope") .sessionCookieName("sessionCookieName") .sessionTimeout(123) .useExistingClientSecret(false) .build()) .fixedResponseConfig(FixedResponseConfigProperty.builder() .statusCode("statusCode") // the properties below are optional .contentType("contentType") .messageBody("messageBody") .build()) .forwardConfig(ForwardConfigProperty.builder() .targetGroups(List.of(TargetGroupTupleProperty.builder() .targetGroupArn("targetGroupArn") .weight(123) .build())) .targetGroupStickinessConfig(TargetGroupStickinessConfigProperty.builder() .durationSeconds(123) .enabled(false) .build()) .build()) .order(123) .redirectConfig(RedirectConfigProperty.builder() .statusCode("statusCode") // the properties below are optional .host("host") .path("path") .port("port") .protocol("protocol") .query("query") .build()) .targetGroupArn("targetGroupArn") .build())) .conditions(List.of(RuleConditionProperty.builder() .field("field") .hostHeaderConfig(HostHeaderConfigProperty.builder() .values(List.of("values")) .build()) .httpHeaderConfig(HttpHeaderConfigProperty.builder() .httpHeaderName("httpHeaderName") .values(List.of("values")) .build()) .httpRequestMethodConfig(HttpRequestMethodConfigProperty.builder() .values(List.of("values")) .build()) .pathPatternConfig(PathPatternConfigProperty.builder() .values(List.of("values")) .build()) .queryStringConfig(QueryStringConfigProperty.builder() .values(List.of(QueryStringKeyValueProperty.builder() .key("key") .value("value") .build())) .build()) .sourceIpConfig(SourceIpConfigProperty.builder() .values(List.of("values")) .build()) .values(List.of("values")) .build())) .priority(123) // the properties below are optional .listenerArn("listenerArn") .build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Specifies an action for a listener rule.static interface
Specifies information required when integrating with Amazon Cognito to authenticate users.static interface
Specifies information required using an identity provide (IdP) that is compliant with OpenID Connect (OIDC) to authenticate users.static final class
A fluent builder forCfnListenerRule
.static interface
Specifies information required when returning a custom HTTP response.static interface
Information for creating an action that distributes requests among one or more target groups.static interface
Information about a host header condition.static interface
Information about an HTTP header condition.static interface
Information about an HTTP method condition.static interface
Information about a path pattern condition.static interface
Information about a query string condition.static interface
Information about a key/value pair.static interface
Information about a redirect action.static interface
Specifies a condition for a listener rule.static interface
Information about a source IP condition.static interface
Information about the target group stickiness for a rule.static interface
Information about how traffic will be distributed between multiple target groups in a forward rule.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnListenerRule
(Construct scope, String id, CfnListenerRuleProps props) Create a newAWS::ElasticLoadBalancingV2::ListenerRule
.protected
CfnListenerRule
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnListenerRule
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe actions.Indicates whether this is the default rule.The Amazon Resource Name (ARN) of the rule.The conditions.The Amazon Resource Name (ARN) of the listener.The rule priority.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setActions
(List<Object> value) The actions.void
setActions
(IResolvable value) The actions.void
setConditions
(List<Object> value) The conditions.void
setConditions
(IResolvable value) The conditions.void
setListenerArn
(String value) The Amazon Resource Name (ARN) of the listener.void
setPriority
(Number value) The rule priority.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnListenerRule
protected CfnListenerRule(software.amazon.jsii.JsiiObjectRef objRef) -
CfnListenerRule
protected CfnListenerRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnListenerRule
@Stability(Stable) public CfnListenerRule(@NotNull Construct scope, @NotNull String id, @NotNull CfnListenerRuleProps props) Create a newAWS::ElasticLoadBalancingV2::ListenerRule
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrIsDefault
Indicates whether this is the default rule. -
getAttrRuleArn
The Amazon Resource Name (ARN) of the rule. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getActions
The actions.The rule must include exactly one of the following types of actions:
forward
,fixed-response
, orredirect
, and it must be the last action to be performed. If the rule is for an HTTPS listener, it can also optionally include an authentication action. -
setActions
The actions.The rule must include exactly one of the following types of actions:
forward
,fixed-response
, orredirect
, and it must be the last action to be performed. If the rule is for an HTTPS listener, it can also optionally include an authentication action. -
setActions
The actions.The rule must include exactly one of the following types of actions:
forward
,fixed-response
, orredirect
, and it must be the last action to be performed. If the rule is for an HTTPS listener, it can also optionally include an authentication action. -
getConditions
The conditions.The rule can optionally include up to one of each of the following conditions:
http-request-method
,host-header
,path-pattern
, andsource-ip
. A rule can also optionally include one or more of each of the following conditions:http-header
andquery-string
. -
setConditions
The conditions.The rule can optionally include up to one of each of the following conditions:
http-request-method
,host-header
,path-pattern
, andsource-ip
. A rule can also optionally include one or more of each of the following conditions:http-header
andquery-string
. -
setConditions
The conditions.The rule can optionally include up to one of each of the following conditions:
http-request-method
,host-header
,path-pattern
, andsource-ip
. A rule can also optionally include one or more of each of the following conditions:http-header
andquery-string
. -
getPriority
The rule priority. A listener can't have multiple rules with the same priority.If you try to reorder rules by updating their priorities, do not specify a new priority if an existing rule already uses this priority, as this can cause an error. If you need to reuse a priority with a different rule, you must remove it as a priority first, and then specify it in a subsequent update.
-
setPriority
The rule priority. A listener can't have multiple rules with the same priority.If you try to reorder rules by updating their priorities, do not specify a new priority if an existing rule already uses this priority, as this can cause an error. If you need to reuse a priority with a different rule, you must remove it as a priority first, and then specify it in a subsequent update.
-
getListenerArn
The Amazon Resource Name (ARN) of the listener. -
setListenerArn
The Amazon Resource Name (ARN) of the listener.
-