Class: AWSCDK::APIGateway::StageOptions

Inherits:
MethodDeploymentOptions
  • Object
show all
Defined in:
api_gateway/stage_options.rb

Direct Known Subclasses

StageProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cache_data_encrypted: nil, cache_ttl: nil, caching_enabled: nil, data_trace_enabled: nil, logging_level: nil, metrics_enabled: nil, throttling_burst_limit: nil, throttling_rate_limit: nil, access_log_destination: nil, access_log_format: nil, cache_cluster_enabled: nil, cache_cluster_size: nil, client_certificate_id: nil, description: nil, documentation_version: nil, method_options: nil, stage_name: nil, tracing_enabled: nil, variables: nil) ⇒ StageOptions

Returns a new instance of StageOptions.

Parameters:

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

    Indicates whether the cached responses are encrypted.

  • cache_ttl (AWSCDK::Duration, nil) (defaults to: nil)

    Specifies the time to live (TTL), in seconds, for cached responses.

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

    Specifies whether responses should be cached and returned for requests.

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

    Specifies whether data trace logging is enabled for this method.

  • logging_level (AWSCDK::APIGateway::MethodLoggingLevel, nil) (defaults to: nil)

    Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs.

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

    Specifies whether Amazon CloudWatch metrics are enabled for this method.

  • throttling_burst_limit (Numeric, nil) (defaults to: nil)

    Specifies the throttling burst limit.

  • throttling_rate_limit (Numeric, nil) (defaults to: nil)

    Specifies the throttling rate limit.

  • access_log_destination (AWSCDK::APIGateway::IAccessLogDestination, nil) (defaults to: nil)

    The CloudWatch Logs log group or Firehose delivery stream where to write access logs.

  • access_log_format (AWSCDK::APIGateway::AccessLogFormat, nil) (defaults to: nil)

    A single line format of access logs of data, as specified by selected $content variables.

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

    Indicates whether cache clustering is enabled for the stage.

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

    The stage's cache cluster size.

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

    The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage.

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

    A description of the purpose of the stage.

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

    The version identifier of the API documentation snapshot.

  • method_options (Hash{String => AWSCDK::APIGateway::MethodDeploymentOptions}, nil) (defaults to: nil)

    Method deployment options for specific resources/methods.

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

    The name of the stage, which API Gateway uses as the first path segment in the invoked Uniform Resource Identifier (URI).

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

    Specifies whether Amazon X-Ray tracing is enabled for this method.

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

    A map that defines the stage variables.



25
26
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_gateway/stage_options.rb', line 25

def initialize(cache_data_encrypted: nil, cache_ttl: nil, caching_enabled: nil, data_trace_enabled: nil, logging_level: nil, metrics_enabled: nil, throttling_burst_limit: nil, throttling_rate_limit: nil, access_log_destination: nil, access_log_format: nil, cache_cluster_enabled: nil, cache_cluster_size: nil, client_certificate_id: nil, description: nil, documentation_version: nil, method_options: nil, stage_name: nil, tracing_enabled: nil, variables: nil)
  @cache_data_encrypted = cache_data_encrypted
  Jsii::Type.check_type(@cache_data_encrypted, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "cacheDataEncrypted") unless @cache_data_encrypted.nil?
  @cache_ttl = cache_ttl
  Jsii::Type.check_type(@cache_ttl, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "cacheTtl") unless @cache_ttl.nil?
  @caching_enabled = caching_enabled
  Jsii::Type.check_type(@caching_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "cachingEnabled") unless @caching_enabled.nil?
  @data_trace_enabled = data_trace_enabled
  Jsii::Type.check_type(@data_trace_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "dataTraceEnabled") unless @data_trace_enabled.nil?
  @logging_level = logging_level
  Jsii::Type.check_type(@logging_level, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5NZXRob2RMb2dnaW5nTGV2ZWwifQ==")), "loggingLevel") unless @logging_level.nil?
  @metrics_enabled = metrics_enabled
  Jsii::Type.check_type(@metrics_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "metricsEnabled") unless @metrics_enabled.nil?
  @throttling_burst_limit = throttling_burst_limit
  Jsii::Type.check_type(@throttling_burst_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "throttlingBurstLimit") unless @throttling_burst_limit.nil?
  @throttling_rate_limit = throttling_rate_limit
  Jsii::Type.check_type(@throttling_rate_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "throttlingRateLimit") unless @throttling_rate_limit.nil?
  @access_log_destination = access_log_destination
  Jsii::Type.check_type(@access_log_destination, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JQWNjZXNzTG9nRGVzdGluYXRpb24ifQ==")), "accessLogDestination") unless @access_log_destination.nil?
  @access_log_format = access_log_format
  Jsii::Type.check_type(@access_log_format, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5BY2Nlc3NMb2dGb3JtYXQifQ==")), "accessLogFormat") unless @access_log_format.nil?
  @cache_cluster_enabled = cache_cluster_enabled
  Jsii::Type.check_type(@cache_cluster_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "cacheClusterEnabled") unless @cache_cluster_enabled.nil?
  @cache_cluster_size = cache_cluster_size
  Jsii::Type.check_type(@cache_cluster_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cacheClusterSize") unless @cache_cluster_size.nil?
  @client_certificate_id = client_certificate_id
  Jsii::Type.check_type(@client_certificate_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clientCertificateId") unless @client_certificate_id.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @documentation_version = documentation_version
  Jsii::Type.check_type(@documentation_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "documentationVersion") unless @documentation_version.nil?
  @method_options = method_options.is_a?(Hash) ? method_options.transform_values { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::APIGateway::MethodDeploymentOptions.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : method_options
  Jsii::Type.check_type(@method_options, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5Lk1ldGhvZERlcGxveW1lbnRPcHRpb25zIn0sImtpbmQiOiJtYXAifX0=")), "methodOptions") unless @method_options.nil?
  @stage_name = stage_name
  Jsii::Type.check_type(@stage_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stageName") unless @stage_name.nil?
  @tracing_enabled = tracing_enabled
  Jsii::Type.check_type(@tracing_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "tracingEnabled") unless @tracing_enabled.nil?
  @variables = variables
  Jsii::Type.check_type(@variables, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "variables") unless @variables.nil?
end

Instance Attribute Details

#access_log_destinationAWSCDK::APIGateway::IAccessLogDestination? (readonly)

Note:

Default: - No destination

The CloudWatch Logs log group or Firehose delivery stream where to write access logs.



127
128
129
# File 'api_gateway/stage_options.rb', line 127

def access_log_destination
  @access_log_destination
end

#access_log_formatAWSCDK::APIGateway::AccessLogFormat? (readonly)

Note:

Default: - Common Log Format

A single line format of access logs of data, as specified by selected $content variables.

The format must include either AccessLogFormat.contextRequestId() or AccessLogFormat.contextExtendedRequestId().



136
137
138
# File 'api_gateway/stage_options.rb', line 136

def access_log_format
  @access_log_format
end

#cache_cluster_enabledBoolean? (readonly)

Note:

Default: - Disabled for the stage.

Indicates whether cache clustering is enabled for the stage.

Returns:

  • (Boolean, nil)


141
142
143
# File 'api_gateway/stage_options.rb', line 141

def cache_cluster_enabled
  @cache_cluster_enabled
end

#cache_cluster_sizeString? (readonly)

Note:

Default: 0.5

The stage's cache cluster size.

Returns:

  • (String, nil)


146
147
148
# File 'api_gateway/stage_options.rb', line 146

def cache_cluster_size
  @cache_cluster_size
end

#cache_data_encryptedBoolean? (readonly)

Note:

Default: false

Indicates whether the cached responses are encrypted.

Returns:

  • (Boolean, nil)


70
71
72
# File 'api_gateway/stage_options.rb', line 70

def cache_data_encrypted
  @cache_data_encrypted
end

#cache_ttlAWSCDK::Duration? (readonly)

Note:

Default: Duration.minutes(5)

Specifies the time to live (TTL), in seconds, for cached responses.

The higher the TTL, the longer the response will be cached.



79
80
81
# File 'api_gateway/stage_options.rb', line 79

def cache_ttl
  @cache_ttl
end

#caching_enabledBoolean? (readonly)

Note:

Default: - Caching is Disabled.

Specifies whether responses should be cached and returned for requests.

A cache cluster must be enabled on the stage for responses to be cached.

Returns:

  • (Boolean, nil)


87
88
89
# File 'api_gateway/stage_options.rb', line 87

def caching_enabled
  @caching_enabled
end

#client_certificate_idString? (readonly)

Note:

Default: - None.

The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage.

Returns:

  • (String, nil)


151
152
153
# File 'api_gateway/stage_options.rb', line 151

def client_certificate_id
  @client_certificate_id
end

#data_trace_enabledBoolean? (readonly)

Note:

Default: false

Specifies whether data trace logging is enabled for this method.

When enabled, API gateway will log the full API requests and responses. This can be useful to troubleshoot APIs, but can result in logging sensitive data. We recommend that you don't enable this feature for production APIs.

Returns:

  • (Boolean, nil)


96
97
98
# File 'api_gateway/stage_options.rb', line 96

def data_trace_enabled
  @data_trace_enabled
end

#descriptionString? (readonly)

Note:

Default: - No description.

A description of the purpose of the stage.

Returns:

  • (String, nil)


156
157
158
# File 'api_gateway/stage_options.rb', line 156

def description
  @description
end

#documentation_versionString? (readonly)

Note:

Default: - No documentation version.

The version identifier of the API documentation snapshot.

Returns:

  • (String, nil)


161
162
163
# File 'api_gateway/stage_options.rb', line 161

def documentation_version
  @documentation_version
end

#logging_levelAWSCDK::APIGateway::MethodLoggingLevel? (readonly)

Note:

Default: - Off

Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs.



101
102
103
# File 'api_gateway/stage_options.rb', line 101

def logging_level
  @logging_level
end

#method_optionsHash{String => AWSCDK::APIGateway::MethodDeploymentOptions}? (readonly)

Note:

Default: - Common options will be used.

Method deployment options for specific resources/methods.

These will override common options defined in StageOptions#methodOptions.

Returns:



169
170
171
# File 'api_gateway/stage_options.rb', line 169

def method_options
  @method_options
end

#metrics_enabledBoolean? (readonly)

Note:

Default: false

Specifies whether Amazon CloudWatch metrics are enabled for this method.

Returns:

  • (Boolean, nil)


106
107
108
# File 'api_gateway/stage_options.rb', line 106

def metrics_enabled
  @metrics_enabled
end

#stage_nameString? (readonly)

Note:

Default: - "prod"

The name of the stage, which API Gateway uses as the first path segment in the invoked Uniform Resource Identifier (URI).

Returns:

  • (String, nil)


174
175
176
# File 'api_gateway/stage_options.rb', line 174

def stage_name
  @stage_name
end

#throttling_burst_limitNumeric? (readonly)

Note:

Default: - No additional restriction.

Specifies the throttling burst limit.

The total rate of all requests in your AWS account is limited to 5,000 requests.



114
115
116
# File 'api_gateway/stage_options.rb', line 114

def throttling_burst_limit
  @throttling_burst_limit
end

#throttling_rate_limitNumeric? (readonly)

Note:

Default: - No additional restriction.

Specifies the throttling rate limit.

The total rate of all requests in your AWS account is limited to 10,000 requests per second (rps).



122
123
124
# File 'api_gateway/stage_options.rb', line 122

def throttling_rate_limit
  @throttling_rate_limit
end

#tracing_enabledBoolean? (readonly)

Note:

Default: false

Specifies whether Amazon X-Ray tracing is enabled for this method.

Returns:

  • (Boolean, nil)


179
180
181
# File 'api_gateway/stage_options.rb', line 179

def tracing_enabled
  @tracing_enabled
end

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

Note:

Default: - No stage variables.

A map that defines the stage variables.

Variable names must consist of alphanumeric characters, and the values must match the following regular expression: [A-Za-z0-9-._~:/?#&=,]+.

Returns:

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


188
189
190
# File 'api_gateway/stage_options.rb', line 188

def variables
  @variables
end

Class Method Details

.jsii_propertiesObject



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

def self.jsii_properties
  {
    :cache_data_encrypted => "cacheDataEncrypted",
    :cache_ttl => "cacheTtl",
    :caching_enabled => "cachingEnabled",
    :data_trace_enabled => "dataTraceEnabled",
    :logging_level => "loggingLevel",
    :metrics_enabled => "metricsEnabled",
    :throttling_burst_limit => "throttlingBurstLimit",
    :throttling_rate_limit => "throttlingRateLimit",
    :access_log_destination => "accessLogDestination",
    :access_log_format => "accessLogFormat",
    :cache_cluster_enabled => "cacheClusterEnabled",
    :cache_cluster_size => "cacheClusterSize",
    :client_certificate_id => "clientCertificateId",
    :description => "description",
    :documentation_version => "documentationVersion",
    :method_options => "methodOptions",
    :stage_name => "stageName",
    :tracing_enabled => "tracingEnabled",
    :variables => "variables",
  }
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
238
239
# File 'api_gateway/stage_options.rb', line 214

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "cacheDataEncrypted" => @cache_data_encrypted,
    "cacheTtl" => @cache_ttl,
    "cachingEnabled" => @caching_enabled,
    "dataTraceEnabled" => @data_trace_enabled,
    "loggingLevel" => @logging_level,
    "metricsEnabled" => @metrics_enabled,
    "throttlingBurstLimit" => @throttling_burst_limit,
    "throttlingRateLimit" => @throttling_rate_limit,
    "accessLogDestination" => @access_log_destination,
    "accessLogFormat" => @access_log_format,
    "cacheClusterEnabled" => @cache_cluster_enabled,
    "cacheClusterSize" => @cache_cluster_size,
    "clientCertificateId" => @client_certificate_id,
    "description" => @description,
    "documentationVersion" => @documentation_version,
    "methodOptions" => @method_options,
    "stageName" => @stage_name,
    "tracingEnabled" => @tracing_enabled,
    "variables" => @variables,
  })
  result.compact
end