Interface IRequestContext
Configure what must be included in the requestContext
.
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IRequestContext
Syntax (vb)
Public Interface IRequestContext
Remarks
More details can be found at mapping templates documentation.
ExampleMetadata: fixture=stepfunctions infused
Examples
new StepFunctionsRestApi(this, "StepFunctionsRestApi", new StepFunctionsRestApiProps {
StateMachine = machine,
Headers = true,
Path = false,
Querystring = false,
Authorizer = false,
RequestContext = new RequestContext {
Caller = true,
User = true
}
});
Synopsis
Properties
AccountId | Represents the information of $context.identity.accountId. |
ApiId | Represents the information of $context.apiId. |
ApiKey | Represents the information of $context.identity.apiKey. |
AuthorizerPrincipalId | Represents the information of $context.authorizer.principalId. |
Caller | Represents the information of $context.identity.caller. |
CognitoAuthenticationProvider | Represents the information of $context.identity.cognitoAuthenticationProvider. |
CognitoAuthenticationType | Represents the information of $context.identity.cognitoAuthenticationType. |
CognitoIdentityId | Represents the information of $context.identity.cognitoIdentityId. |
CognitoIdentityPoolId | Represents the information of $context.identity.cognitoIdentityPoolId. |
HttpMethod | Represents the information of $context.httpMethod. |
RequestId | Represents the information of $context.requestId. |
ResourceId | Represents the information of $context.resourceId. |
ResourcePath | Represents the information of $context.resourcePath. |
SourceIp | Represents the information of $context.identity.sourceIp. |
Stage | Represents the information of $context.stage. |
User | Represents the information of $context.identity.user. |
UserAgent | Represents the information of $context.identity.userAgent. |
UserArn | Represents the information of $context.identity.userArn. |
Properties
AccountId
Represents the information of $context.identity.accountId.
virtual Nullable<bool> AccountId { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the AWS account of the API owner should be included in the request context
Default: false
ApiId
Represents the information of $context.apiId.
virtual Nullable<bool> ApiId { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the identifier API Gateway assigns to your API should be included in the request context.
Default: false
ApiKey
Represents the information of $context.identity.apiKey.
virtual Nullable<bool> ApiKey { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the API key associated with the request should be included in request context.
Default: false
AuthorizerPrincipalId
Represents the information of $context.authorizer.principalId.
virtual Nullable<bool> AuthorizerPrincipalId { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the principal user identifier associated with the token sent by the client and returned from an API Gateway Lambda authorizer should be included in the request context.
Default: false
Caller
Represents the information of $context.identity.caller.
virtual Nullable<bool> Caller { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the principal identifier of the caller that signed the request should be included in the request context. Supported for resources that use IAM authorization.
Default: false
CognitoAuthenticationProvider
Represents the information of $context.identity.cognitoAuthenticationProvider.
virtual Nullable<bool> CognitoAuthenticationProvider { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the list of the Amazon Cognito authentication providers used by the caller making the request should be included in the request context. Available only if the request was signed with Amazon Cognito credentials.
Default: false
CognitoAuthenticationType
Represents the information of $context.identity.cognitoAuthenticationType.
virtual Nullable<bool> CognitoAuthenticationType { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the Amazon Cognito authentication type of the caller making the request should be included in the request context. Available only if the request was signed with Amazon Cognito credentials. Possible values include authenticated for authenticated identities and unauthenticated for unauthenticated identities.
Default: false
CognitoIdentityId
Represents the information of $context.identity.cognitoIdentityId.
virtual Nullable<bool> CognitoIdentityId { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the Amazon Cognito identity ID of the caller making the request should be included in the request context. Available only if the request was signed with Amazon Cognito credentials.
Default: false
CognitoIdentityPoolId
Represents the information of $context.identity.cognitoIdentityPoolId.
virtual Nullable<bool> CognitoIdentityPoolId { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the Amazon Cognito identity pool ID of the caller making the request should be included in the request context. Available only if the request was signed with Amazon Cognito credentials.
Default: false
HttpMethod
Represents the information of $context.httpMethod.
virtual Nullable<bool> HttpMethod { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the HTTP method used should be included in the request context. Valid values include: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.
Default: false
RequestId
Represents the information of $context.requestId.
virtual Nullable<bool> RequestId { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the ID for the request should be included in the request context.
Default: false
ResourceId
Represents the information of $context.resourceId.
virtual Nullable<bool> ResourceId { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the identifier that API Gateway assigns to your resource should be included in the request context.
Default: false
ResourcePath
Represents the information of $context.resourcePath.
virtual Nullable<bool> ResourcePath { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the path to the resource should be included in the request context.
Default: false
SourceIp
Represents the information of $context.identity.sourceIp.
virtual Nullable<bool> SourceIp { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the source IP address of the immediate TCP connection making the request to API Gateway endpoint should be included in the request context.
Default: false
Stage
Represents the information of $context.stage.
virtual Nullable<bool> Stage { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the deployment stage of the API request should be included in the request context.
Default: false
User
Represents the information of $context.identity.user.
virtual Nullable<bool> User { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the principal identifier of the user that will be authorized should be included in the request context. Supported for resources that use IAM authorization.
Default: false
UserAgent
Represents the information of $context.identity.userAgent.
virtual Nullable<bool> UserAgent { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the User-Agent header of the API caller should be included in the request context.
Default: false
UserArn
Represents the information of $context.identity.userArn.
virtual Nullable<bool> UserArn { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Whether the Amazon Resource Name (ARN) of the effective user identified after authentication should be included in the request context.
Default: false