Table of Contents

Class StepFunctionsRestApiProps

Namespace
Amazon.CDK.AWS.APIGateway
Assembly
Amazon.CDK.AWS.APIGateway.dll

Properties for StepFunctionsRestApi.

public class StepFunctionsRestApiProps : IStepFunctionsRestApiProps, IRestApiProps, IRestApiOptions, IRestApiBaseProps, IResourceOptions
Inheritance
StepFunctionsRestApiProps
Implements
Inherited Members

Examples

var stateMachineDefinition = new Pass(this, "PassState");

            var stateMachine = new StateMachine(this, "StateMachine", new StateMachineProps {
                Definition = stateMachineDefinition,
                StateMachineType = StateMachineType.EXPRESS
            });

            new StepFunctionsRestApi(this, "StepFunctionsRestApi", new StepFunctionsRestApiProps {
                Deploy = true,
                StateMachine = stateMachine
            });

Remarks

ExampleMetadata: infused

Constructors

StepFunctionsRestApiProps()

public StepFunctionsRestApiProps()

Properties

ApiKeySourceType

The source of the API key for metering requests according to a usage plan.

public ApiKeySourceType? ApiKeySourceType { get; set; }

Property Value

ApiKeySourceType?

Remarks

Default: - Metering is disabled.

Authorizer

If the whole authorizer object, including custom context values should be in the execution input.

public bool? Authorizer { get; set; }

Property Value

bool?

Remarks

The execution input will include a new key authorizer:

{ "body": {}, "authorizer": { "key": "value" } }

Default: false

BinaryMediaTypes

The list of binary media mime-types that are supported by the RestApi resource, such as "image/png" or "application/octet-stream".

public string[]? BinaryMediaTypes { get; set; }

Property Value

string[]

Remarks

Default: - RestApi supports only UTF-8-encoded text payloads.

CloneFrom

The ID of the API Gateway RestApi resource that you want to clone.

public IRestApi? CloneFrom { get; set; }

Property Value

IRestApi

Remarks

Default: - None.

CloudWatchRole

Automatically configure an AWS CloudWatch role for API Gateway.

public bool? CloudWatchRole { get; set; }

Property Value

bool?

Remarks

Default: true

DefaultCorsPreflightOptions

Adds a CORS preflight OPTIONS method to this resource and all child resources.

public ICorsOptions? DefaultCorsPreflightOptions { get; set; }

Property Value

ICorsOptions

Remarks

You can add CORS at the resource-level using addCorsPreflight.

Default: - CORS is disabled

DefaultIntegration

An integration to use as a default for all methods created within this API unless an integration is specified.

public Integration? DefaultIntegration { get; set; }

Property Value

Integration

Remarks

Default: - Inherited from parent.

DefaultMethodOptions

Method options to use as a default for all methods created within this API unless custom options are specified.

public IMethodOptions? DefaultMethodOptions { get; set; }

Property Value

IMethodOptions

Remarks

Default: - Inherited from parent.

Deploy

Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.

public bool? Deploy { get; set; }

Property Value

bool?

Remarks

Since API Gateway deployments are immutable, When this option is enabled (by default), an AWS::ApiGateway::Deployment resource will automatically created with a logical ID that hashes the API model (methods, resources and options). This means that when the model changes, the logical ID of this CloudFormation resource will change, and a new deployment will be created.

If this is set, latestDeployment will refer to the Deployment object and deploymentStage will refer to a Stage that points to this deployment. To customize the stage options, use the deployOptions property.

A CloudFormation Output will also be defined with the root URL endpoint of this REST API.

Default: true

DeployOptions

Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.

public IStageOptions? DeployOptions { get; set; }

Property Value

IStageOptions

Remarks

If deploy is disabled, this value cannot be set.

Default: - Based on defaults of StageOptions.

Description

A description of the purpose of this API Gateway RestApi resource.

public string? Description { get; set; }

Property Value

string

Remarks

Default: - No description.

DisableExecuteApiEndpoint

Specifies whether clients can invoke the API using the default execute-api endpoint.

public bool? DisableExecuteApiEndpoint { get; set; }

Property Value

bool?

Remarks

To require that clients use a custom domain name to invoke the API, disable the default endpoint.

Default: false

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html

DomainName

Configure a custom domain name and map it to this API.

public IDomainNameOptions? DomainName { get; set; }

Property Value

IDomainNameOptions

Remarks

Default: - no domain name is defined, use addDomainName or directly define a DomainName.

EndpointConfiguration

The EndpointConfiguration property type specifies the endpoint types of a REST API.

public IEndpointConfiguration? EndpointConfiguration { get; set; }

Property Value

IEndpointConfiguration

Remarks

EndpointExportName

Export name for the CfnOutput containing the API endpoint.

public string? EndpointExportName { get; set; }

Property Value

string

Remarks

Default: - when no export name is given, output will be created without export

EndpointTypes

A list of the endpoint types of the API.

public EndpointType[]? EndpointTypes { get; set; }

Property Value

EndpointType[]

Remarks

Use this property when creating an API.

Default: EndpointType.EDGE

FailOnWarnings

Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.

public bool? FailOnWarnings { get; set; }

Property Value

bool?

Remarks

Default: false

Headers

Check if header is to be included inside the execution input.

public bool? Headers { get; set; }

Property Value

bool?

Remarks

The execution input will include a new key headers:

{ "body": {}, "headers": { "header1": "value", "header2": "value" } }

Default: false

MinimumCompressionSize

A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.

public double? MinimumCompressionSize { get; set; }

Property Value

double?

Remarks

When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.

Default: - Compression is disabled.

Parameters

Custom header parameters for the request.

public IDictionary<string, string>? Parameters { get; set; }

Property Value

IDictionary<string, string>

Remarks

Path

Check if path is to be included inside the execution input.

public bool? Path { get; set; }

Property Value

bool?

Remarks

The execution input will include a new key path:

{ "body": {}, "path": { "resourceName": "resourceValue" } }

Default: true

Policy

A policy document that contains the permissions for this RestApi.

public PolicyDocument? Policy { get; set; }

Property Value

PolicyDocument

Remarks

Default: - No policy.

Querystring

Check if querystring is to be included inside the execution input.

public bool? Querystring { get; set; }

Property Value

bool?

Remarks

The execution input will include a new key queryString:

{ "body": {}, "querystring": { "key": "value" } }

Default: true

RequestContext

Which details of the incoming request must be passed onto the underlying state machine, such as, account id, user identity, request id, etc.

public IRequestContext? RequestContext { get; set; }

Property Value

IRequestContext

Remarks

The execution input will include a new key requestContext:

{ "body": {}, "requestContext": { "key": "value" } }

Default: - all parameters within request context will be set as false

RestApiName

A name for the API Gateway RestApi resource.

public string? RestApiName { get; set; }

Property Value

string

Remarks

Default: - ID of the RestApi construct.

RetainDeployments

Retains old deployment resources when the API changes.

public bool? RetainDeployments { get; set; }

Property Value

bool?

Remarks

This allows manually reverting stages to point to old deployments via the AWS Console.

Default: false

Role

An IAM role that API Gateway will assume to start the execution of the state machine.

public IRole? Role { get; set; }

Property Value

IRole

Remarks

Default: - a new role is created

StateMachine

The default State Machine that handles all requests from this API.

public IStateMachine StateMachine { get; set; }

Property Value

IStateMachine

Remarks

This stateMachine will be used as a the default integration for all methods in this API, unless specified otherwise in addMethod.