Module: AWSCDK::APIGatewayv2::IHttpAPI
Overview
Represents an HTTP API.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_vpc_link(options) ⇒ AWSCDK::APIGatewayv2::VPCLink
Add a new VpcLink.
-
#api_endpoint ⇒ String
The default endpoint for an API.
-
#api_id ⇒ String
The identifier of this API Gateway API.
-
#api_ref ⇒ AWSCDK::Interfaces::AWSApigatewayv2::APIReference
A reference to a Api resource.
-
#apply_removal_policy(policy) ⇒ void
Apply the given removal policy to this resource.
-
#arn_for_execute_api(method = nil, path = nil, stage = nil) ⇒ String
Get the "execute-api" ARN.
-
#default_authorization_scopes ⇒ Array<String>?
Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.
-
#default_authorizer ⇒ AWSCDK::APIGatewayv2::IHttpRouteAuthorizer?
Default Authorizer applied to all routes in the gateway.
-
#default_stage ⇒ AWSCDK::APIGatewayv2::IHttpStage?
The default stage of this API.
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#is_http_api ⇒ Boolean
Indicates that this is an HTTP API.
-
#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric
Return the given named metric for this Api Gateway.
-
#metric_client_error(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the number of client-side errors captured in a given period.
-
#metric_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the total number API requests in a given period.
-
#metric_data_processed(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the amount of data processed in bytes.
-
#metric_integration_latency(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.
-
#metric_latency(props = nil) ⇒ AWSCDK::CloudWatch::Metric
The time between when API Gateway receives a request from a client and when it returns a response to the client.
-
#metric_server_error(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the number of server-side errors captured in a given period.
-
#node ⇒ Constructs::Node
The tree node.
-
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Class Method Details
.jsii_overridable_methods ⇒ Object
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'api_gatewayv2/i_http_api.rb', line 233 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :env => { kind: :property, name: "env", is_optional: false }, :stack => { kind: :property, name: "stack", is_optional: false }, :api_ref => { kind: :property, name: "apiRef", is_optional: false }, :api_endpoint => { kind: :property, name: "apiEndpoint", is_optional: false }, :api_id => { kind: :property, name: "apiId", is_optional: false }, :is_http_api => { kind: :property, name: "isHttpApi", is_optional: false }, :default_authorization_scopes => { kind: :property, name: "defaultAuthorizationScopes", is_optional: true }, :default_authorizer => { kind: :property, name: "defaultAuthorizer", is_optional: true }, :default_stage => { kind: :property, name: "defaultStage", is_optional: true }, :with => { kind: :method, name: "with", is_optional: false }, :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false }, :metric => { kind: :method, name: "metric", is_optional: false }, :add_vpc_link => { kind: :method, name: "addVpcLink", is_optional: false }, :arn_for_execute_api => { kind: :method, name: "arnForExecuteApi", is_optional: false }, :metric_client_error => { kind: :method, name: "metricClientError", is_optional: false }, :metric_count => { kind: :method, name: "metricCount", is_optional: false }, :metric_data_processed => { kind: :method, name: "metricDataProcessed", is_optional: false }, :metric_integration_latency => { kind: :method, name: "metricIntegrationLatency", is_optional: false }, :metric_latency => { kind: :method, name: "metricLatency", is_optional: false }, :metric_server_error => { kind: :method, name: "metricServerError", is_optional: false }, } end |
Instance Method Details
#add_vpc_link(options) ⇒ AWSCDK::APIGatewayv2::VPCLink
Add a new VpcLink.
143 144 145 146 147 |
# File 'api_gatewayv2/i_http_api.rb', line 143 def add_vpc_link() = .is_a?(Hash) ? ::AWSCDK::APIGatewayv2::VPCLinkProps.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLlZwY0xpbmtQcm9wcyJ9")), "options") jsii_call_method("addVpcLink", []) end |
#api_endpoint ⇒ String
The default endpoint for an API.
48 49 50 |
# File 'api_gatewayv2/i_http_api.rb', line 48 def api_endpoint() jsii_get_property("apiEndpoint") end |
#api_id ⇒ String
The identifier of this API Gateway API.
55 56 57 |
# File 'api_gatewayv2/i_http_api.rb', line 55 def api_id() jsii_get_property("apiId") end |
#api_ref ⇒ AWSCDK::Interfaces::AWSApigatewayv2::APIReference
A reference to a Api resource.
41 42 43 |
# File 'api_gatewayv2/i_http_api.rb', line 41 def api_ref() jsii_get_property("apiRef") end |
#apply_removal_policy(policy) ⇒ void
This method returns an undefined value.
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
121 122 123 124 |
# File 'api_gatewayv2/i_http_api.rb', line 121 def apply_removal_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") jsii_call_method("applyRemovalPolicy", [policy]) end |
#arn_for_execute_api(method = nil, path = nil, stage = nil) ⇒ String
Default: - The default behavior applies when no specific method, path, or stage is provided. In this case, the ARN will cover all methods, all resources, and all stages of this API. Specifically, if 'method' is not specified, it defaults to '', representing all methods. If 'path' is not specified, it defaults to '/', representing all paths. If 'stage' is not specified, it also defaults to '*', representing all stages.
Get the "execute-api" ARN.
When 'ANY' is passed to the method, an ARN with the method set to '*' is obtained.
158 159 160 161 162 163 |
# File 'api_gatewayv2/i_http_api.rb', line 158 def arn_for_execute_api(method = nil, path = nil, stage = nil) Jsii::Type.check_type(method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "method") unless method.nil? Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") unless path.nil? Jsii::Type.check_type(stage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stage") unless stage.nil? jsii_call_method("arnForExecuteApi", [method, path, stage]) end |
#default_authorization_scopes ⇒ Array<String>?
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.
75 76 77 |
# File 'api_gatewayv2/i_http_api.rb', line 75 def () jsii_get_property("defaultAuthorizationScopes") end |
#default_authorizer ⇒ AWSCDK::APIGatewayv2::IHttpRouteAuthorizer?
Default: - no default authorizer
Default Authorizer applied to all routes in the gateway.
83 84 85 |
# File 'api_gatewayv2/i_http_api.rb', line 83 def () jsii_get_property("defaultAuthorizer") end |
#default_stage ⇒ AWSCDK::APIGatewayv2::IHttpStage?
Default: - a stage will be created
The default stage of this API.
91 92 93 |
# File 'api_gatewayv2/i_http_api.rb', line 91 def default_stage() jsii_get_property("defaultStage") end |
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
27 28 29 |
# File 'api_gatewayv2/i_http_api.rb', line 27 def env() jsii_get_property("env") end |
#is_http_api ⇒ Boolean
Indicates that this is an HTTP API.
Will always return true, but is necessary to prevent accidental structural equality in TypeScript.
65 66 67 |
# File 'api_gatewayv2/i_http_api.rb', line 65 def is_http_api() jsii_get_property("isHttpApi") end |
#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric
Default: - average over 5 minutes
Return the given named metric for this Api Gateway.
132 133 134 135 136 137 |
# File 'api_gatewayv2/i_http_api.rb', line 132 def metric(metric_name, props = nil) Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName") props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metric", [metric_name, props]) end |
#metric_client_error(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Default: - sum over 5 minutes
Metric for the number of client-side errors captured in a given period.
170 171 172 173 174 |
# File 'api_gatewayv2/i_http_api.rb', line 170 def metric_client_error(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricClientError", [props]) end |
#metric_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Default: - SampleCount over 5 minutes
Metric for the total number API requests in a given period.
181 182 183 184 185 |
# File 'api_gatewayv2/i_http_api.rb', line 181 def metric_count(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricCount", [props]) end |
#metric_data_processed(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Default: - sum over 5 minutes
Metric for the amount of data processed in bytes.
192 193 194 195 196 |
# File 'api_gatewayv2/i_http_api.rb', line 192 def metric_data_processed(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricDataProcessed", [props]) end |
#metric_integration_latency(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Default: - no statistic
Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.
203 204 205 206 207 |
# File 'api_gatewayv2/i_http_api.rb', line 203 def metric_integration_latency(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricIntegrationLatency", [props]) end |
#metric_latency(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Default: - no statistic
The time between when API Gateway receives a request from a client and when it returns a response to the client.
The latency includes the integration latency and other API Gateway overhead.
216 217 218 219 220 |
# File 'api_gatewayv2/i_http_api.rb', line 216 def metric_latency(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricLatency", [props]) end |
#metric_server_error(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Default: - sum over 5 minutes
Metric for the number of server-side errors captured in a given period.
227 228 229 230 231 |
# File 'api_gatewayv2/i_http_api.rb', line 227 def metric_server_error(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil? jsii_call_method("metricServerError", [props]) end |
#node ⇒ Constructs::Node
The tree node.
12 13 14 |
# File 'api_gatewayv2/i_http_api.rb', line 12 def node() jsii_get_property("node") end |
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
34 35 36 |
# File 'api_gatewayv2/i_http_api.rb', line 34 def stack() jsii_get_property("stack") end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.
102 103 104 105 106 107 |
# File 'api_gatewayv2/i_http_api.rb', line 102 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |