Class: AWSCDK::APIGatewayv2::CfnAPIProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gatewayv2/cfn_api_props.rb

Overview

Properties for defining a CfnApi.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key_selection_expression: nil, base_path: nil, body: nil, body_s3_location: nil, cors_configuration: nil, credentials_arn: nil, description: nil, disable_execute_api_endpoint: nil, disable_schema_validation: nil, fail_on_warnings: nil, ip_address_type: nil, name: nil, protocol_type: nil, route_key: nil, route_selection_expression: nil, tags: nil, target: nil, version: nil) ⇒ CfnAPIProps

Returns a new instance of CfnAPIProps.

Parameters:

  • api_key_selection_expression (String, nil) (defaults to: nil)

    An API key selection expression.

  • base_path (String, nil) (defaults to: nil)

    Specifies how to interpret the base path of the API during import.

  • body (Object, nil) (defaults to: nil)

    The OpenAPI definition.

  • body_s3_location (AWSCDK::IResolvable, AWSCDK::APIGatewayv2::CfnAPI::BodyS3LocationProperty, nil) (defaults to: nil)

    The S3 location of an OpenAPI definition.

  • cors_configuration (AWSCDK::IResolvable, AWSCDK::APIGatewayv2::CfnAPI::CorsProperty, nil) (defaults to: nil)

    A CORS configuration.

  • credentials_arn (String, nil) (defaults to: nil)

    This property is part of quick create.

  • description (String, nil) (defaults to: nil)

    The description of the API.

  • disable_execute_api_endpoint (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

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

  • disable_schema_validation (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Avoid validating models when creating a deployment.

  • fail_on_warnings (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether to rollback the API creation when a warning is encountered.

  • ip_address_type (String, nil) (defaults to: nil)

    The IP address types that can invoke the API.

  • name (String, nil) (defaults to: nil)

    The name of the API.

  • protocol_type (String, nil) (defaults to: nil)

    The API protocol.

  • route_key (String, nil) (defaults to: nil)

    This property is part of quick create.

  • route_selection_expression (String, nil) (defaults to: nil)

    The route selection expression for the API.

  • tags (Hash{String => String}, nil) (defaults to: nil)

    The collection of tags.

  • target (String, AWSCDK::Interfaces::AWSLambda::IFunctionRef, nil) (defaults to: nil)

    This property is part of quick create.

  • version (String, nil) (defaults to: nil)

    A version identifier for the API.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'api_gatewayv2/cfn_api_props.rb', line 27

def initialize(api_key_selection_expression: nil, base_path: nil, body: nil, body_s3_location: nil, cors_configuration: nil, credentials_arn: nil, description: nil, disable_execute_api_endpoint: nil, disable_schema_validation: nil, fail_on_warnings: nil, ip_address_type: nil, name: nil, protocol_type: nil, route_key: nil, route_selection_expression: nil, tags: nil, target: nil, version: nil)
  @api_key_selection_expression = api_key_selection_expression
  Jsii::Type.check_type(@api_key_selection_expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "apiKeySelectionExpression") unless @api_key_selection_expression.nil?
  @base_path = base_path
  Jsii::Type.check_type(@base_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "basePath") unless @base_path.nil?
  @body = body
  Jsii::Type.check_type(@body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "body") unless @body.nil?
  @body_s3_location = body_s3_location.is_a?(Hash) ? ::AWSCDK::APIGatewayv2::CfnAPI::BodyS3LocationProperty.new(**body_s3_location.transform_keys(&:to_sym)) : body_s3_location
  Jsii::Type.check_type(@body_s3_location, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5djIuQ2ZuQXBpLkJvZHlTM0xvY2F0aW9uUHJvcGVydHkifV19fQ==")), "bodyS3Location") unless @body_s3_location.nil?
  @cors_configuration = cors_configuration.is_a?(Hash) ? ::AWSCDK::APIGatewayv2::CfnAPI::CorsProperty.new(**cors_configuration.transform_keys(&:to_sym)) : cors_configuration
  Jsii::Type.check_type(@cors_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5djIuQ2ZuQXBpLkNvcnNQcm9wZXJ0eSJ9XX19")), "corsConfiguration") unless @cors_configuration.nil?
  @credentials_arn = credentials_arn
  Jsii::Type.check_type(@credentials_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "credentialsArn") unless @credentials_arn.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @disable_execute_api_endpoint = disable_execute_api_endpoint
  Jsii::Type.check_type(@disable_execute_api_endpoint, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "disableExecuteApiEndpoint") unless @disable_execute_api_endpoint.nil?
  @disable_schema_validation = disable_schema_validation
  Jsii::Type.check_type(@disable_schema_validation, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "disableSchemaValidation") unless @disable_schema_validation.nil?
  @fail_on_warnings = fail_on_warnings
  Jsii::Type.check_type(@fail_on_warnings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "failOnWarnings") unless @fail_on_warnings.nil?
  @ip_address_type = ip_address_type
  Jsii::Type.check_type(@ip_address_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ipAddressType") unless @ip_address_type.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @protocol_type = protocol_type
  Jsii::Type.check_type(@protocol_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "protocolType") unless @protocol_type.nil?
  @route_key = route_key
  Jsii::Type.check_type(@route_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "routeKey") unless @route_key.nil?
  @route_selection_expression = route_selection_expression
  Jsii::Type.check_type(@route_selection_expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "routeSelectionExpression") unless @route_selection_expression.nil?
  @tags = tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "tags") unless @tags.nil?
  @target = target
  Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19sYW1iZGEuSUZ1bmN0aW9uUmVmIn1dfX0=")), "target") unless @target.nil?
  @version = version
  Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "version") unless @version.nil?
end

Instance Attribute Details

#api_key_selection_expressionString? (readonly)

An API key selection expression.

Supported only for WebSocket APIs. See API Key Selection Expressions .



72
73
74
# File 'api_gatewayv2/cfn_api_props.rb', line 72

def api_key_selection_expression
  @api_key_selection_expression
end

#base_pathString? (readonly)

Specifies how to interpret the base path of the API during import.

Valid values are ignore , prepend , and split . The default value is ignore . To learn more, see Set the OpenAPI basePath Property . Supported only for HTTP APIs.



79
80
81
# File 'api_gatewayv2/cfn_api_props.rb', line 79

def base_path
  @base_path
end

#bodyObject? (readonly)

The OpenAPI definition.

Supported only for HTTP APIs. To import an HTTP API, you must specify a Body or BodyS3Location . If you specify a Body or BodyS3Location , don't specify CloudFormation resources such as AWS::ApiGatewayV2::Authorizer or AWS::ApiGatewayV2::Route . API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.



86
87
88
# File 'api_gatewayv2/cfn_api_props.rb', line 86

def body
  @body
end

#body_s3_locationAWSCDK::IResolvable, ... (readonly)

The S3 location of an OpenAPI definition.

Supported only for HTTP APIs. To import an HTTP API, you must specify a Body or BodyS3Location . If you specify a Body or BodyS3Location , don't specify CloudFormation resources such as AWS::ApiGatewayV2::Authorizer or AWS::ApiGatewayV2::Route . API Gateway doesn't support the combination of OpenAPI and CloudFormation resources.



93
94
95
# File 'api_gatewayv2/cfn_api_props.rb', line 93

def body_s3_location
  @body_s3_location
end

#cors_configurationAWSCDK::IResolvable, ... (readonly)

A CORS configuration.

Supported only for HTTP APIs. See Configuring CORS for more information.



100
101
102
# File 'api_gatewayv2/cfn_api_props.rb', line 100

def cors_configuration
  @cors_configuration
end

#credentials_arnString? (readonly)

This property is part of quick create.

It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify arn:aws:iam::*:user/* . To use resource-based permissions on supported AWS services, specify null . Currently, this property is not used for HTTP integrations. Supported only for HTTP APIs.



107
108
109
# File 'api_gatewayv2/cfn_api_props.rb', line 107

def credentials_arn
  @credentials_arn
end

#descriptionString? (readonly)

The description of the API.



112
113
114
# File 'api_gatewayv2/cfn_api_props.rb', line 112

def description
  @description
end

#disable_execute_api_endpointBoolean, ... (readonly)

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

By default, clients can invoke your API with the default https://api_id.execute-api.region.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.



119
120
121
# File 'api_gatewayv2/cfn_api_props.rb', line 119

def disable_execute_api_endpoint
  @disable_execute_api_endpoint
end

#disable_schema_validationBoolean, ... (readonly)

Avoid validating models when creating a deployment.

Supported only for WebSocket APIs.



126
127
128
# File 'api_gatewayv2/cfn_api_props.rb', line 126

def disable_schema_validation
  @disable_schema_validation
end

#fail_on_warningsBoolean, ... (readonly)

Specifies whether to rollback the API creation when a warning is encountered.

By default, API creation continues if a warning is encountered.



133
134
135
# File 'api_gatewayv2/cfn_api_props.rb', line 133

def fail_on_warnings
  @fail_on_warnings
end

#ip_address_typeString? (readonly)

The IP address types that can invoke the API.

Use ipv4 to allow only IPv4 addresses to invoke your API, or use dualstack to allow both IPv4 and IPv6 addresses to invoke your API.

Don’t use IP address type for an HTTP API based on an OpenAPI specification. Instead, specify the IP address type in the OpenAPI specification.



142
143
144
# File 'api_gatewayv2/cfn_api_props.rb', line 142

def ip_address_type
  @ip_address_type
end

#nameString? (readonly)

The name of the API.

Required unless you specify an OpenAPI definition for Body or S3BodyLocation .



149
150
151
# File 'api_gatewayv2/cfn_api_props.rb', line 149

def name
  @name
end

#protocol_typeString? (readonly)

The API protocol.

Valid values are WEBSOCKET or HTTP . Required unless you specify an OpenAPI definition for Body or S3BodyLocation .



156
157
158
# File 'api_gatewayv2/cfn_api_props.rb', line 156

def protocol_type
  @protocol_type
end

#route_keyString? (readonly)

This property is part of quick create.

If you don't specify a route_key , a default route of $default is created. The $default route acts as a catch-all for any request made to your API, for a particular stage. The $default route key can't be modified. You can add routes after creating the API, and you can update the route keys of additional routes. Supported only for HTTP APIs.



163
164
165
# File 'api_gatewayv2/cfn_api_props.rb', line 163

def route_key
  @route_key
end

#route_selection_expressionString? (readonly)

The route selection expression for the API.

For HTTP APIs, the route_selection_expression must be ${request.method} ${request.path} . If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.



170
171
172
# File 'api_gatewayv2/cfn_api_props.rb', line 170

def route_selection_expression
  @route_selection_expression
end

#tagsHash{String => String}? (readonly)

The collection of tags.

Each tag element is associated with a given resource.



177
178
179
# File 'api_gatewayv2/cfn_api_props.rb', line 177

def tags
  @tags
end

#targetString, ... (readonly)

This property is part of quick create.

Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Supported only for HTTP APIs.



184
185
186
# File 'api_gatewayv2/cfn_api_props.rb', line 184

def target
  @target
end

#versionString? (readonly)

A version identifier for the API.



189
190
191
# File 'api_gatewayv2/cfn_api_props.rb', line 189

def version
  @version
end

Class Method Details

.jsii_propertiesObject



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'api_gatewayv2/cfn_api_props.rb', line 191

def self.jsii_properties
  {
    :api_key_selection_expression => "apiKeySelectionExpression",
    :base_path => "basePath",
    :body => "body",
    :body_s3_location => "bodyS3Location",
    :cors_configuration => "corsConfiguration",
    :credentials_arn => "credentialsArn",
    :description => "description",
    :disable_execute_api_endpoint => "disableExecuteApiEndpoint",
    :disable_schema_validation => "disableSchemaValidation",
    :fail_on_warnings => "failOnWarnings",
    :ip_address_type => "ipAddressType",
    :name => "name",
    :protocol_type => "protocolType",
    :route_key => "routeKey",
    :route_selection_expression => "routeSelectionExpression",
    :tags => "tags",
    :target => "target",
    :version => "version",
  }
end

Instance Method Details

#to_jsiiObject



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'api_gatewayv2/cfn_api_props.rb', line 214

def to_jsii
  result = {}
  result.merge!({
    "apiKeySelectionExpression" => @api_key_selection_expression,
    "basePath" => @base_path,
    "body" => @body,
    "bodyS3Location" => @body_s3_location,
    "corsConfiguration" => @cors_configuration,
    "credentialsArn" => @credentials_arn,
    "description" => @description,
    "disableExecuteApiEndpoint" => @disable_execute_api_endpoint,
    "disableSchemaValidation" => @disable_schema_validation,
    "failOnWarnings" => @fail_on_warnings,
    "ipAddressType" => @ip_address_type,
    "name" => @name,
    "protocolType" => @protocol_type,
    "routeKey" => @route_key,
    "routeSelectionExpression" => @route_selection_expression,
    "tags" => @tags,
    "target" => @target,
    "version" => @version,
  })
  result.compact
end