Class: AWSCDK::APIGateway::StageProps

Inherits:
StageOptions
  • Object
show all
Defined in:
api_gateway/stage_props.rb

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, deployment:) ⇒ StageProps

Returns a new instance of StageProps.

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.

  • deployment (AWSCDK::APIGateway::Deployment)

    The deployment that this stage points to [disable-awslint:ref-via-interface].



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
65
66
67
# File 'api_gateway/stage_props.rb', line 26

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, deployment:)
  @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?
  @deployment = deployment
  Jsii::Type.check_type(@deployment, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5EZXBsb3ltZW50In0=")), "deployment")
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.



130
131
132
# File 'api_gateway/stage_props.rb', line 130

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().



139
140
141
# File 'api_gateway/stage_props.rb', line 139

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)


144
145
146
# File 'api_gateway/stage_props.rb', line 144

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)


149
150
151
# File 'api_gateway/stage_props.rb', line 149

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)


73
74
75
# File 'api_gateway/stage_props.rb', line 73

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.



82
83
84
# File 'api_gateway/stage_props.rb', line 82

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)


90
91
92
# File 'api_gateway/stage_props.rb', line 90

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)


154
155
156
# File 'api_gateway/stage_props.rb', line 154

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)


99
100
101
# File 'api_gateway/stage_props.rb', line 99

def data_trace_enabled
  @data_trace_enabled
end

#deploymentAWSCDK::APIGateway::Deployment (readonly)

The deployment that this stage points to [disable-awslint:ref-via-interface].



195
196
197
# File 'api_gateway/stage_props.rb', line 195

def deployment
  @deployment
end

#descriptionString? (readonly)

Note:

Default: - No description.

A description of the purpose of the stage.

Returns:

  • (String, nil)


159
160
161
# File 'api_gateway/stage_props.rb', line 159

def description
  @description
end

#documentation_versionString? (readonly)

Note:

Default: - No documentation version.

The version identifier of the API documentation snapshot.

Returns:

  • (String, nil)


164
165
166
# File 'api_gateway/stage_props.rb', line 164

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.



104
105
106
# File 'api_gateway/stage_props.rb', line 104

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:



172
173
174
# File 'api_gateway/stage_props.rb', line 172

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)


109
110
111
# File 'api_gateway/stage_props.rb', line 109

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)


177
178
179
# File 'api_gateway/stage_props.rb', line 177

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.



117
118
119
# File 'api_gateway/stage_props.rb', line 117

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).



125
126
127
# File 'api_gateway/stage_props.rb', line 125

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)


182
183
184
# File 'api_gateway/stage_props.rb', line 182

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)


191
192
193
# File 'api_gateway/stage_props.rb', line 191

def variables
  @variables
end

Class Method Details

.jsii_propertiesObject



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'api_gateway/stage_props.rb', line 197

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",
    :deployment => "deployment",
  }
end

Instance Method Details

#to_jsiiObject



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'api_gateway/stage_props.rb', line 222

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,
    "deployment" => @deployment,
  })
  result.compact
end