Skip to content
v2.278.0

ActionProperty Struct ​

Specifies an action for a listener rule.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';
const actionProperty: elbv2.CfnListenerRule.ActionProperty = {
  type: 'type',

  // the properties below are optional
  authenticateCognitoConfig: {
    userPoolArn: 'userPoolArn',
    userPoolClientId: 'userPoolClientId',
    userPoolDomain: 'userPoolDomain',

    // the properties below are optional
    authenticationRequestExtraParams: {
      authenticationRequestExtraParamsKey: 'authenticationRequestExtraParams',
    },
    onUnauthenticatedRequest: 'onUnauthenticatedRequest',
    scope: 'scope',
    sessionCookieName: 'sessionCookieName',
    sessionTimeout: 123,
  },
  authenticateOidcConfig: {
    authorizationEndpoint: 'authorizationEndpoint',
    clientId: 'clientId',
    issuer: 'issuer',
    tokenEndpoint: 'tokenEndpoint',
    userInfoEndpoint: 'userInfoEndpoint',

    // the properties below are optional
    authenticationRequestExtraParams: {
      authenticationRequestExtraParamsKey: 'authenticationRequestExtraParams',
    },
    clientSecret: 'clientSecret',
    onUnauthenticatedRequest: 'onUnauthenticatedRequest',
    scope: 'scope',
    sessionCookieName: 'sessionCookieName',
    sessionTimeout: 123,
    useExistingClientSecret: false,
  },
  fixedResponseConfig: {
    statusCode: 'statusCode',

    // the properties below are optional
    contentType: 'contentType',
    messageBody: 'messageBody',
  },
  forwardConfig: {
    targetGroups: [{
      targetGroupArn: 'targetGroupArn',
      weight: 123,
    }],
    targetGroupStickinessConfig: {
      durationSeconds: 123,
      enabled: false,
    },
  },
  jwtValidationConfig: {
    issuer: 'issuer',
    jwksEndpoint: 'jwksEndpoint',

    // the properties below are optional
    additionalClaims: [{
      format: 'format',
      name: 'name',
      values: ['values'],
    }],
  },
  order: 123,
  redirectConfig: {
    statusCode: 'statusCode',

    // the properties below are optional
    host: 'host',
    path: 'path',
    port: 'port',
    protocol: 'protocol',
    query: 'query',
  },
  targetGroupArn: 'targetGroupArn',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_elasticloadbalancingv2 as elbv2

action_property = elbv2.CfnListenerRule.ActionProperty(
    type="type",

    # the properties below are optional
    authenticate_cognito_config=elbv2.CfnListenerRule.AuthenticateCognitoConfigProperty(
        user_pool_arn="userPoolArn",
        user_pool_client_id="userPoolClientId",
        user_pool_domain="userPoolDomain",

        # the properties below are optional
        authentication_request_extra_params={
            "authentication_request_extra_params_key": "authenticationRequestExtraParams"
        },
        on_unauthenticated_request="onUnauthenticatedRequest",
        scope="scope",
        session_cookie_name="sessionCookieName",
        session_timeout=123
    ),
    authenticate_oidc_config=elbv2.CfnListenerRule.AuthenticateOidcConfigProperty(
        authorization_endpoint="authorizationEndpoint",
        client_id="clientId",
        issuer="issuer",
        token_endpoint="tokenEndpoint",
        user_info_endpoint="userInfoEndpoint",

        # the properties below are optional
        authentication_request_extra_params={
            "authentication_request_extra_params_key": "authenticationRequestExtraParams"
        },
        client_secret="clientSecret",
        on_unauthenticated_request="onUnauthenticatedRequest",
        scope="scope",
        session_cookie_name="sessionCookieName",
        session_timeout=123,
        use_existing_client_secret=False
    ),
    fixed_response_config=elbv2.CfnListenerRule.FixedResponseConfigProperty(
        status_code="statusCode",

        # the properties below are optional
        content_type="contentType",
        message_body="messageBody"
    ),
    forward_config=elbv2.CfnListenerRule.ForwardConfigProperty(
        target_groups=[elbv2.CfnListenerRule.TargetGroupTupleProperty(
            target_group_arn="targetGroupArn",
            weight=123
        )],
        target_group_stickiness_config=elbv2.CfnListenerRule.TargetGroupStickinessConfigProperty(
            duration_seconds=123,
            enabled=False
        )
    ),
    jwt_validation_config=elbv2.CfnListenerRule.JwtValidationConfigProperty(
        issuer="issuer",
        jwks_endpoint="jwksEndpoint",

        # the properties below are optional
        additional_claims=[elbv2.CfnListenerRule.JwtValidationActionAdditionalClaimProperty(
            format="format",
            name="name",
            values=["values"]
        )]
    ),
    order=123,
    redirect_config=elbv2.CfnListenerRule.RedirectConfigProperty(
        status_code="statusCode",

        # the properties below are optional
        host="host",
        path="path",
        port="port",
        protocol="protocol",
        query="query"
    ),
    target_group_arn="targetGroupArn"
)
java
// 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.*;

ActionProperty actionProperty = 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())
        .jwtValidationConfig(JwtValidationConfigProperty.builder()
                .issuer("issuer")
                .jwksEndpoint("jwksEndpoint")

                // the properties below are optional
                .additionalClaims(List.of(JwtValidationActionAdditionalClaimProperty.builder()
                        .format("format")
                        .name("name")
                        .values(List.of("values"))
                        .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();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElasticLoadBalancingV2;

var actionProperty = new ActionProperty {
    Type = "type",

    // the properties below are optional
    AuthenticateCognitoConfig = new AuthenticateCognitoConfigProperty {
        UserPoolArn = "userPoolArn",
        UserPoolClientId = "userPoolClientId",
        UserPoolDomain = "userPoolDomain",

        // the properties below are optional
        AuthenticationRequestExtraParams = new Dictionary<string, string> {
            { "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams" }
        },
        OnUnauthenticatedRequest = "onUnauthenticatedRequest",
        Scope = "scope",
        SessionCookieName = "sessionCookieName",
        SessionTimeout = 123
    },
    AuthenticateOidcConfig = new AuthenticateOidcConfigProperty {
        AuthorizationEndpoint = "authorizationEndpoint",
        ClientId = "clientId",
        Issuer = "issuer",
        TokenEndpoint = "tokenEndpoint",
        UserInfoEndpoint = "userInfoEndpoint",

        // the properties below are optional
        AuthenticationRequestExtraParams = new Dictionary<string, string> {
            { "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams" }
        },
        ClientSecret = "clientSecret",
        OnUnauthenticatedRequest = "onUnauthenticatedRequest",
        Scope = "scope",
        SessionCookieName = "sessionCookieName",
        SessionTimeout = 123,
        UseExistingClientSecret = false
    },
    FixedResponseConfig = new FixedResponseConfigProperty {
        StatusCode = "statusCode",

        // the properties below are optional
        ContentType = "contentType",
        MessageBody = "messageBody"
    },
    ForwardConfig = new ForwardConfigProperty {
        TargetGroups = new [] { new TargetGroupTupleProperty {
            TargetGroupArn = "targetGroupArn",
            Weight = 123
        } },
        TargetGroupStickinessConfig = new TargetGroupStickinessConfigProperty {
            DurationSeconds = 123,
            Enabled = false
        }
    },
    JwtValidationConfig = new JwtValidationConfigProperty {
        Issuer = "issuer",
        JwksEndpoint = "jwksEndpoint",

        // the properties below are optional
        AdditionalClaims = new [] { new JwtValidationActionAdditionalClaimProperty {
            Format = "format",
            Name = "name",
            Values = new [] { "values" }
        } }
    },
    Order = 123,
    RedirectConfig = new RedirectConfigProperty {
        StatusCode = "statusCode",

        // the properties below are optional
        Host = "host",
        Path = "path",
        Port = "port",
        Protocol = "protocol",
        Query = "query"
    },
    TargetGroupArn = "targetGroupArn"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

actionProperty := &ActionProperty{
	Type: jsii.String("type"),

	// the properties below are optional
	AuthenticateCognitoConfig: &AuthenticateCognitoConfigProperty{
		UserPoolArn: jsii.String("userPoolArn"),
		UserPoolClientId: jsii.String("userPoolClientId"),
		UserPoolDomain: jsii.String("userPoolDomain"),

		// the properties below are optional
		AuthenticationRequestExtraParams: map[string]*string{
			"authenticationRequestExtraParamsKey": jsii.String("authenticationRequestExtraParams"),
		},
		OnUnauthenticatedRequest: jsii.String("onUnauthenticatedRequest"),
		Scope: jsii.String("scope"),
		SessionCookieName: jsii.String("sessionCookieName"),
		SessionTimeout: jsii.Number(123),
	},
	AuthenticateOidcConfig: &AuthenticateOidcConfigProperty{
		AuthorizationEndpoint: jsii.String("authorizationEndpoint"),
		ClientId: jsii.String("clientId"),
		Issuer: jsii.String("issuer"),
		TokenEndpoint: jsii.String("tokenEndpoint"),
		UserInfoEndpoint: jsii.String("userInfoEndpoint"),

		// the properties below are optional
		AuthenticationRequestExtraParams: map[string]*string{
			"authenticationRequestExtraParamsKey": jsii.String("authenticationRequestExtraParams"),
		},
		ClientSecret: jsii.String("clientSecret"),
		OnUnauthenticatedRequest: jsii.String("onUnauthenticatedRequest"),
		Scope: jsii.String("scope"),
		SessionCookieName: jsii.String("sessionCookieName"),
		SessionTimeout: jsii.Number(123),
		UseExistingClientSecret: jsii.Boolean(false),
	},
	FixedResponseConfig: &FixedResponseConfigProperty{
		StatusCode: jsii.String("statusCode"),

		// the properties below are optional
		ContentType: jsii.String("contentType"),
		MessageBody: jsii.String("messageBody"),
	},
	ForwardConfig: &ForwardConfigProperty{
		TargetGroups: []interface{}{
			&TargetGroupTupleProperty{
				TargetGroupArn: jsii.String("targetGroupArn"),
				Weight: jsii.Number(123),
			},
		},
		TargetGroupStickinessConfig: &TargetGroupStickinessConfigProperty{
			DurationSeconds: jsii.Number(123),
			Enabled: jsii.Boolean(false),
		},
	},
	JwtValidationConfig: &JwtValidationConfigProperty{
		Issuer: jsii.String("issuer"),
		JwksEndpoint: jsii.String("jwksEndpoint"),

		// the properties below are optional
		AdditionalClaims: []interface{}{
			&JwtValidationActionAdditionalClaimProperty{
				Format: jsii.String("format"),
				Name: jsii.String("name"),
				Values: []*string{
					jsii.String("values"),
				},
			},
		},
	},
	Order: jsii.Number(123),
	RedirectConfig: &RedirectConfigProperty{
		StatusCode: jsii.String("statusCode"),

		// the properties below are optional
		Host: jsii.String("host"),
		Path: jsii.String("path"),
		Port: jsii.String("port"),
		Protocol: jsii.String("protocol"),
		Query: jsii.String("query"),
	},
	TargetGroupArn: jsii.String("targetGroupArn"),
}

Properties ​

authenticateCognitoConfigoptionalIResolvable | CfnListenerRule.AuthenticateCognitoConfigPropertyauthenticate_cognito_configoptionaltyping.Union[IResolvable, AuthenticateCognitoConfigProperty]authenticateCognitoConfigoptionalIResolvableAuthenticateCognitoConfigoptionalIResolvableAuthenticateCognitoConfigoptionalinterface{} #
[HTTPS listeners] Information for using Amazon Cognito to authenticate users.

Specify only when Type is authenticate-cognito .

authenticateOidcConfigoptionalIResolvable | CfnListenerRule.AuthenticateOidcConfigPropertyauthenticate_oidc_configoptionaltyping.Union[IResolvable, AuthenticateOidcConfigProperty]authenticateOidcConfigoptionalIResolvableAuthenticateOidcConfigoptionalIResolvableAuthenticateOidcConfigoptionalinterface{} #
[HTTPS listeners] Information about an identity provider that is compliant with OpenID Connect (OIDC).

Specify only when Type is authenticate-oidc .

fixedResponseConfigoptionalIResolvable | CfnListenerRule.FixedResponseConfigPropertyfixed_response_configoptionaltyping.Union[IResolvable, FixedResponseConfigProperty]fixedResponseConfigoptionalIResolvableFixedResponseConfigoptionalIResolvableFixedResponseConfigoptionalinterface{} #
[Application Load Balancer] Information for creating an action that returns a custom HTTP response.

Specify only when Type is fixed-response .

forwardConfigoptionalIResolvable | CfnListenerRule.ForwardConfigPropertyforward_configoptionaltyping.Union[IResolvable, ForwardConfigProperty]forwardConfigoptionalIResolvableForwardConfigoptionalIResolvableForwardConfigoptionalinterface{} #
Information for creating an action that distributes requests among multiple target groups. Specify only when `Type` is `forward` .

If you specify both ForwardConfig and TargetGroupArn , you can specify only one target group using ForwardConfig and it must be the same target group specified in TargetGroupArn .

jwtValidationConfigoptionalIResolvable | CfnListenerRule.JwtValidationConfigPropertyjwt_validation_configoptionaltyping.Union[IResolvable, JwtValidationConfigProperty]jwtValidationConfigoptionalIResolvableJwtValidationConfigoptionalIResolvableJwtValidationConfigoptionalinterface{} #
[HTTPS listeners] Information for validating JWT access tokens in client requests.

Specify only when Type is jwt-validation .

orderoptionalnumberorderoptionalint | floatorderoptionalNumberOrderoptionaldoubleOrderoptional*float64 #
The order for the action.

This value is required for rules with multiple actions. The action with the lowest value for order is performed first.

redirectConfigoptionalIResolvable | CfnListenerRule.RedirectConfigPropertyredirect_configoptionaltyping.Union[IResolvable, RedirectConfigProperty]redirectConfigoptionalIResolvableRedirectConfigoptionalIResolvableRedirectConfigoptionalinterface{} #
[Application Load Balancer] Information for creating a redirect action.

Specify only when Type is redirect .

targetGroupArnoptionalstringtarget_group_arnoptionalstrtargetGroupArnoptionalStringTargetGroupArnoptionalstringTargetGroupArnoptional*string #
The Amazon Resource Name (ARN) of the target group.

Specify only when Type is forward and you want to route to a single target group. To route to multiple target groups, you must use ForwardConfig instead.

typestringtypestrtypeStringTypestringType*string required #
The type of action.