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
ConstructorsModifierConstructorDescriptionprotectedAccessLogField(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedAccessLogField(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe API owner's AWS account ID.static StringThe identifier API Gateway assigns to your API.static StringcontextAuthorizer(String property) The stringified value of the specified key-value pair of thecontextmap returned from an API Gateway Lambda authorizer function.static StringcontextAuthorizerClaims(String property) A property of the claims returned from the Amazon Cognito user pool after the method caller is successfully authenticated.static StringThe authorizer latency in ms.static StringThe 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 StringThe AWS endpoint's request ID.static StringThe full domain name used to invoke the API.static StringThe first label of the$context.domainName.static StringA string containing an API Gateway error message.static StringThe quoted value of $context.error.message, namely "$context.error.message".static StringA type of GatewayResponse.static StringA string containing a detailed validation error message.static StringThe extended ID that API Gateway assigns to the API request, which contains more useful information for debugging/troubleshooting.static StringThe HTTP method used.static StringThe AWS account ID associated with the request.static StringFor API methods that require an API key, this variable is the API key associated with the method request.static StringThe API key ID associated with an API request that requires an API key.static StringThe principal identifier of the caller making the request.static StringThe Amazon Cognito authentication provider used by the caller making the request.static StringThe Amazon Cognito authentication type of the caller making the request.static StringThe Amazon Cognito identity ID of the caller making the request.static StringThe Amazon Cognito identity pool ID of the caller making the request.static StringThe AWS organization ID.static StringThe source IP address of the TCP connection making the request to API Gateway.static StringThe principal identifier of the user making the request.static StringThe User-Agent header of the API caller.static StringThe Amazon Resource Name (ARN) of the effective user identified after authentication.static StringThe integration latency in ms.static StringFor Lambda proxy integration, this parameter represents the status code returned from AWS Lambda, not from the backend Lambda function.static StringThe request path.static StringThe request protocol, for example, HTTP/1.1.static StringThe ID that API Gateway assigns to the API request.static StringcontextRequestOverrideHeader(String headerName) The request header override.static StringcontextRequestOverridePath(String pathName) The request path override.static StringcontextRequestOverrideQuerystring(String querystringName) The request query string override.static StringThe CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm).static StringThe Epoch-formatted request time.static StringThe identifier that API Gateway assigns to your resource.static StringThe path to your resource.static StringThe response latency in ms.static StringThe response payload length.static StringcontextResponseOverrideHeader(String headerName) The response header override.static StringThe response status code override.static StringThe deployment stage of the API request (for example,BetaorProd).static StringThe method response status.static StringThe response received from AWS WAF:WAF_ALLOWorWAF_BLOCK.static StringThe complete ARN of the web ACL that is used to decide whether to allow or block the request.static StringThe 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, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 thecontextmap 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
Hostheader. -
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-Forheader 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,BetaorProd). -
contextStatus
The method response status. -
contextWafResponseCode
The response received from AWS WAF:WAF_ALLOWorWAF_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.
-