Class: AWSCDK::APIGatewayv2::HttpAPIProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::APIGatewayv2::HttpAPIProps
- Defined in:
- api_gatewayv2/http_api_props.rb
Overview
Properties to initialize an instance of HttpApi.
Instance Attribute Summary collapse
-
#api_name ⇒ String?
readonly
Name for the HTTP API resource.
-
#cors_preflight ⇒ AWSCDK::APIGatewayv2::CorsPreflightOptions?
readonly
Specifies a CORS configuration for an API.
-
#create_default_stage ⇒ Boolean?
readonly
Whether a default stage and deployment should be automatically created.
-
#default_authorization_scopes ⇒ Array<String>?
readonly
Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.
-
#default_authorizer ⇒ AWSCDK::APIGatewayv2::IHttpRouteAuthorizer?
readonly
Default Authorizer applied to all routes in the gateway.
-
#default_domain_mapping ⇒ AWSCDK::APIGatewayv2::DomainMappingOptions?
readonly
Configure a custom domain with the API mapping resource to the HTTP API.
-
#default_integration ⇒ AWSCDK::APIGatewayv2::HttpRouteIntegration?
readonly
An integration that will be configured on the catch-all route ($default).
-
#description ⇒ String?
readonly
The description of the API.
-
#disable_execute_api_endpoint ⇒ Boolean?
readonly
Specifies whether clients can invoke your API using the default endpoint.
-
#ip_address_type ⇒ AWSCDK::APIGatewayv2::IPAddressType?
readonly
The IP address types that can invoke the API.
-
#route_selection_expression ⇒ Boolean?
readonly
Whether to set the default route selection expression for the API.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(api_name: nil, cors_preflight: nil, create_default_stage: nil, default_authorization_scopes: nil, default_authorizer: nil, default_domain_mapping: nil, default_integration: nil, description: nil, disable_execute_api_endpoint: nil, ip_address_type: nil, route_selection_expression: nil) ⇒ HttpAPIProps
constructor
A new instance of HttpAPIProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(api_name: nil, cors_preflight: nil, create_default_stage: nil, default_authorization_scopes: nil, default_authorizer: nil, default_domain_mapping: nil, default_integration: nil, description: nil, disable_execute_api_endpoint: nil, ip_address_type: nil, route_selection_expression: nil) ⇒ HttpAPIProps
Returns a new instance of HttpAPIProps.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'api_gatewayv2/http_api_props.rb', line 18 def initialize(api_name: nil, cors_preflight: nil, create_default_stage: nil, default_authorization_scopes: nil, default_authorizer: nil, default_domain_mapping: nil, default_integration: nil, description: nil, disable_execute_api_endpoint: nil, ip_address_type: nil, route_selection_expression: nil) @api_name = api_name Jsii::Type.check_type(@api_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "apiName") unless @api_name.nil? @cors_preflight = cors_preflight.is_a?(Hash) ? ::AWSCDK::APIGatewayv2::CorsPreflightOptions.new(**cors_preflight.transform_keys(&:to_sym)) : cors_preflight Jsii::Type.check_type(@cors_preflight, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLkNvcnNQcmVmbGlnaHRPcHRpb25zIn0=")), "corsPreflight") unless @cors_preflight.nil? @create_default_stage = create_default_stage Jsii::Type.check_type(@create_default_stage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "createDefaultStage") unless @create_default_stage.nil? @default_authorization_scopes = Jsii::Type.check_type(@default_authorization_scopes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "defaultAuthorizationScopes") unless @default_authorization_scopes.nil? @default_authorizer = Jsii::Type.check_type(@default_authorizer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLklIdHRwUm91dGVBdXRob3JpemVyIn0=")), "defaultAuthorizer") unless @default_authorizer.nil? @default_domain_mapping = default_domain_mapping.is_a?(Hash) ? ::AWSCDK::APIGatewayv2::DomainMappingOptions.new(**default_domain_mapping.transform_keys(&:to_sym)) : default_domain_mapping Jsii::Type.check_type(@default_domain_mapping, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLkRvbWFpbk1hcHBpbmdPcHRpb25zIn0=")), "defaultDomainMapping") unless @default_domain_mapping.nil? @default_integration = default_integration Jsii::Type.check_type(@default_integration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLkh0dHBSb3V0ZUludGVncmF0aW9uIn0=")), "defaultIntegration") unless @default_integration.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("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "disableExecuteApiEndpoint") unless @disable_execute_api_endpoint.nil? @ip_address_type = ip_address_type Jsii::Type.check_type(@ip_address_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLklwQWRkcmVzc1R5cGUifQ==")), "ipAddressType") unless @ip_address_type.nil? @route_selection_expression = route_selection_expression Jsii::Type.check_type(@route_selection_expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "routeSelectionExpression") unless @route_selection_expression.nil? end |
Instance Attribute Details
#api_name ⇒ String? (readonly)
Default: - id of the HttpApi construct.
Name for the HTTP API resource.
47 48 49 |
# File 'api_gatewayv2/http_api_props.rb', line 47 def api_name @api_name end |
#cors_preflight ⇒ AWSCDK::APIGatewayv2::CorsPreflightOptions? (readonly)
Default: - CORS disabled.
Specifies a CORS configuration for an API.
53 54 55 |
# File 'api_gatewayv2/http_api_props.rb', line 53 def cors_preflight @cors_preflight end |
#create_default_stage ⇒ Boolean? (readonly)
Default: true
Whether a default stage and deployment should be automatically created.
58 59 60 |
# File 'api_gatewayv2/http_api_props.rb', line 58 def create_default_stage @create_default_stage end |
#default_authorization_scopes ⇒ Array<String>? (readonly)
Default: - no default authorization scopes
Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.
The scopes are used with a COGNITO_USER_POOLS authorizer to authorize the method invocation.
65 66 67 |
# File 'api_gatewayv2/http_api_props.rb', line 65 def @default_authorization_scopes end |
#default_authorizer ⇒ AWSCDK::APIGatewayv2::IHttpRouteAuthorizer? (readonly)
Default: - no default authorizer
Default Authorizer applied to all routes in the gateway.
70 71 72 |
# File 'api_gatewayv2/http_api_props.rb', line 70 def @default_authorizer end |
#default_domain_mapping ⇒ AWSCDK::APIGatewayv2::DomainMappingOptions? (readonly)
Default: - no default domain mapping configured. meaningless if createDefaultStage is false.
Configure a custom domain with the API mapping resource to the HTTP API.
75 76 77 |
# File 'api_gatewayv2/http_api_props.rb', line 75 def default_domain_mapping @default_domain_mapping end |
#default_integration ⇒ AWSCDK::APIGatewayv2::HttpRouteIntegration? (readonly)
Default: - none
An integration that will be configured on the catch-all route ($default).
80 81 82 |
# File 'api_gatewayv2/http_api_props.rb', line 80 def default_integration @default_integration end |
#description ⇒ String? (readonly)
Default: - none
The description of the API.
85 86 87 |
# File 'api_gatewayv2/http_api_props.rb', line 85 def description @description end |
#disable_execute_api_endpoint ⇒ Boolean? (readonly)
Default: false execute-api endpoint enabled.
Specifies whether clients can invoke your API using the default endpoint.
By default, clients can invoke your API with the default
https://{api_id}.execute-api.{region}.amazonaws.com endpoint. Set this to
true if you would like clients to use your custom domain name.
94 95 96 |
# File 'api_gatewayv2/http_api_props.rb', line 94 def disable_execute_api_endpoint @disable_execute_api_endpoint end |
#ip_address_type ⇒ AWSCDK::APIGatewayv2::IPAddressType? (readonly)
Default: undefined - AWS default is IPV4
The IP address types that can invoke the API.
100 101 102 |
# File 'api_gatewayv2/http_api_props.rb', line 100 def ip_address_type @ip_address_type end |
#route_selection_expression ⇒ Boolean? (readonly)
Default: false
Whether to set the default route selection expression for the API.
When enabled, "$AWSCDK::APIGatewayv2::HttpAPIProps.requestrequest.method $AWSCDK::APIGatewayv2::HttpAPIProps.requestrequest.path" is set as the default route selection expression.
107 108 109 |
# File 'api_gatewayv2/http_api_props.rb', line 107 def route_selection_expression @route_selection_expression end |
Class Method Details
.jsii_properties ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'api_gatewayv2/http_api_props.rb', line 109 def self.jsii_properties { :api_name => "apiName", :cors_preflight => "corsPreflight", :create_default_stage => "createDefaultStage", :default_authorization_scopes => "defaultAuthorizationScopes", :default_authorizer => "defaultAuthorizer", :default_domain_mapping => "defaultDomainMapping", :default_integration => "defaultIntegration", :description => "description", :disable_execute_api_endpoint => "disableExecuteApiEndpoint", :ip_address_type => "ipAddressType", :route_selection_expression => "routeSelectionExpression", } end |
Instance Method Details
#to_jsii ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'api_gatewayv2/http_api_props.rb', line 125 def to_jsii result = {} result.merge!({ "apiName" => @api_name, "corsPreflight" => @cors_preflight, "createDefaultStage" => @create_default_stage, "defaultAuthorizationScopes" => @default_authorization_scopes, "defaultAuthorizer" => @default_authorizer, "defaultDomainMapping" => @default_domain_mapping, "defaultIntegration" => @default_integration, "description" => @description, "disableExecuteApiEndpoint" => @disable_execute_api_endpoint, "ipAddressType" => @ip_address_type, "routeSelectionExpression" => @route_selection_expression, }) result.compact end |