Class: AWSCDK::APIGateway::StageOptions
- Inherits:
-
MethodDeploymentOptions
- Object
- MethodDeploymentOptions
- AWSCDK::APIGateway::StageOptions
- Defined in:
- api_gateway/stage_options.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#access_log_destination ⇒ AWSCDK::APIGateway::IAccessLogDestination?
readonly
The CloudWatch Logs log group or Firehose delivery stream where to write access logs.
-
#access_log_format ⇒ AWSCDK::APIGateway::AccessLogFormat?
readonly
A single line format of access logs of data, as specified by selected $content variables.
-
#cache_cluster_enabled ⇒ Boolean?
readonly
Indicates whether cache clustering is enabled for the stage.
-
#cache_cluster_size ⇒ String?
readonly
The stage's cache cluster size.
-
#cache_data_encrypted ⇒ Boolean?
readonly
Indicates whether the cached responses are encrypted.
-
#cache_ttl ⇒ AWSCDK::Duration?
readonly
Specifies the time to live (TTL), in seconds, for cached responses.
-
#caching_enabled ⇒ Boolean?
readonly
Specifies whether responses should be cached and returned for requests.
-
#client_certificate_id ⇒ String?
readonly
The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage.
-
#data_trace_enabled ⇒ Boolean?
readonly
Specifies whether data trace logging is enabled for this method.
-
#description ⇒ String?
readonly
A description of the purpose of the stage.
-
#documentation_version ⇒ String?
readonly
The version identifier of the API documentation snapshot.
-
#logging_level ⇒ AWSCDK::APIGateway::MethodLoggingLevel?
readonly
Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
-
#method_options ⇒ Hash{String => AWSCDK::APIGateway::MethodDeploymentOptions}?
readonly
Method deployment options for specific resources/methods.
-
#metrics_enabled ⇒ Boolean?
readonly
Specifies whether Amazon CloudWatch metrics are enabled for this method.
-
#stage_name ⇒ String?
readonly
The name of the stage, which API Gateway uses as the first path segment in the invoked Uniform Resource Identifier (URI).
-
#throttling_burst_limit ⇒ Numeric?
readonly
Specifies the throttling burst limit.
-
#throttling_rate_limit ⇒ Numeric?
readonly
Specifies the throttling rate limit.
-
#tracing_enabled ⇒ Boolean?
readonly
Specifies whether Amazon X-Ray tracing is enabled for this method.
-
#variables ⇒ Hash{String => String}?
readonly
A map that defines the stage variables.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
A new instance of StageOptions.
- #to_jsii ⇒ Object
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.
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 = .is_a?(Hash) ? .transform_values { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::APIGateway::MethodDeploymentOptions.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : 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_destination ⇒ AWSCDK::APIGateway::IAccessLogDestination? (readonly)
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_format ⇒ AWSCDK::APIGateway::AccessLogFormat? (readonly)
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_enabled ⇒ Boolean? (readonly)
Default: - Disabled for the stage.
Indicates whether cache clustering is enabled for the stage.
141 142 143 |
# File 'api_gateway/stage_options.rb', line 141 def cache_cluster_enabled @cache_cluster_enabled end |
#cache_cluster_size ⇒ String? (readonly)
Default: 0.5
The stage's cache cluster size.
146 147 148 |
# File 'api_gateway/stage_options.rb', line 146 def cache_cluster_size @cache_cluster_size end |
#cache_data_encrypted ⇒ Boolean? (readonly)
Default: false
Indicates whether the cached responses are encrypted.
70 71 72 |
# File 'api_gateway/stage_options.rb', line 70 def cache_data_encrypted @cache_data_encrypted end |
#cache_ttl ⇒ AWSCDK::Duration? (readonly)
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_enabled ⇒ Boolean? (readonly)
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.
87 88 89 |
# File 'api_gateway/stage_options.rb', line 87 def caching_enabled @caching_enabled end |
#client_certificate_id ⇒ String? (readonly)
Default: - None.
The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage.
151 152 153 |
# File 'api_gateway/stage_options.rb', line 151 def client_certificate_id @client_certificate_id end |
#data_trace_enabled ⇒ Boolean? (readonly)
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.
96 97 98 |
# File 'api_gateway/stage_options.rb', line 96 def data_trace_enabled @data_trace_enabled end |
#description ⇒ String? (readonly)
Default: - No description.
A description of the purpose of the stage.
156 157 158 |
# File 'api_gateway/stage_options.rb', line 156 def description @description end |
#documentation_version ⇒ String? (readonly)
Default: - No documentation version.
The version identifier of the API documentation snapshot.
161 162 163 |
# File 'api_gateway/stage_options.rb', line 161 def documentation_version @documentation_version end |
#logging_level ⇒ AWSCDK::APIGateway::MethodLoggingLevel? (readonly)
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_options ⇒ Hash{String => AWSCDK::APIGateway::MethodDeploymentOptions}? (readonly)
Default: - Common options will be used.
Method deployment options for specific resources/methods.
These will
override common options defined in StageOptions#methodOptions.
169 170 171 |
# File 'api_gateway/stage_options.rb', line 169 def @method_options end |
#metrics_enabled ⇒ Boolean? (readonly)
Default: false
Specifies whether Amazon CloudWatch metrics are enabled for this method.
106 107 108 |
# File 'api_gateway/stage_options.rb', line 106 def metrics_enabled @metrics_enabled end |
#stage_name ⇒ String? (readonly)
Default: - "prod"
The name of the stage, which API Gateway uses as the first path segment in the invoked Uniform Resource Identifier (URI).
174 175 176 |
# File 'api_gateway/stage_options.rb', line 174 def stage_name @stage_name end |
#throttling_burst_limit ⇒ Numeric? (readonly)
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_limit ⇒ Numeric? (readonly)
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_enabled ⇒ Boolean? (readonly)
Default: false
Specifies whether Amazon X-Ray tracing is enabled for this method.
179 180 181 |
# File 'api_gateway/stage_options.rb', line 179 def tracing_enabled @tracing_enabled end |
#variables ⇒ Hash{String => String}? (readonly)
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-._~:/?#&=,]+.
188 189 190 |
# File 'api_gateway/stage_options.rb', line 188 def variables @variables end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |