Class AccessLogField
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
Example:
AccessLogFormat.custom(JSON.stringify(Map.of( "requestId", AccessLogField.contextRequestId(), "sourceIp", AccessLogField.contextIdentitySourceIp(), "method", AccessLogField.contextHttpMethod(), "userContext", Map.of( "sub", AccessLogField.contextAuthorizerClaims("sub"), "email", AccessLogField.contextAuthorizerClaims("email")))));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AccessLogField
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
AccessLogField
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
The API owner's AWS account ID.static String
The identifier API Gateway assigns to your API.static String
contextAuthorizer
(String property) The stringified value of the specified key-value pair of thecontext
map returned from an API Gateway Lambda authorizer function.static String
contextAuthorizerClaims
(String property) A property of the claims returned from the Amazon Cognito user pool after the method caller is successfully authenticated.static String
The authorizer latency in ms.static String
The principal user identification associated with the token sent by the client and returned from an API Gateway Lambda authorizer (formerly known as a custom authorizer).static String
The AWS endpoint's request ID.static String
The full domain name used to invoke the API.static String
The first label of the$context.domainName
.static String
A string containing an API Gateway error message.static String
The quoted value of $context.error.message, namely "$context.error.message".static String
A type of GatewayResponse.static String
A string containing a detailed validation error message.static String
The extended ID that API Gateway assigns to the API request, which contains more useful information for debugging/troubleshooting.static String
The HTTP method used.static String
The AWS account ID associated with the request.static String
For API methods that require an API key, this variable is the API key associated with the method request.static String
The API key ID associated with an API request that requires an API key.static String
The principal identifier of the caller making the request.static String
The Amazon Cognito authentication provider used by the caller making the request.static String
The Amazon Cognito authentication type of the caller making the request.static String
The Amazon Cognito identity ID of the caller making the request.static String
The Amazon Cognito identity pool ID of the caller making the request.static String
The AWS organization ID.static String
The source IP address of the TCP connection making the request to API Gateway.static String
The principal identifier of the user making the request.static String
The User-Agent header of the API caller.static String
The Amazon Resource Name (ARN) of the effective user identified after authentication.static String
The integration latency in ms.static String
For Lambda proxy integration, this parameter represents the status code returned from AWS Lambda, not from the backend Lambda function.static String
The request path.static String
The request protocol, for example, HTTP/1.1.static String
The ID that API Gateway assigns to the API request.static String
contextRequestOverrideHeader
(String headerName) The request header override.static String
contextRequestOverridePath
(String pathName) The request path override.static String
contextRequestOverrideQuerystring
(String querystringName) The request query string override.static String
The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm).static String
The Epoch-formatted request time.static String
The identifier that API Gateway assigns to your resource.static String
The path to your resource.static String
The response latency in ms.static String
The response payload length.static String
contextResponseOverrideHeader
(String headerName) The response header override.static String
The response status code override.static String
The deployment stage of the API request (for example,Beta
orProd
).static String
The method response status.static String
The response received from AWS WAF:WAF_ALLOW
orWAF_BLOCK
.static String
The complete ARN of the web ACL that is used to decide whether to allow or block the request.static String
The trace ID for the X-Ray trace.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
AccessLogField
protected AccessLogField(software.amazon.jsii.JsiiObjectRef objRef) -
AccessLogField
protected AccessLogField(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
AccessLogField
@Stability(Stable) public AccessLogField()
-
-
Method Details
-
contextAccountId
The API owner's AWS account ID. -
contextApiId
The identifier API Gateway assigns to your API. -
contextAuthorizer
The stringified value of the specified key-value pair of thecontext
map returned from an API Gateway Lambda authorizer function.- Parameters:
property
- key of the context map. This parameter is required.- See Also:
-
contextAuthorizerClaims
A property of the claims returned from the Amazon Cognito user pool after the method caller is successfully authenticated.- Parameters:
property
- A property key of the claims. This parameter is required.- See Also:
-
contextAuthorizerIntegrationLatency
The authorizer latency in ms. -
contextAuthorizerPrincipalId
The principal user identification associated with the token sent by the client and returned from an API Gateway Lambda authorizer (formerly known as a custom authorizer). -
contextAwsEndpointRequestId
The AWS endpoint's request ID. -
contextDomainName
The full domain name used to invoke the API.This should be the same as the incoming
Host
header. -
contextDomainPrefix
The first label of the$context.domainName
. This is often used as a caller/customer identifier. -
contextErrorMessage
A string containing an API Gateway error message. -
contextErrorMessageString
The quoted value of $context.error.message, namely "$context.error.message". -
contextErrorResponseType
A type of GatewayResponse.This variable can only be used for simple variable substitution in a GatewayResponse body-mapping template, which is not processed by the Velocity Template Language engine, and in access logging.
-
contextErrorValidationErrorString
A string containing a detailed validation error message. -
contextExtendedRequestId
The extended ID that API Gateway assigns to the API request, which contains more useful information for debugging/troubleshooting. -
contextHttpMethod
The HTTP method used.Valid values include:
DELETE
,GET
,HEAD
,OPTIONS
,PATCH
,POST
, andPUT
. -
contextIdentityAccountId
The AWS account ID associated with the request. -
contextIdentityApiKey
For API methods that require an API key, this variable is the API key associated with the method request.For methods that don't require an API key, this variable is
-
contextIdentityApiKeyId
The API key ID associated with an API request that requires an API key. -
contextIdentityCaller
The principal identifier of the caller making the request. -
contextIdentityCognitoAuthenticationProvider
The Amazon Cognito authentication provider used by the caller making the request.Available only if the request was signed with Amazon Cognito credentials.
-
contextIdentityCognitoAuthenticationType
The Amazon Cognito authentication type of the caller making the request.Available only if the request was signed with Amazon Cognito credentials.
-
contextIdentityCognitoIdentityId
The Amazon Cognito identity ID of the caller making the request.Available only if the request was signed with Amazon Cognito credentials.
-
contextIdentityCognitoIdentityPoolId
The Amazon Cognito identity pool ID of the caller making the request.Available only if the request was signed with Amazon Cognito credentials.
-
contextIdentityPrincipalOrgId
The AWS organization ID. -
contextIdentitySourceIp
The source IP address of the TCP connection making the request to API Gateway.Warning: You should not trust this value if there is any chance that the
X-Forwarded-For
header could be forged. -
contextIdentityUser
The principal identifier of the user making the request.Used in Lambda authorizers.
-
contextIdentityUserAgent
The User-Agent header of the API caller. -
contextIdentityUserArn
The Amazon Resource Name (ARN) of the effective user identified after authentication. -
contextIntegrationLatency
The integration latency in ms. -
contextIntegrationStatus
For Lambda proxy integration, this parameter represents the status code returned from AWS Lambda, not from the backend Lambda function. -
contextPath
The request path.For example, for a non-proxy request URL of https://{rest-api-id.execute-api.{region}.amazonaws.com/{stage}/root/child, this value is /{stage}/root/child.
-
contextProtocol
The request protocol, for example, HTTP/1.1. -
contextRequestId
The ID that API Gateway assigns to the API request. -
contextRequestOverrideHeader
@Stability(Stable) @NotNull public static String contextRequestOverrideHeader(@NotNull String headerName) The request header override.If this parameter is defined, it contains the headers to be used instead of the HTTP Headers that are defined in the Integration Request pane.
- Parameters:
headerName
- This parameter is required.- See Also:
-
contextRequestOverridePath
@Stability(Stable) @NotNull public static String contextRequestOverridePath(@NotNull String pathName) The request path override.If this parameter is defined, it contains the request path to be used instead of the URL Path Parameters that are defined in the Integration Request pane.
- Parameters:
pathName
- This parameter is required.- See Also:
-
contextRequestOverrideQuerystring
@Stability(Stable) @NotNull public static String contextRequestOverrideQuerystring(@NotNull String querystringName) The request query string override.If this parameter is defined, it contains the request query strings to be used instead of the URL Query String Parameters that are defined in the Integration Request pane.
- Parameters:
querystringName
- This parameter is required.
-
contextRequestTime
The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm). -
contextRequestTimeEpoch
The Epoch-formatted request time. -
contextResourceId
The identifier that API Gateway assigns to your resource. -
contextResourcePath
The path to your resource.For example, for the non-proxy request URI of
https://{rest-api-id.execute-api.{region}.amazonaws.com/{stage}/root/child
, The $context.resourcePath value is/root/child
. -
contextResponseLatency
The response latency in ms. -
contextResponseLength
The response payload length. -
contextResponseOverrideHeader
@Stability(Stable) @NotNull public static String contextResponseOverrideHeader(@NotNull String headerName) The response header override.If this parameter is defined, it contains the header to be returned instead of the Response header that is defined as the Default mapping in the Integration Response pane.
- Parameters:
headerName
- This parameter is required.- See Also:
-
contextResponseOverrideStatus
The response status code override.If this parameter is defined, it contains the status code to be returned instead of the Method response status that is defined as the Default mapping in the Integration Response pane.
-
contextStage
The deployment stage of the API request (for example,Beta
orProd
). -
contextStatus
The method response status. -
contextWafResponseCode
The response received from AWS WAF:WAF_ALLOW
orWAF_BLOCK
.Will not be set if the stage is not associated with a web ACL.
-
contextWebaclArn
The complete ARN of the web ACL that is used to decide whether to allow or block the request.Will not be set if the stage is not associated with a web ACL.
-
contextXrayTraceId
The trace ID for the X-Ray trace.
-