Elastic Load Balancing

2025/11/13 - Elastic Load Balancing - 9 updated api methods

Changes  QUIC and TCP_QUIC protocol support for Network Load Balancer (NLB). This capability enables customers to forward QUIC traffic to their targets with ultra-low latency while maintaining session stickiness using QUIC Connection IDs.

CreateListener (updated) Link ¶
Changes (request, response)
Request
{'Protocol': {'QUIC', 'TCP_QUIC'}}
Response
{'Listeners': {'Protocol': {'QUIC', 'TCP_QUIC'}}}

Creates a listener for the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.

For more information, see the following:

This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple listeners with the same settings, each call succeeds.

See also: AWS API Documentation

Request Syntax

client.create_listener(
    LoadBalancerArn='string',
    Protocol='HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
    Port=123,
    SslPolicy='string',
    Certificates=[
        {
            'CertificateArn': 'string',
            'IsDefault': True|False
        },
    ],
    DefaultActions=[
        {
            'Type': 'forward'|'authenticate-oidc'|'authenticate-cognito'|'redirect'|'fixed-response'|'jwt-validation',
            'TargetGroupArn': 'string',
            'AuthenticateOidcConfig': {
                'Issuer': 'string',
                'AuthorizationEndpoint': 'string',
                'TokenEndpoint': 'string',
                'UserInfoEndpoint': 'string',
                'ClientId': 'string',
                'ClientSecret': 'string',
                'SessionCookieName': 'string',
                'Scope': 'string',
                'SessionTimeout': 123,
                'AuthenticationRequestExtraParams': {
                    'string': 'string'
                },
                'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate',
                'UseExistingClientSecret': True|False
            },
            'AuthenticateCognitoConfig': {
                'UserPoolArn': 'string',
                'UserPoolClientId': 'string',
                'UserPoolDomain': 'string',
                'SessionCookieName': 'string',
                'Scope': 'string',
                'SessionTimeout': 123,
                'AuthenticationRequestExtraParams': {
                    'string': 'string'
                },
                'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate'
            },
            'Order': 123,
            'RedirectConfig': {
                'Protocol': 'string',
                'Port': 'string',
                'Host': 'string',
                'Path': 'string',
                'Query': 'string',
                'StatusCode': 'HTTP_301'|'HTTP_302'
            },
            'FixedResponseConfig': {
                'MessageBody': 'string',
                'StatusCode': 'string',
                'ContentType': 'string'
            },
            'ForwardConfig': {
                'TargetGroups': [
                    {
                        'TargetGroupArn': 'string',
                        'Weight': 123
                    },
                ],
                'TargetGroupStickinessConfig': {
                    'Enabled': True|False,
                    'DurationSeconds': 123
                }
            },
            'JwtValidationConfig': {
                'JwksEndpoint': 'string',
                'Issuer': 'string',
                'AdditionalClaims': [
                    {
                        'Format': 'single-string'|'string-array'|'space-separated-values',
                        'Name': 'string',
                        'Values': [
                            'string',
                        ]
                    },
                ]
            }
        },
    ],
    AlpnPolicy=[
        'string',
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    MutualAuthentication={
        'Mode': 'string',
        'TrustStoreArn': 'string',
        'IgnoreClientCertificateExpiry': True|False,
        'TrustStoreAssociationStatus': 'active'|'removed',
        'AdvertiseTrustStoreCaNames': 'on'|'off'
    }
)
type LoadBalancerArn:

string

param LoadBalancerArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the load balancer.

type Protocol:

string

param Protocol:

The protocol for connections from clients to the load balancer. For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You can't specify a protocol for a Gateway Load Balancer.

type Port:

integer

param Port:

The port on which the load balancer is listening. You can't specify a port for a Gateway Load Balancer.

type SslPolicy:

string

param SslPolicy:

[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.

For more information, see Security policies in the Application Load Balancers Guide and Security policies in the Network Load Balancers Guide.

type Certificates:

list

param Certificates:

[HTTPS and TLS listeners] The default certificate for the listener. You must provide exactly one certificate. Set CertificateArn to the certificate ARN but do not set IsDefault.

  • (dict) --

    Information about an SSL server certificate.

    • CertificateArn (string) --

      The Amazon Resource Name (ARN) of the certificate.

    • IsDefault (boolean) --

      Indicates whether the certificate is the default certificate. Do not set this value when specifying a certificate as an input. This value is not included in the output when describing a listener, but is included when describing listener certificates.

type DefaultActions:

list

param DefaultActions:

[REQUIRED]

The actions for the default rule.

  • (dict) --

    Information about an action.

    Each rule must include exactly one of the following routing actions: forward, fixed-response, or redirect, and it must be the last action to be performed.

    Optionally, a rule for an HTTPS listener can also include one of the following user authentication actions: authenticate-oidc, authenticate-cognito, or jwt-validation.

    • Type (string) -- [REQUIRED]

      The type of action.

    • TargetGroupArn (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.

    • AuthenticateOidcConfig (dict) --

      [HTTPS listeners] Information about an identity provider that is compliant with OpenID Connect (OIDC). Specify only when Type is authenticate-oidc.

      • Issuer (string) -- [REQUIRED]

        The OIDC issuer identifier of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

      • AuthorizationEndpoint (string) -- [REQUIRED]

        The authorization endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

      • TokenEndpoint (string) -- [REQUIRED]

        The token endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

      • UserInfoEndpoint (string) -- [REQUIRED]

        The user info endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

      • ClientId (string) -- [REQUIRED]

        The OAuth 2.0 client identifier.

      • ClientSecret (string) --

        The OAuth 2.0 client secret. This parameter is required if you are creating a rule. If you are modifying a rule, you can omit this parameter if you set UseExistingClientSecret to true.

      • SessionCookieName (string) --

        The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

      • Scope (string) --

        The set of user claims to be requested from the IdP. The default is openid.

        To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

      • SessionTimeout (integer) --

        The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

      • AuthenticationRequestExtraParams (dict) --

        The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

        • (string) --

          • (string) --

      • OnUnauthenticatedRequest (string) --

        The behavior if the user is not authenticated. The following are possible values:

        • deny - Return an HTTP 401 Unauthorized error.

        • allow - Allow the request to be forwarded to the target.

        • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

      • UseExistingClientSecret (boolean) --

        Indicates whether to use the existing client secret when modifying a rule. If you are creating a rule, you can omit this parameter or set it to false.

    • AuthenticateCognitoConfig (dict) --

      [HTTPS listeners] Information for using Amazon Cognito to authenticate users. Specify only when Type is authenticate-cognito.

      • UserPoolArn (string) -- [REQUIRED]

        The Amazon Resource Name (ARN) of the Amazon Cognito user pool.

      • UserPoolClientId (string) -- [REQUIRED]

        The ID of the Amazon Cognito user pool client.

      • UserPoolDomain (string) -- [REQUIRED]

        The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.

      • SessionCookieName (string) --

        The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

      • Scope (string) --

        The set of user claims to be requested from the IdP. The default is openid.

        To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

      • SessionTimeout (integer) --

        The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

      • AuthenticationRequestExtraParams (dict) --

        The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

        • (string) --

          • (string) --

      • OnUnauthenticatedRequest (string) --

        The behavior if the user is not authenticated. The following are possible values:

        • deny - Return an HTTP 401 Unauthorized error.

        • allow - Allow the request to be forwarded to the target.

        • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

    • Order (integer) --

      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.

    • RedirectConfig (dict) --

      [Application Load Balancer] Information for creating a redirect action. Specify only when Type is redirect.

      • Protocol (string) --

        The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You can't redirect HTTPS to HTTP.

      • Port (string) --

        The port. You can specify a value from 1 to 65535 or #{port}.

      • Host (string) --

        The hostname. This component is not percent-encoded. The hostname can contain #{host}.

      • Path (string) --

        The absolute path, starting with the leading "/". This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}.

      • Query (string) --

        The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading "?", as it is automatically added. You can specify any of the reserved keywords.

      • StatusCode (string) -- [REQUIRED]

        The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary (HTTP 302).

    • FixedResponseConfig (dict) --

      [Application Load Balancer] Information for creating an action that returns a custom HTTP response. Specify only when Type is fixed-response.

      • MessageBody (string) --

        The message.

      • StatusCode (string) -- [REQUIRED]

        The HTTP response code (2XX, 4XX, or 5XX).

      • ContentType (string) --

        The content type.

        Valid Values: text/plain | text/css | text/html | application/javascript | application/json

    • ForwardConfig (dict) --

      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.

      • TargetGroups (list) --

        The target groups.

        • (dict) --

          Information about how traffic will be distributed between multiple target groups in a forward rule.

          • TargetGroupArn (string) --

            The Amazon Resource Name (ARN) of the target group.

          • Weight (integer) --

            The weight. The range is 0 to 999.

      • TargetGroupStickinessConfig (dict) --

        The target group stickiness for the rule.

        • Enabled (boolean) --

          Indicates whether target group stickiness is enabled.

        • DurationSeconds (integer) --

          [Application Load Balancers] The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days). You must specify this value when enabling target group stickiness.

    • JwtValidationConfig (dict) --

      [HTTPS listeners] Information for validating JWT access tokens in client requests. Specify only when Type is jwt-validation.

      • JwksEndpoint (string) -- [REQUIRED]

        The JSON Web Key Set (JWKS) endpoint. This endpoint contains JSON Web Keys (JWK) that are used to validate signatures from the provider.

        This must be a full URL, including the HTTPS protocol, the domain, and the path. The maximum length is 256 characters.

      • Issuer (string) -- [REQUIRED]

        The issuer of the JWT. The maximum length is 256 characters.

      • AdditionalClaims (list) --

        Additional claims to validate. The maximum size of the list is 10. We validate the exp, iss, nbf, and iat claims by default.

        • (dict) --

          Information about an additional claim to validate.

          • Format (string) -- [REQUIRED]

            The format of the claim value.

          • Name (string) -- [REQUIRED]

            The name of the claim. You can't specify exp, iss, nbf, or iat because we validate them by default.

          • Values (list) -- [REQUIRED]

            The claim value. The maximum size of the list is 10. Each value can be up to 256 characters in length. If the format is space-separated-values, the values can't include spaces.

            • (string) --

type AlpnPolicy:

list

param AlpnPolicy:

[TLS listeners] The name of the Application-Layer Protocol Negotiation (ALPN) policy. You can specify one policy name. The following are the possible values:

  • HTTP1Only

  • HTTP2Only

  • HTTP2Optional

  • HTTP2Preferred

  • None

For more information, see ALPN policies in the Network Load Balancers Guide.

  • (string) --

type Tags:

list

param Tags:

The tags to assign to the listener.

  • (dict) --

    Information about a tag.

    • Key (string) -- [REQUIRED]

      The key of the tag.

    • Value (string) --

      The value of the tag.

type MutualAuthentication:

dict

param MutualAuthentication:

[HTTPS listeners] The mutual authentication configuration information.

  • Mode (string) --

    The client certificate handling method. Options are off, passthrough or verify. The default value is off.

  • TrustStoreArn (string) --

    The Amazon Resource Name (ARN) of the trust store.

  • IgnoreClientCertificateExpiry (boolean) --

    Indicates whether expired client certificates are ignored.

  • TrustStoreAssociationStatus (string) --

    Indicates a shared trust stores association status.

  • AdvertiseTrustStoreCaNames (string) --

    Indicates whether trust store CA certificate names are advertised.

rtype:

dict

returns:

Response Syntax

{
    'Listeners': [
        {
            'ListenerArn': 'string',
            'LoadBalancerArn': 'string',
            'Port': 123,
            'Protocol': 'HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
            'Certificates': [
                {
                    'CertificateArn': 'string',
                    'IsDefault': True|False
                },
            ],
            'SslPolicy': 'string',
            'DefaultActions': [
                {
                    'Type': 'forward'|'authenticate-oidc'|'authenticate-cognito'|'redirect'|'fixed-response'|'jwt-validation',
                    'TargetGroupArn': 'string',
                    'AuthenticateOidcConfig': {
                        'Issuer': 'string',
                        'AuthorizationEndpoint': 'string',
                        'TokenEndpoint': 'string',
                        'UserInfoEndpoint': 'string',
                        'ClientId': 'string',
                        'ClientSecret': 'string',
                        'SessionCookieName': 'string',
                        'Scope': 'string',
                        'SessionTimeout': 123,
                        'AuthenticationRequestExtraParams': {
                            'string': 'string'
                        },
                        'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate',
                        'UseExistingClientSecret': True|False
                    },
                    'AuthenticateCognitoConfig': {
                        'UserPoolArn': 'string',
                        'UserPoolClientId': 'string',
                        'UserPoolDomain': 'string',
                        'SessionCookieName': 'string',
                        'Scope': 'string',
                        'SessionTimeout': 123,
                        'AuthenticationRequestExtraParams': {
                            'string': 'string'
                        },
                        'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate'
                    },
                    'Order': 123,
                    'RedirectConfig': {
                        'Protocol': 'string',
                        'Port': 'string',
                        'Host': 'string',
                        'Path': 'string',
                        'Query': 'string',
                        'StatusCode': 'HTTP_301'|'HTTP_302'
                    },
                    'FixedResponseConfig': {
                        'MessageBody': 'string',
                        'StatusCode': 'string',
                        'ContentType': 'string'
                    },
                    'ForwardConfig': {
                        'TargetGroups': [
                            {
                                'TargetGroupArn': 'string',
                                'Weight': 123
                            },
                        ],
                        'TargetGroupStickinessConfig': {
                            'Enabled': True|False,
                            'DurationSeconds': 123
                        }
                    },
                    'JwtValidationConfig': {
                        'JwksEndpoint': 'string',
                        'Issuer': 'string',
                        'AdditionalClaims': [
                            {
                                'Format': 'single-string'|'string-array'|'space-separated-values',
                                'Name': 'string',
                                'Values': [
                                    'string',
                                ]
                            },
                        ]
                    }
                },
            ],
            'AlpnPolicy': [
                'string',
            ],
            'MutualAuthentication': {
                'Mode': 'string',
                'TrustStoreArn': 'string',
                'IgnoreClientCertificateExpiry': True|False,
                'TrustStoreAssociationStatus': 'active'|'removed',
                'AdvertiseTrustStoreCaNames': 'on'|'off'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • Listeners (list) --

      Information about the listener.

      • (dict) --

        Information about a listener.

        • ListenerArn (string) --

          The Amazon Resource Name (ARN) of the listener.

        • LoadBalancerArn (string) --

          The Amazon Resource Name (ARN) of the load balancer.

        • Port (integer) --

          The port on which the load balancer is listening.

        • Protocol (string) --

          The protocol for connections from clients to the load balancer.

        • Certificates (list) --

          [HTTPS or TLS listener] The default certificate for the listener.

          • (dict) --

            Information about an SSL server certificate.

            • CertificateArn (string) --

              The Amazon Resource Name (ARN) of the certificate.

            • IsDefault (boolean) --

              Indicates whether the certificate is the default certificate. Do not set this value when specifying a certificate as an input. This value is not included in the output when describing a listener, but is included when describing listener certificates.

        • SslPolicy (string) --

          [HTTPS or TLS listener] The security policy that defines which protocols and ciphers are supported.

        • DefaultActions (list) --

          The default actions for the listener.

          • (dict) --

            Information about an action.

            Each rule must include exactly one of the following routing actions: forward, fixed-response, or redirect, and it must be the last action to be performed.

            Optionally, a rule for an HTTPS listener can also include one of the following user authentication actions: authenticate-oidc, authenticate-cognito, or jwt-validation.

            • Type (string) --

              The type of action.

            • TargetGroupArn (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.

            • AuthenticateOidcConfig (dict) --

              [HTTPS listeners] Information about an identity provider that is compliant with OpenID Connect (OIDC). Specify only when Type is authenticate-oidc.

              • Issuer (string) --

                The OIDC issuer identifier of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • AuthorizationEndpoint (string) --

                The authorization endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • TokenEndpoint (string) --

                The token endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • UserInfoEndpoint (string) --

                The user info endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • ClientId (string) --

                The OAuth 2.0 client identifier.

              • ClientSecret (string) --

                The OAuth 2.0 client secret. This parameter is required if you are creating a rule. If you are modifying a rule, you can omit this parameter if you set UseExistingClientSecret to true.

              • SessionCookieName (string) --

                The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

              • Scope (string) --

                The set of user claims to be requested from the IdP. The default is openid.

                To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

              • SessionTimeout (integer) --

                The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

              • AuthenticationRequestExtraParams (dict) --

                The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

                • (string) --

                  • (string) --

              • OnUnauthenticatedRequest (string) --

                The behavior if the user is not authenticated. The following are possible values:

                • deny - Return an HTTP 401 Unauthorized error.

                • allow - Allow the request to be forwarded to the target.

                • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

              • UseExistingClientSecret (boolean) --

                Indicates whether to use the existing client secret when modifying a rule. If you are creating a rule, you can omit this parameter or set it to false.

            • AuthenticateCognitoConfig (dict) --

              [HTTPS listeners] Information for using Amazon Cognito to authenticate users. Specify only when Type is authenticate-cognito.

              • UserPoolArn (string) --

                The Amazon Resource Name (ARN) of the Amazon Cognito user pool.

              • UserPoolClientId (string) --

                The ID of the Amazon Cognito user pool client.

              • UserPoolDomain (string) --

                The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.

              • SessionCookieName (string) --

                The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

              • Scope (string) --

                The set of user claims to be requested from the IdP. The default is openid.

                To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

              • SessionTimeout (integer) --

                The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

              • AuthenticationRequestExtraParams (dict) --

                The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

                • (string) --

                  • (string) --

              • OnUnauthenticatedRequest (string) --

                The behavior if the user is not authenticated. The following are possible values:

                • deny - Return an HTTP 401 Unauthorized error.

                • allow - Allow the request to be forwarded to the target.

                • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

            • Order (integer) --

              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.

            • RedirectConfig (dict) --

              [Application Load Balancer] Information for creating a redirect action. Specify only when Type is redirect.

              • Protocol (string) --

                The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You can't redirect HTTPS to HTTP.

              • Port (string) --

                The port. You can specify a value from 1 to 65535 or #{port}.

              • Host (string) --

                The hostname. This component is not percent-encoded. The hostname can contain #{host}.

              • Path (string) --

                The absolute path, starting with the leading "/". This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}.

              • Query (string) --

                The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading "?", as it is automatically added. You can specify any of the reserved keywords.

              • StatusCode (string) --

                The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary (HTTP 302).

            • FixedResponseConfig (dict) --

              [Application Load Balancer] Information for creating an action that returns a custom HTTP response. Specify only when Type is fixed-response.

              • MessageBody (string) --

                The message.

              • StatusCode (string) --

                The HTTP response code (2XX, 4XX, or 5XX).

              • ContentType (string) --

                The content type.

                Valid Values: text/plain | text/css | text/html | application/javascript | application/json

            • ForwardConfig (dict) --

              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.

              • TargetGroups (list) --

                The target groups.

                • (dict) --

                  Information about how traffic will be distributed between multiple target groups in a forward rule.

                  • TargetGroupArn (string) --

                    The Amazon Resource Name (ARN) of the target group.

                  • Weight (integer) --

                    The weight. The range is 0 to 999.

              • TargetGroupStickinessConfig (dict) --

                The target group stickiness for the rule.

                • Enabled (boolean) --

                  Indicates whether target group stickiness is enabled.

                • DurationSeconds (integer) --

                  [Application Load Balancers] The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days). You must specify this value when enabling target group stickiness.

            • JwtValidationConfig (dict) --

              [HTTPS listeners] Information for validating JWT access tokens in client requests. Specify only when Type is jwt-validation.

              • JwksEndpoint (string) --

                The JSON Web Key Set (JWKS) endpoint. This endpoint contains JSON Web Keys (JWK) that are used to validate signatures from the provider.

                This must be a full URL, including the HTTPS protocol, the domain, and the path. The maximum length is 256 characters.

              • Issuer (string) --

                The issuer of the JWT. The maximum length is 256 characters.

              • AdditionalClaims (list) --

                Additional claims to validate. The maximum size of the list is 10. We validate the exp, iss, nbf, and iat claims by default.

                • (dict) --

                  Information about an additional claim to validate.

                  • Format (string) --

                    The format of the claim value.

                  • Name (string) --

                    The name of the claim. You can't specify exp, iss, nbf, or iat because we validate them by default.

                  • Values (list) --

                    The claim value. The maximum size of the list is 10. Each value can be up to 256 characters in length. If the format is space-separated-values, the values can't include spaces.

                    • (string) --

        • AlpnPolicy (list) --

          [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.

          • (string) --

        • MutualAuthentication (dict) --

          The mutual authentication configuration information.

          • Mode (string) --

            The client certificate handling method. Options are off, passthrough or verify. The default value is off.

          • TrustStoreArn (string) --

            The Amazon Resource Name (ARN) of the trust store.

          • IgnoreClientCertificateExpiry (boolean) --

            Indicates whether expired client certificates are ignored.

          • TrustStoreAssociationStatus (string) --

            Indicates a shared trust stores association status.

          • AdvertiseTrustStoreCaNames (string) --

            Indicates whether trust store CA certificate names are advertised.

CreateTargetGroup (updated) Link ¶
Changes (request, response)
Request
{'HealthCheckProtocol': {'QUIC', 'TCP_QUIC'}, 'Protocol': {'QUIC', 'TCP_QUIC'}}
Response
{'TargetGroups': {'HealthCheckProtocol': {'QUIC', 'TCP_QUIC'},
                  'Protocol': {'QUIC', 'TCP_QUIC'}}}

Creates a target group.

For more information, see the following:

This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple target groups with the same settings, each call succeeds.

See also: AWS API Documentation

Request Syntax

client.create_target_group(
    Name='string',
    Protocol='HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
    ProtocolVersion='string',
    Port=123,
    VpcId='string',
    HealthCheckProtocol='HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
    HealthCheckPort='string',
    HealthCheckEnabled=True|False,
    HealthCheckPath='string',
    HealthCheckIntervalSeconds=123,
    HealthCheckTimeoutSeconds=123,
    HealthyThresholdCount=123,
    UnhealthyThresholdCount=123,
    Matcher={
        'HttpCode': 'string',
        'GrpcCode': 'string'
    },
    TargetType='instance'|'ip'|'lambda'|'alb',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    IpAddressType='ipv4'|'ipv6'
)
type Name:

string

param Name:

[REQUIRED]

The name of the target group.

This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

type Protocol:

string

param Protocol:

The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or TCP_UDP. For Gateway Load Balancers, the supported protocol is GENEVE. A TCP_UDP listener must be associated with a TCP_UDP target group. If the target is a Lambda function, this parameter does not apply.

type ProtocolVersion:

string

param ProtocolVersion:

[HTTP/HTTPS protocol] The protocol version. Specify GRPC to send requests to targets using gRPC. Specify HTTP2 to send requests to targets using HTTP/2. The default is HTTP1, which sends requests to targets using HTTP/1.1.

type Port:

integer

param Port:

The port on which the targets receive traffic. This port is used unless you specify a port override when registering the target. If the target is a Lambda function, this parameter does not apply. If the protocol is GENEVE, the supported port is 6081.

type VpcId:

string

param VpcId:

The identifier of the virtual private cloud (VPC). If the target is a Lambda function, this parameter does not apply. Otherwise, this parameter is required.

type HealthCheckProtocol:

string

param HealthCheckProtocol:

The protocol the load balancer uses when performing health checks on targets. For Application Load Balancers, the default is HTTP. For Network Load Balancers and Gateway Load Balancers, the default is TCP. The TCP protocol is not supported for health checks if the protocol of the target group is HTTP or HTTPS. The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health checks.

type HealthCheckPort:

string

param HealthCheckPort:

The port the load balancer uses when performing health checks on targets. If the protocol is HTTP, HTTPS, TCP, TLS, UDP, or TCP_UDP, the default is traffic-port, which is the port on which each target receives traffic from the load balancer. If the protocol is GENEVE, the default is port 80.

type HealthCheckEnabled:

boolean

param HealthCheckEnabled:

Indicates whether health checks are enabled. If the target type is lambda, health checks are disabled by default but can be enabled. If the target type is instance, ip, or alb, health checks are always enabled and can't be disabled.

type HealthCheckPath:

string

param HealthCheckPath:

[HTTP/HTTPS health checks] The destination for health checks on the targets.

[HTTP1 or HTTP2 protocol version] The ping path. The default is /.

[GRPC protocol version] The path of a custom health check method with the format /package.service/method. The default is /Amazon Web Services.ALB/healthcheck.

type HealthCheckIntervalSeconds:

integer

param HealthCheckIntervalSeconds:

The approximate amount of time, in seconds, between health checks of an individual target. The range is 5-300. If the target group protocol is TCP, TLS, UDP, TCP_UDP, HTTP or HTTPS, the default is 30 seconds. If the target group protocol is GENEVE, the default is 10 seconds. If the target type is lambda, the default is 35 seconds.

type HealthCheckTimeoutSeconds:

integer

param HealthCheckTimeoutSeconds:

The amount of time, in seconds, during which no response from a target means a failed health check. The range is 2–120 seconds. For target groups with a protocol of HTTP, the default is 6 seconds. For target groups with a protocol of TCP, TLS or HTTPS, the default is 10 seconds. For target groups with a protocol of GENEVE, the default is 5 seconds. If the target type is lambda, the default is 30 seconds.

type HealthyThresholdCount:

integer

param HealthyThresholdCount:

The number of consecutive health check successes required before considering a target healthy. The range is 2-10. If the target group protocol is TCP, TCP_UDP, UDP, TLS, HTTP or HTTPS, the default is 5. For target groups with a protocol of GENEVE, the default is 5. If the target type is lambda, the default is 5.

type UnhealthyThresholdCount:

integer

param UnhealthyThresholdCount:

The number of consecutive health check failures required before considering a target unhealthy. The range is 2-10. If the target group protocol is TCP, TCP_UDP, UDP, TLS, HTTP or HTTPS, the default is 2. For target groups with a protocol of GENEVE, the default is 2. If the target type is lambda, the default is 5.

type Matcher:

dict

param Matcher:

[HTTP/HTTPS health checks] The HTTP or gRPC codes to use when checking for a successful response from a target. For target groups with a protocol of TCP, TCP_UDP, UDP or TLS the range is 200-599. For target groups with a protocol of HTTP or HTTPS, the range is 200-499. For target groups with a protocol of GENEVE, the range is 200-399.

  • HttpCode (string) --

    For Application Load Balancers, you can specify values between 200 and 499, with the default value being 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

    For Network Load Balancers, you can specify values between 200 and 599, with the default value being 200-399. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

    For Gateway Load Balancers, this must be "200–399".

    Note that when using shorthand syntax, some values such as commas need to be escaped.

  • GrpcCode (string) --

    You can specify values between 0 and 99. You can specify multiple values (for example, "0,1") or a range of values (for example, "0-5"). The default value is 12.

type TargetType:

string

param TargetType:

The type of target that you must specify when registering targets with this target group. You can't specify targets for a target group using more than one target type.

  • instance - Register targets by instance ID. This is the default value.

  • ip - Register targets by IP address. You can specify IP addresses from the subnets of the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.

  • lambda - Register a single Lambda function as a target.

  • alb - Register a single Application Load Balancer as a target.

type Tags:

list

param Tags:

The tags to assign to the target group.

  • (dict) --

    Information about a tag.

    • Key (string) -- [REQUIRED]

      The key of the tag.

    • Value (string) --

      The value of the tag.

type IpAddressType:

string

param IpAddressType:

The IP address type. The default value is ipv4.

rtype:

dict

returns:

Response Syntax

{
    'TargetGroups': [
        {
            'TargetGroupArn': 'string',
            'TargetGroupName': 'string',
            'Protocol': 'HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
            'Port': 123,
            'VpcId': 'string',
            'HealthCheckProtocol': 'HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
            'HealthCheckPort': 'string',
            'HealthCheckEnabled': True|False,
            'HealthCheckIntervalSeconds': 123,
            'HealthCheckTimeoutSeconds': 123,
            'HealthyThresholdCount': 123,
            'UnhealthyThresholdCount': 123,
            'HealthCheckPath': 'string',
            'Matcher': {
                'HttpCode': 'string',
                'GrpcCode': 'string'
            },
            'LoadBalancerArns': [
                'string',
            ],
            'TargetType': 'instance'|'ip'|'lambda'|'alb',
            'ProtocolVersion': 'string',
            'IpAddressType': 'ipv4'|'ipv6'
        },
    ]
}

Response Structure

  • (dict) --

    • TargetGroups (list) --

      Information about the target group.

      • (dict) --

        Information about a target group.

        • TargetGroupArn (string) --

          The Amazon Resource Name (ARN) of the target group.

        • TargetGroupName (string) --

          The name of the target group.

        • Protocol (string) --

          The protocol to use for routing traffic to the targets.

        • Port (integer) --

          The port on which the targets are listening. This parameter is not used if the target is a Lambda function.

        • VpcId (string) --

          The ID of the VPC for the targets.

        • HealthCheckProtocol (string) --

          The protocol to use to connect with the target. The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health checks.

        • HealthCheckPort (string) --

          The port to use to connect with the target.

        • HealthCheckEnabled (boolean) --

          Indicates whether health checks are enabled.

        • HealthCheckIntervalSeconds (integer) --

          The approximate amount of time, in seconds, between health checks of an individual target.

        • HealthCheckTimeoutSeconds (integer) --

          The amount of time, in seconds, during which no response means a failed health check.

        • HealthyThresholdCount (integer) --

          The number of consecutive health checks successes required before considering an unhealthy target healthy.

        • UnhealthyThresholdCount (integer) --

          The number of consecutive health check failures required before considering the target unhealthy.

        • HealthCheckPath (string) --

          The destination for health checks on the targets.

        • Matcher (dict) --

          The HTTP or gRPC codes to use when checking for a successful response from a target.

          • HttpCode (string) --

            For Application Load Balancers, you can specify values between 200 and 499, with the default value being 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

            For Network Load Balancers, you can specify values between 200 and 599, with the default value being 200-399. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

            For Gateway Load Balancers, this must be "200–399".

            Note that when using shorthand syntax, some values such as commas need to be escaped.

          • GrpcCode (string) --

            You can specify values between 0 and 99. You can specify multiple values (for example, "0,1") or a range of values (for example, "0-5"). The default value is 12.

        • LoadBalancerArns (list) --

          The Amazon Resource Name (ARN) of the load balancer that routes traffic to this target group. You can use each target group with only one load balancer.

          • (string) --

        • TargetType (string) --

          The type of target that you must specify when registering targets with this target group. The possible values are instance (register targets by instance ID), ip (register targets by IP address), lambda (register a single Lambda function as a target), or alb (register a single Application Load Balancer as a target).

        • ProtocolVersion (string) --

          [HTTP/HTTPS protocol] The protocol version. The possible values are GRPC, HTTP1, and HTTP2.

        • IpAddressType (string) --

          The IP address type. The default value is ipv4.

DeregisterTargets (updated) Link ¶
Changes (request)
{'Targets': {'QuicServerId': 'string'}}

Deregisters the specified targets from the specified target group. After the targets are deregistered, they no longer receive traffic from the load balancer.

The load balancer stops sending requests to targets that are deregistering, but uses connection draining to ensure that in-flight traffic completes on the existing connections. This deregistration delay is configured by default but can be updated for each target group.

For more information, see the following:

Note: If the specified target does not exist, the action returns successfully.

See also: AWS API Documentation

Request Syntax

client.deregister_targets(
    TargetGroupArn='string',
    Targets=[
        {
            'Id': 'string',
            'Port': 123,
            'AvailabilityZone': 'string',
            'QuicServerId': 'string'
        },
    ]
)
type TargetGroupArn:

string

param TargetGroupArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the target group.

type Targets:

list

param Targets:

[REQUIRED]

The targets. If you specified a port override when you registered a target, you must specify both the target ID and the port when you deregister it.

  • (dict) --

    Information about a target.

    • Id (string) -- [REQUIRED]

      The ID of the target. If the target type of the target group is instance, specify an instance ID. If the target type is ip, specify an IP address. If the target type is lambda, specify the ARN of the Lambda function. If the target type is alb, specify the ARN of the Application Load Balancer target.

    • Port (integer) --

      The port on which the target is listening. If the target group protocol is GENEVE, the supported port is 6081. If the target type is alb, the targeted Application Load Balancer must have at least one listener whose port matches the target group port. This parameter is not used if the target is a Lambda function.

    • AvailabilityZone (string) --

      An Availability Zone or all. This determines whether the target receives traffic from the load balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load balancer.

      For Application Load Balancer target groups, the specified Availability Zone value is only applicable when cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all.

      This parameter is not supported if the target type of the target group is instance or alb.

      If the target type is ip and the IP address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this parameter is optional. If the IP address is outside the VPC, this parameter is required.

      For Application Load Balancer target groups with cross-zone load balancing off, if the target type is ip and the IP address is outside of the VPC for the target group, this should be an Availability Zone inside the VPC for the target group.

      If the target type is lambda, this parameter is optional and the only supported value is all.

    • QuicServerId (string) --

      The server ID for the targets. This value is required if the protocol is QUIC or TCP_QUIC and can't be used with other protocols.

      The ID consists of the 0x prefix followed by 16 hexadecimal characters. Any letters must be lowercase. The value must be unique at the listener level. You can't modify the server ID for a registered target. You must deregister the target and then provide a new server ID when you register the target again.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DescribeListeners (updated) Link ¶
Changes (response)
{'Listeners': {'Protocol': {'QUIC', 'TCP_QUIC'}}}

Describes the specified listeners or the listeners for the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. You must specify either a load balancer or one or more listeners.

See also: AWS API Documentation

Request Syntax

client.describe_listeners(
    LoadBalancerArn='string',
    ListenerArns=[
        'string',
    ],
    Marker='string',
    PageSize=123
)
type LoadBalancerArn:

string

param LoadBalancerArn:

The Amazon Resource Name (ARN) of the load balancer.

type ListenerArns:

list

param ListenerArns:

The Amazon Resource Names (ARN) of the listeners.

  • (string) --

type Marker:

string

param Marker:

The marker for the next set of results. (You received this marker from a previous call.)

type PageSize:

integer

param PageSize:

The maximum number of results to return with this call.

rtype:

dict

returns:

Response Syntax

{
    'Listeners': [
        {
            'ListenerArn': 'string',
            'LoadBalancerArn': 'string',
            'Port': 123,
            'Protocol': 'HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
            'Certificates': [
                {
                    'CertificateArn': 'string',
                    'IsDefault': True|False
                },
            ],
            'SslPolicy': 'string',
            'DefaultActions': [
                {
                    'Type': 'forward'|'authenticate-oidc'|'authenticate-cognito'|'redirect'|'fixed-response'|'jwt-validation',
                    'TargetGroupArn': 'string',
                    'AuthenticateOidcConfig': {
                        'Issuer': 'string',
                        'AuthorizationEndpoint': 'string',
                        'TokenEndpoint': 'string',
                        'UserInfoEndpoint': 'string',
                        'ClientId': 'string',
                        'ClientSecret': 'string',
                        'SessionCookieName': 'string',
                        'Scope': 'string',
                        'SessionTimeout': 123,
                        'AuthenticationRequestExtraParams': {
                            'string': 'string'
                        },
                        'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate',
                        'UseExistingClientSecret': True|False
                    },
                    'AuthenticateCognitoConfig': {
                        'UserPoolArn': 'string',
                        'UserPoolClientId': 'string',
                        'UserPoolDomain': 'string',
                        'SessionCookieName': 'string',
                        'Scope': 'string',
                        'SessionTimeout': 123,
                        'AuthenticationRequestExtraParams': {
                            'string': 'string'
                        },
                        'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate'
                    },
                    'Order': 123,
                    'RedirectConfig': {
                        'Protocol': 'string',
                        'Port': 'string',
                        'Host': 'string',
                        'Path': 'string',
                        'Query': 'string',
                        'StatusCode': 'HTTP_301'|'HTTP_302'
                    },
                    'FixedResponseConfig': {
                        'MessageBody': 'string',
                        'StatusCode': 'string',
                        'ContentType': 'string'
                    },
                    'ForwardConfig': {
                        'TargetGroups': [
                            {
                                'TargetGroupArn': 'string',
                                'Weight': 123
                            },
                        ],
                        'TargetGroupStickinessConfig': {
                            'Enabled': True|False,
                            'DurationSeconds': 123
                        }
                    },
                    'JwtValidationConfig': {
                        'JwksEndpoint': 'string',
                        'Issuer': 'string',
                        'AdditionalClaims': [
                            {
                                'Format': 'single-string'|'string-array'|'space-separated-values',
                                'Name': 'string',
                                'Values': [
                                    'string',
                                ]
                            },
                        ]
                    }
                },
            ],
            'AlpnPolicy': [
                'string',
            ],
            'MutualAuthentication': {
                'Mode': 'string',
                'TrustStoreArn': 'string',
                'IgnoreClientCertificateExpiry': True|False,
                'TrustStoreAssociationStatus': 'active'|'removed',
                'AdvertiseTrustStoreCaNames': 'on'|'off'
            }
        },
    ],
    'NextMarker': 'string'
}

Response Structure

  • (dict) --

    • Listeners (list) --

      Information about the listeners.

      • (dict) --

        Information about a listener.

        • ListenerArn (string) --

          The Amazon Resource Name (ARN) of the listener.

        • LoadBalancerArn (string) --

          The Amazon Resource Name (ARN) of the load balancer.

        • Port (integer) --

          The port on which the load balancer is listening.

        • Protocol (string) --

          The protocol for connections from clients to the load balancer.

        • Certificates (list) --

          [HTTPS or TLS listener] The default certificate for the listener.

          • (dict) --

            Information about an SSL server certificate.

            • CertificateArn (string) --

              The Amazon Resource Name (ARN) of the certificate.

            • IsDefault (boolean) --

              Indicates whether the certificate is the default certificate. Do not set this value when specifying a certificate as an input. This value is not included in the output when describing a listener, but is included when describing listener certificates.

        • SslPolicy (string) --

          [HTTPS or TLS listener] The security policy that defines which protocols and ciphers are supported.

        • DefaultActions (list) --

          The default actions for the listener.

          • (dict) --

            Information about an action.

            Each rule must include exactly one of the following routing actions: forward, fixed-response, or redirect, and it must be the last action to be performed.

            Optionally, a rule for an HTTPS listener can also include one of the following user authentication actions: authenticate-oidc, authenticate-cognito, or jwt-validation.

            • Type (string) --

              The type of action.

            • TargetGroupArn (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.

            • AuthenticateOidcConfig (dict) --

              [HTTPS listeners] Information about an identity provider that is compliant with OpenID Connect (OIDC). Specify only when Type is authenticate-oidc.

              • Issuer (string) --

                The OIDC issuer identifier of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • AuthorizationEndpoint (string) --

                The authorization endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • TokenEndpoint (string) --

                The token endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • UserInfoEndpoint (string) --

                The user info endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • ClientId (string) --

                The OAuth 2.0 client identifier.

              • ClientSecret (string) --

                The OAuth 2.0 client secret. This parameter is required if you are creating a rule. If you are modifying a rule, you can omit this parameter if you set UseExistingClientSecret to true.

              • SessionCookieName (string) --

                The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

              • Scope (string) --

                The set of user claims to be requested from the IdP. The default is openid.

                To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

              • SessionTimeout (integer) --

                The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

              • AuthenticationRequestExtraParams (dict) --

                The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

                • (string) --

                  • (string) --

              • OnUnauthenticatedRequest (string) --

                The behavior if the user is not authenticated. The following are possible values:

                • deny - Return an HTTP 401 Unauthorized error.

                • allow - Allow the request to be forwarded to the target.

                • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

              • UseExistingClientSecret (boolean) --

                Indicates whether to use the existing client secret when modifying a rule. If you are creating a rule, you can omit this parameter or set it to false.

            • AuthenticateCognitoConfig (dict) --

              [HTTPS listeners] Information for using Amazon Cognito to authenticate users. Specify only when Type is authenticate-cognito.

              • UserPoolArn (string) --

                The Amazon Resource Name (ARN) of the Amazon Cognito user pool.

              • UserPoolClientId (string) --

                The ID of the Amazon Cognito user pool client.

              • UserPoolDomain (string) --

                The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.

              • SessionCookieName (string) --

                The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

              • Scope (string) --

                The set of user claims to be requested from the IdP. The default is openid.

                To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

              • SessionTimeout (integer) --

                The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

              • AuthenticationRequestExtraParams (dict) --

                The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

                • (string) --

                  • (string) --

              • OnUnauthenticatedRequest (string) --

                The behavior if the user is not authenticated. The following are possible values:

                • deny - Return an HTTP 401 Unauthorized error.

                • allow - Allow the request to be forwarded to the target.

                • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

            • Order (integer) --

              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.

            • RedirectConfig (dict) --

              [Application Load Balancer] Information for creating a redirect action. Specify only when Type is redirect.

              • Protocol (string) --

                The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You can't redirect HTTPS to HTTP.

              • Port (string) --

                The port. You can specify a value from 1 to 65535 or #{port}.

              • Host (string) --

                The hostname. This component is not percent-encoded. The hostname can contain #{host}.

              • Path (string) --

                The absolute path, starting with the leading "/". This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}.

              • Query (string) --

                The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading "?", as it is automatically added. You can specify any of the reserved keywords.

              • StatusCode (string) --

                The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary (HTTP 302).

            • FixedResponseConfig (dict) --

              [Application Load Balancer] Information for creating an action that returns a custom HTTP response. Specify only when Type is fixed-response.

              • MessageBody (string) --

                The message.

              • StatusCode (string) --

                The HTTP response code (2XX, 4XX, or 5XX).

              • ContentType (string) --

                The content type.

                Valid Values: text/plain | text/css | text/html | application/javascript | application/json

            • ForwardConfig (dict) --

              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.

              • TargetGroups (list) --

                The target groups.

                • (dict) --

                  Information about how traffic will be distributed between multiple target groups in a forward rule.

                  • TargetGroupArn (string) --

                    The Amazon Resource Name (ARN) of the target group.

                  • Weight (integer) --

                    The weight. The range is 0 to 999.

              • TargetGroupStickinessConfig (dict) --

                The target group stickiness for the rule.

                • Enabled (boolean) --

                  Indicates whether target group stickiness is enabled.

                • DurationSeconds (integer) --

                  [Application Load Balancers] The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days). You must specify this value when enabling target group stickiness.

            • JwtValidationConfig (dict) --

              [HTTPS listeners] Information for validating JWT access tokens in client requests. Specify only when Type is jwt-validation.

              • JwksEndpoint (string) --

                The JSON Web Key Set (JWKS) endpoint. This endpoint contains JSON Web Keys (JWK) that are used to validate signatures from the provider.

                This must be a full URL, including the HTTPS protocol, the domain, and the path. The maximum length is 256 characters.

              • Issuer (string) --

                The issuer of the JWT. The maximum length is 256 characters.

              • AdditionalClaims (list) --

                Additional claims to validate. The maximum size of the list is 10. We validate the exp, iss, nbf, and iat claims by default.

                • (dict) --

                  Information about an additional claim to validate.

                  • Format (string) --

                    The format of the claim value.

                  • Name (string) --

                    The name of the claim. You can't specify exp, iss, nbf, or iat because we validate them by default.

                  • Values (list) --

                    The claim value. The maximum size of the list is 10. Each value can be up to 256 characters in length. If the format is space-separated-values, the values can't include spaces.

                    • (string) --

        • AlpnPolicy (list) --

          [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.

          • (string) --

        • MutualAuthentication (dict) --

          The mutual authentication configuration information.

          • Mode (string) --

            The client certificate handling method. Options are off, passthrough or verify. The default value is off.

          • TrustStoreArn (string) --

            The Amazon Resource Name (ARN) of the trust store.

          • IgnoreClientCertificateExpiry (boolean) --

            Indicates whether expired client certificates are ignored.

          • TrustStoreAssociationStatus (string) --

            Indicates a shared trust stores association status.

          • AdvertiseTrustStoreCaNames (string) --

            Indicates whether trust store CA certificate names are advertised.

    • NextMarker (string) --

      If there are additional results, this is the marker for the next set of results. Otherwise, this is null.

DescribeTargetGroups (updated) Link ¶
Changes (response)
{'TargetGroups': {'HealthCheckProtocol': {'QUIC', 'TCP_QUIC'},
                  'Protocol': {'QUIC', 'TCP_QUIC'}}}

Describes the specified target groups or all of your target groups. By default, all target groups are described. Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the names of one or more target groups, or the ARNs of one or more target groups.

See also: AWS API Documentation

Request Syntax

client.describe_target_groups(
    LoadBalancerArn='string',
    TargetGroupArns=[
        'string',
    ],
    Names=[
        'string',
    ],
    Marker='string',
    PageSize=123
)
type LoadBalancerArn:

string

param LoadBalancerArn:

The Amazon Resource Name (ARN) of the load balancer.

type TargetGroupArns:

list

param TargetGroupArns:

The Amazon Resource Names (ARN) of the target groups.

  • (string) --

type Names:

list

param Names:

The names of the target groups.

  • (string) --

type Marker:

string

param Marker:

The marker for the next set of results. (You received this marker from a previous call.)

type PageSize:

integer

param PageSize:

The maximum number of results to return with this call.

rtype:

dict

returns:

Response Syntax

{
    'TargetGroups': [
        {
            'TargetGroupArn': 'string',
            'TargetGroupName': 'string',
            'Protocol': 'HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
            'Port': 123,
            'VpcId': 'string',
            'HealthCheckProtocol': 'HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
            'HealthCheckPort': 'string',
            'HealthCheckEnabled': True|False,
            'HealthCheckIntervalSeconds': 123,
            'HealthCheckTimeoutSeconds': 123,
            'HealthyThresholdCount': 123,
            'UnhealthyThresholdCount': 123,
            'HealthCheckPath': 'string',
            'Matcher': {
                'HttpCode': 'string',
                'GrpcCode': 'string'
            },
            'LoadBalancerArns': [
                'string',
            ],
            'TargetType': 'instance'|'ip'|'lambda'|'alb',
            'ProtocolVersion': 'string',
            'IpAddressType': 'ipv4'|'ipv6'
        },
    ],
    'NextMarker': 'string'
}

Response Structure

  • (dict) --

    • TargetGroups (list) --

      Information about the target groups.

      • (dict) --

        Information about a target group.

        • TargetGroupArn (string) --

          The Amazon Resource Name (ARN) of the target group.

        • TargetGroupName (string) --

          The name of the target group.

        • Protocol (string) --

          The protocol to use for routing traffic to the targets.

        • Port (integer) --

          The port on which the targets are listening. This parameter is not used if the target is a Lambda function.

        • VpcId (string) --

          The ID of the VPC for the targets.

        • HealthCheckProtocol (string) --

          The protocol to use to connect with the target. The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health checks.

        • HealthCheckPort (string) --

          The port to use to connect with the target.

        • HealthCheckEnabled (boolean) --

          Indicates whether health checks are enabled.

        • HealthCheckIntervalSeconds (integer) --

          The approximate amount of time, in seconds, between health checks of an individual target.

        • HealthCheckTimeoutSeconds (integer) --

          The amount of time, in seconds, during which no response means a failed health check.

        • HealthyThresholdCount (integer) --

          The number of consecutive health checks successes required before considering an unhealthy target healthy.

        • UnhealthyThresholdCount (integer) --

          The number of consecutive health check failures required before considering the target unhealthy.

        • HealthCheckPath (string) --

          The destination for health checks on the targets.

        • Matcher (dict) --

          The HTTP or gRPC codes to use when checking for a successful response from a target.

          • HttpCode (string) --

            For Application Load Balancers, you can specify values between 200 and 499, with the default value being 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

            For Network Load Balancers, you can specify values between 200 and 599, with the default value being 200-399. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

            For Gateway Load Balancers, this must be "200–399".

            Note that when using shorthand syntax, some values such as commas need to be escaped.

          • GrpcCode (string) --

            You can specify values between 0 and 99. You can specify multiple values (for example, "0,1") or a range of values (for example, "0-5"). The default value is 12.

        • LoadBalancerArns (list) --

          The Amazon Resource Name (ARN) of the load balancer that routes traffic to this target group. You can use each target group with only one load balancer.

          • (string) --

        • TargetType (string) --

          The type of target that you must specify when registering targets with this target group. The possible values are instance (register targets by instance ID), ip (register targets by IP address), lambda (register a single Lambda function as a target), or alb (register a single Application Load Balancer as a target).

        • ProtocolVersion (string) --

          [HTTP/HTTPS protocol] The protocol version. The possible values are GRPC, HTTP1, and HTTP2.

        • IpAddressType (string) --

          The IP address type. The default value is ipv4.

    • NextMarker (string) --

      If there are additional results, this is the marker for the next set of results. Otherwise, this is null.

DescribeTargetHealth (updated) Link ¶
Changes (request, response)
Request
{'Targets': {'QuicServerId': 'string'}}
Response
{'TargetHealthDescriptions': {'Target': {'QuicServerId': 'string'}}}

Describes the health of the specified targets or all of your targets.

See also: AWS API Documentation

Request Syntax

client.describe_target_health(
    TargetGroupArn='string',
    Targets=[
        {
            'Id': 'string',
            'Port': 123,
            'AvailabilityZone': 'string',
            'QuicServerId': 'string'
        },
    ],
    Include=[
        'AnomalyDetection'|'All',
    ]
)
type TargetGroupArn:

string

param TargetGroupArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the target group.

type Targets:

list

param Targets:

The targets.

  • (dict) --

    Information about a target.

    • Id (string) -- [REQUIRED]

      The ID of the target. If the target type of the target group is instance, specify an instance ID. If the target type is ip, specify an IP address. If the target type is lambda, specify the ARN of the Lambda function. If the target type is alb, specify the ARN of the Application Load Balancer target.

    • Port (integer) --

      The port on which the target is listening. If the target group protocol is GENEVE, the supported port is 6081. If the target type is alb, the targeted Application Load Balancer must have at least one listener whose port matches the target group port. This parameter is not used if the target is a Lambda function.

    • AvailabilityZone (string) --

      An Availability Zone or all. This determines whether the target receives traffic from the load balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load balancer.

      For Application Load Balancer target groups, the specified Availability Zone value is only applicable when cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all.

      This parameter is not supported if the target type of the target group is instance or alb.

      If the target type is ip and the IP address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this parameter is optional. If the IP address is outside the VPC, this parameter is required.

      For Application Load Balancer target groups with cross-zone load balancing off, if the target type is ip and the IP address is outside of the VPC for the target group, this should be an Availability Zone inside the VPC for the target group.

      If the target type is lambda, this parameter is optional and the only supported value is all.

    • QuicServerId (string) --

      The server ID for the targets. This value is required if the protocol is QUIC or TCP_QUIC and can't be used with other protocols.

      The ID consists of the 0x prefix followed by 16 hexadecimal characters. Any letters must be lowercase. The value must be unique at the listener level. You can't modify the server ID for a registered target. You must deregister the target and then provide a new server ID when you register the target again.

type Include:

list

param Include:

Used to include anomaly detection information.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'TargetHealthDescriptions': [
        {
            'Target': {
                'Id': 'string',
                'Port': 123,
                'AvailabilityZone': 'string',
                'QuicServerId': 'string'
            },
            'HealthCheckPort': 'string',
            'TargetHealth': {
                'State': 'initial'|'healthy'|'unhealthy'|'unhealthy.draining'|'unused'|'draining'|'unavailable',
                'Reason': 'Elb.RegistrationInProgress'|'Elb.InitialHealthChecking'|'Target.ResponseCodeMismatch'|'Target.Timeout'|'Target.FailedHealthChecks'|'Target.NotRegistered'|'Target.NotInUse'|'Target.DeregistrationInProgress'|'Target.InvalidState'|'Target.IpUnusable'|'Target.HealthCheckDisabled'|'Elb.InternalError',
                'Description': 'string'
            },
            'AnomalyDetection': {
                'Result': 'anomalous'|'normal',
                'MitigationInEffect': 'yes'|'no'
            },
            'AdministrativeOverride': {
                'State': 'unknown'|'no_override'|'zonal_shift_active'|'zonal_shift_delegated_to_dns',
                'Reason': 'AdministrativeOverride.Unknown'|'AdministrativeOverride.NoOverride'|'AdministrativeOverride.ZonalShiftActive'|'AdministrativeOverride.ZonalShiftDelegatedToDns',
                'Description': 'string'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • TargetHealthDescriptions (list) --

      Information about the health of the targets.

      • (dict) --

        Information about the health of a target.

        • Target (dict) --

          The description of the target.

          • Id (string) --

            The ID of the target. If the target type of the target group is instance, specify an instance ID. If the target type is ip, specify an IP address. If the target type is lambda, specify the ARN of the Lambda function. If the target type is alb, specify the ARN of the Application Load Balancer target.

          • Port (integer) --

            The port on which the target is listening. If the target group protocol is GENEVE, the supported port is 6081. If the target type is alb, the targeted Application Load Balancer must have at least one listener whose port matches the target group port. This parameter is not used if the target is a Lambda function.

          • AvailabilityZone (string) --

            An Availability Zone or all. This determines whether the target receives traffic from the load balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load balancer.

            For Application Load Balancer target groups, the specified Availability Zone value is only applicable when cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all.

            This parameter is not supported if the target type of the target group is instance or alb.

            If the target type is ip and the IP address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this parameter is optional. If the IP address is outside the VPC, this parameter is required.

            For Application Load Balancer target groups with cross-zone load balancing off, if the target type is ip and the IP address is outside of the VPC for the target group, this should be an Availability Zone inside the VPC for the target group.

            If the target type is lambda, this parameter is optional and the only supported value is all.

          • QuicServerId (string) --

            The server ID for the targets. This value is required if the protocol is QUIC or TCP_QUIC and can't be used with other protocols.

            The ID consists of the 0x prefix followed by 16 hexadecimal characters. Any letters must be lowercase. The value must be unique at the listener level. You can't modify the server ID for a registered target. You must deregister the target and then provide a new server ID when you register the target again.

        • HealthCheckPort (string) --

          The port to use to connect with the target.

        • TargetHealth (dict) --

          The health information for the target.

          • State (string) --

            The state of the target.

          • Reason (string) --

            The reason code.

            If the target state is healthy, a reason code is not provided.

            If the target state is initial, the reason code can be one of the following values:

            • Elb.RegistrationInProgress - The target is in the process of being registered with the load balancer.

            • Elb.InitialHealthChecking - The load balancer is still sending the target the minimum number of health checks required to determine its health status.

            If the target state is unhealthy, the reason code can be one of the following values:

            • Target.ResponseCodeMismatch - The health checks did not return an expected HTTP code.

            • Target.Timeout - The health check requests timed out.

            • Target.FailedHealthChecks - The load balancer received an error while establishing a connection to the target or the target response was malformed.

            • Elb.InternalError - The health checks failed due to an internal error.

            If the target state is unused, the reason code can be one of the following values:

            • Target.NotRegistered - The target is not registered with the target group.

            • Target.NotInUse - The target group is not used by any load balancer or the target is in an Availability Zone that is not enabled for its load balancer.

            • Target.InvalidState - The target is in the stopped or terminated state.

            • Target.IpUnusable - The target IP address is reserved for use by a load balancer.

            If the target state is draining, the reason code can be the following value:

            • Target.DeregistrationInProgress - The target is in the process of being deregistered and the deregistration delay period has not expired.

            If the target state is unavailable, the reason code can be the following value:

            • Target.HealthCheckDisabled - Health checks are disabled for the target group.

            • Elb.InternalError - Target health is unavailable due to an internal error.

          • Description (string) --

            A description of the target health that provides additional details. If the state is healthy, a description is not provided.

        • AnomalyDetection (dict) --

          The anomaly detection result for the target.

          If no anomalies were detected, the result is normal.

          If anomalies were detected, the result is anomalous.

          • Result (string) --

            The latest anomaly detection result.

          • MitigationInEffect (string) --

            Indicates whether anomaly mitigation is in progress.

        • AdministrativeOverride (dict) --

          The administrative override information for the target.

          • State (string) --

            The state of the override.

          • Reason (string) --

            The reason code for the state.

          • Description (string) --

            A description of the override state that provides additional details.

ModifyListener (updated) Link ¶
Changes (request, response)
Request
{'Protocol': {'QUIC', 'TCP_QUIC'}}
Response
{'Listeners': {'Protocol': {'QUIC', 'TCP_QUIC'}}}

Replaces the specified properties of the specified listener. Any properties that you do not specify remain unchanged.

Changing the protocol from HTTPS to HTTP, or from TLS to TCP, removes the security policy and default certificate properties. If you change the protocol from HTTP to HTTPS, or from TCP to TLS, you must add the security policy and default certificate properties.

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.

See also: AWS API Documentation

Request Syntax

client.modify_listener(
    ListenerArn='string',
    Port=123,
    Protocol='HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
    SslPolicy='string',
    Certificates=[
        {
            'CertificateArn': 'string',
            'IsDefault': True|False
        },
    ],
    DefaultActions=[
        {
            'Type': 'forward'|'authenticate-oidc'|'authenticate-cognito'|'redirect'|'fixed-response'|'jwt-validation',
            'TargetGroupArn': 'string',
            'AuthenticateOidcConfig': {
                'Issuer': 'string',
                'AuthorizationEndpoint': 'string',
                'TokenEndpoint': 'string',
                'UserInfoEndpoint': 'string',
                'ClientId': 'string',
                'ClientSecret': 'string',
                'SessionCookieName': 'string',
                'Scope': 'string',
                'SessionTimeout': 123,
                'AuthenticationRequestExtraParams': {
                    'string': 'string'
                },
                'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate',
                'UseExistingClientSecret': True|False
            },
            'AuthenticateCognitoConfig': {
                'UserPoolArn': 'string',
                'UserPoolClientId': 'string',
                'UserPoolDomain': 'string',
                'SessionCookieName': 'string',
                'Scope': 'string',
                'SessionTimeout': 123,
                'AuthenticationRequestExtraParams': {
                    'string': 'string'
                },
                'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate'
            },
            'Order': 123,
            'RedirectConfig': {
                'Protocol': 'string',
                'Port': 'string',
                'Host': 'string',
                'Path': 'string',
                'Query': 'string',
                'StatusCode': 'HTTP_301'|'HTTP_302'
            },
            'FixedResponseConfig': {
                'MessageBody': 'string',
                'StatusCode': 'string',
                'ContentType': 'string'
            },
            'ForwardConfig': {
                'TargetGroups': [
                    {
                        'TargetGroupArn': 'string',
                        'Weight': 123
                    },
                ],
                'TargetGroupStickinessConfig': {
                    'Enabled': True|False,
                    'DurationSeconds': 123
                }
            },
            'JwtValidationConfig': {
                'JwksEndpoint': 'string',
                'Issuer': 'string',
                'AdditionalClaims': [
                    {
                        'Format': 'single-string'|'string-array'|'space-separated-values',
                        'Name': 'string',
                        'Values': [
                            'string',
                        ]
                    },
                ]
            }
        },
    ],
    AlpnPolicy=[
        'string',
    ],
    MutualAuthentication={
        'Mode': 'string',
        'TrustStoreArn': 'string',
        'IgnoreClientCertificateExpiry': True|False,
        'TrustStoreAssociationStatus': 'active'|'removed',
        'AdvertiseTrustStoreCaNames': 'on'|'off'
    }
)
type ListenerArn:

string

param ListenerArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the listener.

type Port:

integer

param Port:

The port for connections from clients to the load balancer. You can't specify a port for a Gateway Load Balancer.

type Protocol:

string

param Protocol:

The protocol for connections from clients to the load balancer. Application Load Balancers support the HTTP and HTTPS protocols. Network Load Balancers support the TCP, TLS, UDP, and TCP_UDP protocols. You can’t change the protocol to UDP or TCP_UDP if dual-stack mode is enabled. You can't specify a protocol for a Gateway Load Balancer.

type SslPolicy:

string

param SslPolicy:

[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.

For more information, see Security policies in the Application Load Balancers Guide or Security policies in the Network Load Balancers Guide.

type Certificates:

list

param Certificates:

[HTTPS and TLS listeners] The default certificate for the listener. You must provide exactly one certificate. Set CertificateArn to the certificate ARN but do not set IsDefault.

  • (dict) --

    Information about an SSL server certificate.

    • CertificateArn (string) --

      The Amazon Resource Name (ARN) of the certificate.

    • IsDefault (boolean) --

      Indicates whether the certificate is the default certificate. Do not set this value when specifying a certificate as an input. This value is not included in the output when describing a listener, but is included when describing listener certificates.

type DefaultActions:

list

param DefaultActions:

The actions for the default rule.

  • (dict) --

    Information about an action.

    Each rule must include exactly one of the following routing actions: forward, fixed-response, or redirect, and it must be the last action to be performed.

    Optionally, a rule for an HTTPS listener can also include one of the following user authentication actions: authenticate-oidc, authenticate-cognito, or jwt-validation.

    • Type (string) -- [REQUIRED]

      The type of action.

    • TargetGroupArn (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.

    • AuthenticateOidcConfig (dict) --

      [HTTPS listeners] Information about an identity provider that is compliant with OpenID Connect (OIDC). Specify only when Type is authenticate-oidc.

      • Issuer (string) -- [REQUIRED]

        The OIDC issuer identifier of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

      • AuthorizationEndpoint (string) -- [REQUIRED]

        The authorization endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

      • TokenEndpoint (string) -- [REQUIRED]

        The token endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

      • UserInfoEndpoint (string) -- [REQUIRED]

        The user info endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

      • ClientId (string) -- [REQUIRED]

        The OAuth 2.0 client identifier.

      • ClientSecret (string) --

        The OAuth 2.0 client secret. This parameter is required if you are creating a rule. If you are modifying a rule, you can omit this parameter if you set UseExistingClientSecret to true.

      • SessionCookieName (string) --

        The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

      • Scope (string) --

        The set of user claims to be requested from the IdP. The default is openid.

        To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

      • SessionTimeout (integer) --

        The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

      • AuthenticationRequestExtraParams (dict) --

        The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

        • (string) --

          • (string) --

      • OnUnauthenticatedRequest (string) --

        The behavior if the user is not authenticated. The following are possible values:

        • deny - Return an HTTP 401 Unauthorized error.

        • allow - Allow the request to be forwarded to the target.

        • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

      • UseExistingClientSecret (boolean) --

        Indicates whether to use the existing client secret when modifying a rule. If you are creating a rule, you can omit this parameter or set it to false.

    • AuthenticateCognitoConfig (dict) --

      [HTTPS listeners] Information for using Amazon Cognito to authenticate users. Specify only when Type is authenticate-cognito.

      • UserPoolArn (string) -- [REQUIRED]

        The Amazon Resource Name (ARN) of the Amazon Cognito user pool.

      • UserPoolClientId (string) -- [REQUIRED]

        The ID of the Amazon Cognito user pool client.

      • UserPoolDomain (string) -- [REQUIRED]

        The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.

      • SessionCookieName (string) --

        The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

      • Scope (string) --

        The set of user claims to be requested from the IdP. The default is openid.

        To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

      • SessionTimeout (integer) --

        The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

      • AuthenticationRequestExtraParams (dict) --

        The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

        • (string) --

          • (string) --

      • OnUnauthenticatedRequest (string) --

        The behavior if the user is not authenticated. The following are possible values:

        • deny - Return an HTTP 401 Unauthorized error.

        • allow - Allow the request to be forwarded to the target.

        • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

    • Order (integer) --

      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.

    • RedirectConfig (dict) --

      [Application Load Balancer] Information for creating a redirect action. Specify only when Type is redirect.

      • Protocol (string) --

        The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You can't redirect HTTPS to HTTP.

      • Port (string) --

        The port. You can specify a value from 1 to 65535 or #{port}.

      • Host (string) --

        The hostname. This component is not percent-encoded. The hostname can contain #{host}.

      • Path (string) --

        The absolute path, starting with the leading "/". This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}.

      • Query (string) --

        The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading "?", as it is automatically added. You can specify any of the reserved keywords.

      • StatusCode (string) -- [REQUIRED]

        The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary (HTTP 302).

    • FixedResponseConfig (dict) --

      [Application Load Balancer] Information for creating an action that returns a custom HTTP response. Specify only when Type is fixed-response.

      • MessageBody (string) --

        The message.

      • StatusCode (string) -- [REQUIRED]

        The HTTP response code (2XX, 4XX, or 5XX).

      • ContentType (string) --

        The content type.

        Valid Values: text/plain | text/css | text/html | application/javascript | application/json

    • ForwardConfig (dict) --

      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.

      • TargetGroups (list) --

        The target groups.

        • (dict) --

          Information about how traffic will be distributed between multiple target groups in a forward rule.

          • TargetGroupArn (string) --

            The Amazon Resource Name (ARN) of the target group.

          • Weight (integer) --

            The weight. The range is 0 to 999.

      • TargetGroupStickinessConfig (dict) --

        The target group stickiness for the rule.

        • Enabled (boolean) --

          Indicates whether target group stickiness is enabled.

        • DurationSeconds (integer) --

          [Application Load Balancers] The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days). You must specify this value when enabling target group stickiness.

    • JwtValidationConfig (dict) --

      [HTTPS listeners] Information for validating JWT access tokens in client requests. Specify only when Type is jwt-validation.

      • JwksEndpoint (string) -- [REQUIRED]

        The JSON Web Key Set (JWKS) endpoint. This endpoint contains JSON Web Keys (JWK) that are used to validate signatures from the provider.

        This must be a full URL, including the HTTPS protocol, the domain, and the path. The maximum length is 256 characters.

      • Issuer (string) -- [REQUIRED]

        The issuer of the JWT. The maximum length is 256 characters.

      • AdditionalClaims (list) --

        Additional claims to validate. The maximum size of the list is 10. We validate the exp, iss, nbf, and iat claims by default.

        • (dict) --

          Information about an additional claim to validate.

          • Format (string) -- [REQUIRED]

            The format of the claim value.

          • Name (string) -- [REQUIRED]

            The name of the claim. You can't specify exp, iss, nbf, or iat because we validate them by default.

          • Values (list) -- [REQUIRED]

            The claim value. The maximum size of the list is 10. Each value can be up to 256 characters in length. If the format is space-separated-values, the values can't include spaces.

            • (string) --

type AlpnPolicy:

list

param AlpnPolicy:

[TLS listeners] The name of the Application-Layer Protocol Negotiation (ALPN) policy. You can specify one policy name. The following are the possible values:

  • HTTP1Only

  • HTTP2Only

  • HTTP2Optional

  • HTTP2Preferred

  • None

For more information, see ALPN policies in the Network Load Balancers Guide.

  • (string) --

type MutualAuthentication:

dict

param MutualAuthentication:

[HTTPS listeners] The mutual authentication configuration information.

  • Mode (string) --

    The client certificate handling method. Options are off, passthrough or verify. The default value is off.

  • TrustStoreArn (string) --

    The Amazon Resource Name (ARN) of the trust store.

  • IgnoreClientCertificateExpiry (boolean) --

    Indicates whether expired client certificates are ignored.

  • TrustStoreAssociationStatus (string) --

    Indicates a shared trust stores association status.

  • AdvertiseTrustStoreCaNames (string) --

    Indicates whether trust store CA certificate names are advertised.

rtype:

dict

returns:

Response Syntax

{
    'Listeners': [
        {
            'ListenerArn': 'string',
            'LoadBalancerArn': 'string',
            'Port': 123,
            'Protocol': 'HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
            'Certificates': [
                {
                    'CertificateArn': 'string',
                    'IsDefault': True|False
                },
            ],
            'SslPolicy': 'string',
            'DefaultActions': [
                {
                    'Type': 'forward'|'authenticate-oidc'|'authenticate-cognito'|'redirect'|'fixed-response'|'jwt-validation',
                    'TargetGroupArn': 'string',
                    'AuthenticateOidcConfig': {
                        'Issuer': 'string',
                        'AuthorizationEndpoint': 'string',
                        'TokenEndpoint': 'string',
                        'UserInfoEndpoint': 'string',
                        'ClientId': 'string',
                        'ClientSecret': 'string',
                        'SessionCookieName': 'string',
                        'Scope': 'string',
                        'SessionTimeout': 123,
                        'AuthenticationRequestExtraParams': {
                            'string': 'string'
                        },
                        'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate',
                        'UseExistingClientSecret': True|False
                    },
                    'AuthenticateCognitoConfig': {
                        'UserPoolArn': 'string',
                        'UserPoolClientId': 'string',
                        'UserPoolDomain': 'string',
                        'SessionCookieName': 'string',
                        'Scope': 'string',
                        'SessionTimeout': 123,
                        'AuthenticationRequestExtraParams': {
                            'string': 'string'
                        },
                        'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate'
                    },
                    'Order': 123,
                    'RedirectConfig': {
                        'Protocol': 'string',
                        'Port': 'string',
                        'Host': 'string',
                        'Path': 'string',
                        'Query': 'string',
                        'StatusCode': 'HTTP_301'|'HTTP_302'
                    },
                    'FixedResponseConfig': {
                        'MessageBody': 'string',
                        'StatusCode': 'string',
                        'ContentType': 'string'
                    },
                    'ForwardConfig': {
                        'TargetGroups': [
                            {
                                'TargetGroupArn': 'string',
                                'Weight': 123
                            },
                        ],
                        'TargetGroupStickinessConfig': {
                            'Enabled': True|False,
                            'DurationSeconds': 123
                        }
                    },
                    'JwtValidationConfig': {
                        'JwksEndpoint': 'string',
                        'Issuer': 'string',
                        'AdditionalClaims': [
                            {
                                'Format': 'single-string'|'string-array'|'space-separated-values',
                                'Name': 'string',
                                'Values': [
                                    'string',
                                ]
                            },
                        ]
                    }
                },
            ],
            'AlpnPolicy': [
                'string',
            ],
            'MutualAuthentication': {
                'Mode': 'string',
                'TrustStoreArn': 'string',
                'IgnoreClientCertificateExpiry': True|False,
                'TrustStoreAssociationStatus': 'active'|'removed',
                'AdvertiseTrustStoreCaNames': 'on'|'off'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • Listeners (list) --

      Information about the modified listener.

      • (dict) --

        Information about a listener.

        • ListenerArn (string) --

          The Amazon Resource Name (ARN) of the listener.

        • LoadBalancerArn (string) --

          The Amazon Resource Name (ARN) of the load balancer.

        • Port (integer) --

          The port on which the load balancer is listening.

        • Protocol (string) --

          The protocol for connections from clients to the load balancer.

        • Certificates (list) --

          [HTTPS or TLS listener] The default certificate for the listener.

          • (dict) --

            Information about an SSL server certificate.

            • CertificateArn (string) --

              The Amazon Resource Name (ARN) of the certificate.

            • IsDefault (boolean) --

              Indicates whether the certificate is the default certificate. Do not set this value when specifying a certificate as an input. This value is not included in the output when describing a listener, but is included when describing listener certificates.

        • SslPolicy (string) --

          [HTTPS or TLS listener] The security policy that defines which protocols and ciphers are supported.

        • DefaultActions (list) --

          The default actions for the listener.

          • (dict) --

            Information about an action.

            Each rule must include exactly one of the following routing actions: forward, fixed-response, or redirect, and it must be the last action to be performed.

            Optionally, a rule for an HTTPS listener can also include one of the following user authentication actions: authenticate-oidc, authenticate-cognito, or jwt-validation.

            • Type (string) --

              The type of action.

            • TargetGroupArn (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.

            • AuthenticateOidcConfig (dict) --

              [HTTPS listeners] Information about an identity provider that is compliant with OpenID Connect (OIDC). Specify only when Type is authenticate-oidc.

              • Issuer (string) --

                The OIDC issuer identifier of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • AuthorizationEndpoint (string) --

                The authorization endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • TokenEndpoint (string) --

                The token endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • UserInfoEndpoint (string) --

                The user info endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.

              • ClientId (string) --

                The OAuth 2.0 client identifier.

              • ClientSecret (string) --

                The OAuth 2.0 client secret. This parameter is required if you are creating a rule. If you are modifying a rule, you can omit this parameter if you set UseExistingClientSecret to true.

              • SessionCookieName (string) --

                The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

              • Scope (string) --

                The set of user claims to be requested from the IdP. The default is openid.

                To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

              • SessionTimeout (integer) --

                The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

              • AuthenticationRequestExtraParams (dict) --

                The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

                • (string) --

                  • (string) --

              • OnUnauthenticatedRequest (string) --

                The behavior if the user is not authenticated. The following are possible values:

                • deny - Return an HTTP 401 Unauthorized error.

                • allow - Allow the request to be forwarded to the target.

                • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

              • UseExistingClientSecret (boolean) --

                Indicates whether to use the existing client secret when modifying a rule. If you are creating a rule, you can omit this parameter or set it to false.

            • AuthenticateCognitoConfig (dict) --

              [HTTPS listeners] Information for using Amazon Cognito to authenticate users. Specify only when Type is authenticate-cognito.

              • UserPoolArn (string) --

                The Amazon Resource Name (ARN) of the Amazon Cognito user pool.

              • UserPoolClientId (string) --

                The ID of the Amazon Cognito user pool client.

              • UserPoolDomain (string) --

                The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.

              • SessionCookieName (string) --

                The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.

              • Scope (string) --

                The set of user claims to be requested from the IdP. The default is openid.

                To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.

              • SessionTimeout (integer) --

                The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).

              • AuthenticationRequestExtraParams (dict) --

                The query parameters (up to 10) to include in the redirect request to the authorization endpoint.

                • (string) --

                  • (string) --

              • OnUnauthenticatedRequest (string) --

                The behavior if the user is not authenticated. The following are possible values:

                • deny - Return an HTTP 401 Unauthorized error.

                • allow - Allow the request to be forwarded to the target.

                • authenticate - Redirect the request to the IdP authorization endpoint. This is the default value.

            • Order (integer) --

              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.

            • RedirectConfig (dict) --

              [Application Load Balancer] Information for creating a redirect action. Specify only when Type is redirect.

              • Protocol (string) --

                The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You can't redirect HTTPS to HTTP.

              • Port (string) --

                The port. You can specify a value from 1 to 65535 or #{port}.

              • Host (string) --

                The hostname. This component is not percent-encoded. The hostname can contain #{host}.

              • Path (string) --

                The absolute path, starting with the leading "/". This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}.

              • Query (string) --

                The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading "?", as it is automatically added. You can specify any of the reserved keywords.

              • StatusCode (string) --

                The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary (HTTP 302).

            • FixedResponseConfig (dict) --

              [Application Load Balancer] Information for creating an action that returns a custom HTTP response. Specify only when Type is fixed-response.

              • MessageBody (string) --

                The message.

              • StatusCode (string) --

                The HTTP response code (2XX, 4XX, or 5XX).

              • ContentType (string) --

                The content type.

                Valid Values: text/plain | text/css | text/html | application/javascript | application/json

            • ForwardConfig (dict) --

              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.

              • TargetGroups (list) --

                The target groups.

                • (dict) --

                  Information about how traffic will be distributed between multiple target groups in a forward rule.

                  • TargetGroupArn (string) --

                    The Amazon Resource Name (ARN) of the target group.

                  • Weight (integer) --

                    The weight. The range is 0 to 999.

              • TargetGroupStickinessConfig (dict) --

                The target group stickiness for the rule.

                • Enabled (boolean) --

                  Indicates whether target group stickiness is enabled.

                • DurationSeconds (integer) --

                  [Application Load Balancers] The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days). You must specify this value when enabling target group stickiness.

            • JwtValidationConfig (dict) --

              [HTTPS listeners] Information for validating JWT access tokens in client requests. Specify only when Type is jwt-validation.

              • JwksEndpoint (string) --

                The JSON Web Key Set (JWKS) endpoint. This endpoint contains JSON Web Keys (JWK) that are used to validate signatures from the provider.

                This must be a full URL, including the HTTPS protocol, the domain, and the path. The maximum length is 256 characters.

              • Issuer (string) --

                The issuer of the JWT. The maximum length is 256 characters.

              • AdditionalClaims (list) --

                Additional claims to validate. The maximum size of the list is 10. We validate the exp, iss, nbf, and iat claims by default.

                • (dict) --

                  Information about an additional claim to validate.

                  • Format (string) --

                    The format of the claim value.

                  • Name (string) --

                    The name of the claim. You can't specify exp, iss, nbf, or iat because we validate them by default.

                  • Values (list) --

                    The claim value. The maximum size of the list is 10. Each value can be up to 256 characters in length. If the format is space-separated-values, the values can't include spaces.

                    • (string) --

        • AlpnPolicy (list) --

          [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.

          • (string) --

        • MutualAuthentication (dict) --

          The mutual authentication configuration information.

          • Mode (string) --

            The client certificate handling method. Options are off, passthrough or verify. The default value is off.

          • TrustStoreArn (string) --

            The Amazon Resource Name (ARN) of the trust store.

          • IgnoreClientCertificateExpiry (boolean) --

            Indicates whether expired client certificates are ignored.

          • TrustStoreAssociationStatus (string) --

            Indicates a shared trust stores association status.

          • AdvertiseTrustStoreCaNames (string) --

            Indicates whether trust store CA certificate names are advertised.

ModifyTargetGroup (updated) Link ¶
Changes (request, response)
Request
{'HealthCheckProtocol': {'QUIC', 'TCP_QUIC'}}
Response
{'TargetGroups': {'HealthCheckProtocol': {'QUIC', 'TCP_QUIC'},
                  'Protocol': {'QUIC', 'TCP_QUIC'}}}

Modifies the health checks used when evaluating the health state of the targets in the specified target group.

See also: AWS API Documentation

Request Syntax

client.modify_target_group(
    TargetGroupArn='string',
    HealthCheckProtocol='HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
    HealthCheckPort='string',
    HealthCheckPath='string',
    HealthCheckEnabled=True|False,
    HealthCheckIntervalSeconds=123,
    HealthCheckTimeoutSeconds=123,
    HealthyThresholdCount=123,
    UnhealthyThresholdCount=123,
    Matcher={
        'HttpCode': 'string',
        'GrpcCode': 'string'
    }
)
type TargetGroupArn:

string

param TargetGroupArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the target group.

type HealthCheckProtocol:

string

param HealthCheckProtocol:

The protocol the load balancer uses when performing health checks on targets. For Application Load Balancers, the default is HTTP. For Network Load Balancers and Gateway Load Balancers, the default is TCP. The TCP protocol is not supported for health checks if the protocol of the target group is HTTP or HTTPS. It is supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health checks.

type HealthCheckPort:

string

param HealthCheckPort:

The port the load balancer uses when performing health checks on targets.

type HealthCheckPath:

string

param HealthCheckPath:

[HTTP/HTTPS health checks] The destination for health checks on the targets.

[HTTP1 or HTTP2 protocol version] The ping path. The default is /.

[GRPC protocol version] The path of a custom health check method with the format /package.service/method. The default is /Amazon Web Services.ALB/healthcheck.

type HealthCheckEnabled:

boolean

param HealthCheckEnabled:

Indicates whether health checks are enabled. If the target type is lambda, health checks are disabled by default but can be enabled. If the target type is instance, ip, or alb, health checks are always enabled and can't be disabled.

type HealthCheckIntervalSeconds:

integer

param HealthCheckIntervalSeconds:

The approximate amount of time, in seconds, between health checks of an individual target.

type HealthCheckTimeoutSeconds:

integer

param HealthCheckTimeoutSeconds:

[HTTP/HTTPS health checks] The amount of time, in seconds, during which no response means a failed health check.

type HealthyThresholdCount:

integer

param HealthyThresholdCount:

The number of consecutive health checks successes required before considering an unhealthy target healthy.

type UnhealthyThresholdCount:

integer

param UnhealthyThresholdCount:

The number of consecutive health check failures required before considering the target unhealthy.

type Matcher:

dict

param Matcher:

[HTTP/HTTPS health checks] The HTTP or gRPC codes to use when checking for a successful response from a target. For target groups with a protocol of TCP, TCP_UDP, UDP or TLS the range is 200-599. For target groups with a protocol of HTTP or HTTPS, the range is 200-499. For target groups with a protocol of GENEVE, the range is 200-399.

  • HttpCode (string) --

    For Application Load Balancers, you can specify values between 200 and 499, with the default value being 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

    For Network Load Balancers, you can specify values between 200 and 599, with the default value being 200-399. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

    For Gateway Load Balancers, this must be "200–399".

    Note that when using shorthand syntax, some values such as commas need to be escaped.

  • GrpcCode (string) --

    You can specify values between 0 and 99. You can specify multiple values (for example, "0,1") or a range of values (for example, "0-5"). The default value is 12.

rtype:

dict

returns:

Response Syntax

{
    'TargetGroups': [
        {
            'TargetGroupArn': 'string',
            'TargetGroupName': 'string',
            'Protocol': 'HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
            'Port': 123,
            'VpcId': 'string',
            'HealthCheckProtocol': 'HTTP'|'HTTPS'|'TCP'|'TLS'|'UDP'|'TCP_UDP'|'GENEVE'|'QUIC'|'TCP_QUIC',
            'HealthCheckPort': 'string',
            'HealthCheckEnabled': True|False,
            'HealthCheckIntervalSeconds': 123,
            'HealthCheckTimeoutSeconds': 123,
            'HealthyThresholdCount': 123,
            'UnhealthyThresholdCount': 123,
            'HealthCheckPath': 'string',
            'Matcher': {
                'HttpCode': 'string',
                'GrpcCode': 'string'
            },
            'LoadBalancerArns': [
                'string',
            ],
            'TargetType': 'instance'|'ip'|'lambda'|'alb',
            'ProtocolVersion': 'string',
            'IpAddressType': 'ipv4'|'ipv6'
        },
    ]
}

Response Structure

  • (dict) --

    • TargetGroups (list) --

      Information about the modified target group.

      • (dict) --

        Information about a target group.

        • TargetGroupArn (string) --

          The Amazon Resource Name (ARN) of the target group.

        • TargetGroupName (string) --

          The name of the target group.

        • Protocol (string) --

          The protocol to use for routing traffic to the targets.

        • Port (integer) --

          The port on which the targets are listening. This parameter is not used if the target is a Lambda function.

        • VpcId (string) --

          The ID of the VPC for the targets.

        • HealthCheckProtocol (string) --

          The protocol to use to connect with the target. The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health checks.

        • HealthCheckPort (string) --

          The port to use to connect with the target.

        • HealthCheckEnabled (boolean) --

          Indicates whether health checks are enabled.

        • HealthCheckIntervalSeconds (integer) --

          The approximate amount of time, in seconds, between health checks of an individual target.

        • HealthCheckTimeoutSeconds (integer) --

          The amount of time, in seconds, during which no response means a failed health check.

        • HealthyThresholdCount (integer) --

          The number of consecutive health checks successes required before considering an unhealthy target healthy.

        • UnhealthyThresholdCount (integer) --

          The number of consecutive health check failures required before considering the target unhealthy.

        • HealthCheckPath (string) --

          The destination for health checks on the targets.

        • Matcher (dict) --

          The HTTP or gRPC codes to use when checking for a successful response from a target.

          • HttpCode (string) --

            For Application Load Balancers, you can specify values between 200 and 499, with the default value being 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

            For Network Load Balancers, you can specify values between 200 and 599, with the default value being 200-399. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

            For Gateway Load Balancers, this must be "200–399".

            Note that when using shorthand syntax, some values such as commas need to be escaped.

          • GrpcCode (string) --

            You can specify values between 0 and 99. You can specify multiple values (for example, "0,1") or a range of values (for example, "0-5"). The default value is 12.

        • LoadBalancerArns (list) --

          The Amazon Resource Name (ARN) of the load balancer that routes traffic to this target group. You can use each target group with only one load balancer.

          • (string) --

        • TargetType (string) --

          The type of target that you must specify when registering targets with this target group. The possible values are instance (register targets by instance ID), ip (register targets by IP address), lambda (register a single Lambda function as a target), or alb (register a single Application Load Balancer as a target).

        • ProtocolVersion (string) --

          [HTTP/HTTPS protocol] The protocol version. The possible values are GRPC, HTTP1, and HTTP2.

        • IpAddressType (string) --

          The IP address type. The default value is ipv4.

RegisterTargets (updated) Link ¶
Changes (request)
{'Targets': {'QuicServerId': 'string'}}

Registers the specified targets with the specified target group.

If the target is an EC2 instance, it must be in the running state when you register it.

By default, the load balancer routes requests to registered targets using the protocol and port for the target group. Alternatively, you can override the port for a target when you register it. You can register each EC2 instance or IP address with the same target group multiple times using different ports.

For more information, see the following:

See also: AWS API Documentation

Request Syntax

client.register_targets(
    TargetGroupArn='string',
    Targets=[
        {
            'Id': 'string',
            'Port': 123,
            'AvailabilityZone': 'string',
            'QuicServerId': 'string'
        },
    ]
)
type TargetGroupArn:

string

param TargetGroupArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the target group.

type Targets:

list

param Targets:

[REQUIRED]

The targets.

  • (dict) --

    Information about a target.

    • Id (string) -- [REQUIRED]

      The ID of the target. If the target type of the target group is instance, specify an instance ID. If the target type is ip, specify an IP address. If the target type is lambda, specify the ARN of the Lambda function. If the target type is alb, specify the ARN of the Application Load Balancer target.

    • Port (integer) --

      The port on which the target is listening. If the target group protocol is GENEVE, the supported port is 6081. If the target type is alb, the targeted Application Load Balancer must have at least one listener whose port matches the target group port. This parameter is not used if the target is a Lambda function.

    • AvailabilityZone (string) --

      An Availability Zone or all. This determines whether the target receives traffic from the load balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load balancer.

      For Application Load Balancer target groups, the specified Availability Zone value is only applicable when cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all.

      This parameter is not supported if the target type of the target group is instance or alb.

      If the target type is ip and the IP address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this parameter is optional. If the IP address is outside the VPC, this parameter is required.

      For Application Load Balancer target groups with cross-zone load balancing off, if the target type is ip and the IP address is outside of the VPC for the target group, this should be an Availability Zone inside the VPC for the target group.

      If the target type is lambda, this parameter is optional and the only supported value is all.

    • QuicServerId (string) --

      The server ID for the targets. This value is required if the protocol is QUIC or TCP_QUIC and can't be used with other protocols.

      The ID consists of the 0x prefix followed by 16 hexadecimal characters. Any letters must be lowercase. The value must be unique at the listener level. You can't modify the server ID for a registered target. You must deregister the target and then provide a new server ID when you register the target again.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --