@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.092Z") @Stability(value=Stable) public class CfnAuthorizer extends CfnResource implements IInspectable
The AWS::ApiGateway::Authorizer resource creates an authorization layer that API Gateway activates for methods that have authorization enabled. API Gateway activates the authorizer when a client calls those methods.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigateway.*;
CfnAuthorizer cfnAuthorizer = CfnAuthorizer.Builder.create(this, "MyCfnAuthorizer")
.name("name")
.restApiId("restApiId")
.type("type")
// the properties below are optional
.authorizerCredentials("authorizerCredentials")
.authorizerResultTtlInSeconds(123)
.authorizerUri("authorizerUri")
.authType("authType")
.identitySource("identitySource")
.identityValidationExpression("identityValidationExpression")
.providerArns(List.of("providerArns"))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnAuthorizer.Builder
A fluent builder for
CfnAuthorizer. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnAuthorizer(software.constructs.Construct scope,
String id,
CfnAuthorizerProps props)
Create a new `AWS::ApiGateway::Authorizer`.
|
protected |
CfnAuthorizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnAuthorizer(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrAuthorizerId()
The ID for the authorizer.
|
String |
getAuthorizerCredentials()
The credentials that are required for the authorizer.
|
Number |
getAuthorizerResultTtlInSeconds()
The time-to-live (TTL) period, in seconds, that specifies how long API Gateway caches authorizer results.
|
String |
getAuthorizerUri()
The authorizer's Uniform Resource Identifier (URI).
|
String |
getAuthType()
An optional customer-defined field that's used in OpenApi imports and exports without functional impact.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getIdentitySource()
The source of the identity in an incoming request.
|
String |
getIdentityValidationExpression()
A validation expression for the incoming identity.
|
String |
getName()
The name of the authorizer.
|
List<String> |
getProviderArns()
A list of the Amazon Cognito user pool Amazon Resource Names (ARNs) to associate with this authorizer.
|
String |
getRestApiId()
The ID of the `RestApi` resource that API Gateway creates the authorizer in.
|
String |
getType()
The type of authorizer.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAuthorizerCredentials(String value)
The credentials that are required for the authorizer.
|
void |
setAuthorizerResultTtlInSeconds(Number value)
The time-to-live (TTL) period, in seconds, that specifies how long API Gateway caches authorizer results.
|
void |
setAuthorizerUri(String value)
The authorizer's Uniform Resource Identifier (URI).
|
void |
setAuthType(String value)
An optional customer-defined field that's used in OpenApi imports and exports without functional impact.
|
void |
setIdentitySource(String value)
The source of the identity in an incoming request.
|
void |
setIdentityValidationExpression(String value)
A validation expression for the incoming identity.
|
void |
setName(String value)
The name of the authorizer.
|
void |
setProviderArns(List<String> value)
A list of the Amazon Cognito user pool Amazon Resource Names (ARNs) to associate with this authorizer.
|
void |
setRestApiId(String value)
The ID of the `RestApi` resource that API Gateway creates the authorizer in.
|
void |
setType(String value)
The type of authorizer.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnAuthorizer(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnAuthorizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnAuthorizer(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnAuthorizerProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrAuthorizerId()
For example: abc123 .
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getName()
@Stability(value=Stable)
public void setName(@NotNull
String value)
@Stability(value=Stable) @NotNull public String getRestApiId()
@Stability(value=Stable)
public void setRestApiId(@NotNull
String value)
@Stability(value=Stable) @NotNull public String getType()
TOKEN : A custom authorizer that uses a Lambda function.COGNITO_USER_POOLS : An authorizer that uses Amazon Cognito user pools.REQUEST : An authorizer that uses a Lambda function using incoming request parameters.@Stability(value=Stable)
public void setType(@NotNull
String value)
TOKEN : A custom authorizer that uses a Lambda function.COGNITO_USER_POOLS : An authorizer that uses Amazon Cognito user pools.REQUEST : An authorizer that uses a Lambda function using incoming request parameters.@Stability(value=Stable) @Nullable public String getAuthorizerCredentials()
To specify an IAM role that API Gateway assumes, specify the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
@Stability(value=Stable)
public void setAuthorizerCredentials(@Nullable
String value)
To specify an IAM role that API Gateway assumes, specify the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
@Stability(value=Stable) @Nullable public Number getAuthorizerResultTtlInSeconds()
If you specify a value greater than 0, API Gateway caches the authorizer responses. By default, API Gateway sets this property to 300. The maximum value is 3600, or 1 hour.
@Stability(value=Stable)
public void setAuthorizerResultTtlInSeconds(@Nullable
Number value)
If you specify a value greater than 0, API Gateway caches the authorizer responses. By default, API Gateway sets this property to 300. The maximum value is 3600, or 1 hour.
@Stability(value=Stable) @Nullable public String getAuthorizerUri()
If you specify TOKEN for the authorizer's Type property, specify a Lambda function URI that has the form arn:aws:apigateway: *region* :lambda:path/ *path* . The path usually has the form /2015-03-31/functions/ LambdaFunctionARN /invocations.
@Stability(value=Stable)
public void setAuthorizerUri(@Nullable
String value)
If you specify TOKEN for the authorizer's Type property, specify a Lambda function URI that has the form arn:aws:apigateway: *region* :lambda:path/ *path* . The path usually has the form /2015-03-31/functions/ LambdaFunctionARN /invocations.
@Stability(value=Stable) @Nullable public String getAuthType()
@Stability(value=Stable)
public void setAuthType(@Nullable
String value)
@Stability(value=Stable) @Nullable public String getIdentitySource()
If you specify TOKEN or COGNITO_USER_POOLS for the Type property, this property is required. Specify a header mapping expression using the form method.request.header. *name* , where name is the name of a custom authorization header that clients submit as part of their requests.
If you specify REQUEST for the Type property, this property is required when authorization caching is enabled. Specify a comma-separated string of one or more mapping expressions of the specified request parameter using the form method.request.parameter. *name* . For supported parameter types, see Configure Lambda Authorizer Using the API Gateway Console in the API Gateway Developer Guide .
@Stability(value=Stable)
public void setIdentitySource(@Nullable
String value)
If you specify TOKEN or COGNITO_USER_POOLS for the Type property, this property is required. Specify a header mapping expression using the form method.request.header. *name* , where name is the name of a custom authorization header that clients submit as part of their requests.
If you specify REQUEST for the Type property, this property is required when authorization caching is enabled. Specify a comma-separated string of one or more mapping expressions of the specified request parameter using the form method.request.parameter. *name* . For supported parameter types, see Configure Lambda Authorizer Using the API Gateway Console in the API Gateway Developer Guide .
@Stability(value=Stable) @Nullable public String getIdentityValidationExpression()
If you specify TOKEN for the authorizer's Type property, specify a regular expression. API Gateway uses the expression to attempt to match the incoming client token, and proceeds if the token matches. If the token doesn't match, API Gateway responds with a 401 (unauthorized request) error code.
@Stability(value=Stable)
public void setIdentityValidationExpression(@Nullable
String value)
If you specify TOKEN for the authorizer's Type property, specify a regular expression. API Gateway uses the expression to attempt to match the incoming client token, and proceeds if the token matches. If the token doesn't match, API Gateway responds with a 401 (unauthorized request) error code.
@Stability(value=Stable) @Nullable public List<String> getProviderArns()
Required if you specify COGNITO_USER_POOLS as the authorizer Type . For more information, see Use Amazon Cognito User Pools in the API Gateway Developer Guide .
@Stability(value=Stable)
public void setProviderArns(@Nullable
List<String> value)
Required if you specify COGNITO_USER_POOLS as the authorizer Type . For more information, see Use Amazon Cognito User Pools in the API Gateway Developer Guide .
Copyright © 2022. All rights reserved.