Class: AWSCDK::APIGatewayv2::HttpStageOptions

Inherits:
StageOptions
  • Object
show all
Defined in:
api_gatewayv2/http_stage_options.rb

Overview

The options to create a new Stage for an HTTP API.

Direct Known Subclasses

HttpStageProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_log_settings: nil, auto_deploy: nil, description: nil, detailed_metrics_enabled: nil, domain_mapping: nil, stage_variables: nil, throttle: nil, stage_name: nil) ⇒ HttpStageOptions

Returns a new instance of HttpStageOptions.

Parameters:

  • access_log_settings (AWSCDK::APIGatewayv2::IAccessLogSettings, nil) (defaults to: nil)

    Settings for access logging.

  • auto_deploy (Boolean, nil) (defaults to: nil)

    Whether updates to an API automatically trigger a new deployment.

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

    The description for the API stage.

  • detailed_metrics_enabled (Boolean, nil) (defaults to: nil)

    Specifies whether detailed metrics are enabled.

  • domain_mapping (AWSCDK::APIGatewayv2::DomainMappingOptions, nil) (defaults to: nil)

    The options for custom domain and api mapping.

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

    Stage variables for the stage. These are key-value pairs that you can define and use in your API routes.

  • throttle (AWSCDK::APIGatewayv2::ThrottleSettings, nil) (defaults to: nil)

    Throttle settings for the routes of this stage.

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

    The name of the stage.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'api_gatewayv2/http_stage_options.rb', line 15

def initialize(access_log_settings: nil, auto_deploy: nil, description: nil, detailed_metrics_enabled: nil, domain_mapping: nil, stage_variables: nil, throttle: nil, stage_name: nil)
  @access_log_settings = access_log_settings
  Jsii::Type.check_type(@access_log_settings, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLklBY2Nlc3NMb2dTZXR0aW5ncyJ9")), "accessLogSettings") unless @access_log_settings.nil?
  @auto_deploy = auto_deploy
  Jsii::Type.check_type(@auto_deploy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "autoDeploy") unless @auto_deploy.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @detailed_metrics_enabled = detailed_metrics_enabled
  Jsii::Type.check_type(@detailed_metrics_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "detailedMetricsEnabled") unless @detailed_metrics_enabled.nil?
  @domain_mapping = domain_mapping.is_a?(Hash) ? ::AWSCDK::APIGatewayv2::DomainMappingOptions.new(**domain_mapping.transform_keys(&:to_sym)) : domain_mapping
  Jsii::Type.check_type(@domain_mapping, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLkRvbWFpbk1hcHBpbmdPcHRpb25zIn0=")), "domainMapping") unless @domain_mapping.nil?
  @stage_variables = stage_variables
  Jsii::Type.check_type(@stage_variables, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "stageVariables") unless @stage_variables.nil?
  @throttle = throttle.is_a?(Hash) ? ::AWSCDK::APIGatewayv2::ThrottleSettings.new(**throttle.transform_keys(&:to_sym)) : throttle
  Jsii::Type.check_type(@throttle, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLlRocm90dGxlU2V0dGluZ3MifQ==")), "throttle") unless @throttle.nil?
  @stage_name = stage_name
  Jsii::Type.check_type(@stage_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stageName") unless @stage_name.nil?
end

Instance Attribute Details

#access_log_settingsAWSCDK::APIGatewayv2::IAccessLogSettings? (readonly)

Note:

Default: - No access logging

Settings for access logging.



38
39
40
# File 'api_gatewayv2/http_stage_options.rb', line 38

def access_log_settings
  @access_log_settings
end

#auto_deployBoolean? (readonly)

Note:

Default: false

Whether updates to an API automatically trigger a new deployment.

Returns:

  • (Boolean, nil)


43
44
45
# File 'api_gatewayv2/http_stage_options.rb', line 43

def auto_deploy
  @auto_deploy
end

#descriptionString? (readonly)

Note:

Default: - no description

The description for the API stage.

Returns:

  • (String, nil)


48
49
50
# File 'api_gatewayv2/http_stage_options.rb', line 48

def description
  @description
end

#detailed_metrics_enabledBoolean? (readonly)

Note:

Default: false

Specifies whether detailed metrics are enabled.

Returns:

  • (Boolean, nil)


53
54
55
# File 'api_gatewayv2/http_stage_options.rb', line 53

def detailed_metrics_enabled
  @detailed_metrics_enabled
end

#domain_mappingAWSCDK::APIGatewayv2::DomainMappingOptions? (readonly)

Note:

Default: - no custom domain and api mapping configuration

The options for custom domain and api mapping.



58
59
60
# File 'api_gatewayv2/http_stage_options.rb', line 58

def domain_mapping
  @domain_mapping
end

#stage_nameString? (readonly)

Note:

Default: '$default' the default stage of the API. This stage will have the URL at the root of the API endpoint.

The name of the stage.

See StageName class for more details.

Returns:

  • (String, nil)


77
78
79
# File 'api_gatewayv2/http_stage_options.rb', line 77

def stage_name
  @stage_name
end

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

Note:

Default: - No stage variables

Stage variables for the stage. These are key-value pairs that you can define and use in your API routes.

The allowed characters for variable names and the required pattern for variable values are specified here: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-apigateway-stage.html#cfn-apigateway-stage-variables

Returns:

  • (Hash{String => String}, nil)


65
66
67
# File 'api_gatewayv2/http_stage_options.rb', line 65

def stage_variables
  @stage_variables
end

#throttleAWSCDK::APIGatewayv2::ThrottleSettings? (readonly)

Note:

Default: - no throttling configuration

Throttle settings for the routes of this stage.



70
71
72
# File 'api_gatewayv2/http_stage_options.rb', line 70

def throttle
  @throttle
end

Class Method Details

.jsii_propertiesObject



79
80
81
82
83
84
85
86
87
88
89
90
# File 'api_gatewayv2/http_stage_options.rb', line 79

def self.jsii_properties
  {
    :access_log_settings => "accessLogSettings",
    :auto_deploy => "autoDeploy",
    :description => "description",
    :detailed_metrics_enabled => "detailedMetricsEnabled",
    :domain_mapping => "domainMapping",
    :stage_variables => "stageVariables",
    :throttle => "throttle",
    :stage_name => "stageName",
  }
end

Instance Method Details

#to_jsiiObject



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'api_gatewayv2/http_stage_options.rb', line 92

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "accessLogSettings" => @access_log_settings,
    "autoDeploy" => @auto_deploy,
    "description" => @description,
    "detailedMetricsEnabled" => @detailed_metrics_enabled,
    "domainMapping" => @domain_mapping,
    "stageVariables" => @stage_variables,
    "throttle" => @throttle,
    "stageName" => @stage_name,
  })
  result.compact
end