Class: AWSCDK::APIGateway::CfnUsagePlan::QuotaSettingsProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gateway/cfn_usage_plan.rb

Overview

QuotaSettings is a property of the AWS::ApiGateway::UsagePlan resource that specifies a target for the maximum number of requests users can make to your REST APIs.

In some cases clients can exceed the targets that you set. Don’t rely on usage plans to control costs. Consider using AWS Budgets to monitor costs and AWS WAF to manage API requests.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(limit: nil, offset: nil, period: nil) ⇒ QuotaSettingsProperty

Returns a new instance of QuotaSettingsProperty.

Parameters:

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

    The target maximum number of requests that can be made in a given time period.

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

    The number of requests subtracted from the given limit in the initial time period.

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

    The time period in which the limit applies.



660
661
662
663
664
665
666
667
# File 'api_gateway/cfn_usage_plan.rb', line 660

def initialize(limit: nil, offset: nil, period: nil)
  @limit = limit
  Jsii::Type.check_type(@limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "limit") unless @limit.nil?
  @offset = offset
  Jsii::Type.check_type(@offset, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "offset") unless @offset.nil?
  @period = period
  Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "period") unless @period.nil?
end

Instance Attribute Details

#limitNumeric? (readonly)

The target maximum number of requests that can be made in a given time period.



673
674
675
# File 'api_gateway/cfn_usage_plan.rb', line 673

def limit
  @limit
end

#offsetNumeric? (readonly)

The number of requests subtracted from the given limit in the initial time period.



678
679
680
# File 'api_gateway/cfn_usage_plan.rb', line 678

def offset
  @offset
end

#periodString? (readonly)

The time period in which the limit applies.

Valid values are "DAY", "WEEK" or "MONTH".



685
686
687
# File 'api_gateway/cfn_usage_plan.rb', line 685

def period
  @period
end

Class Method Details

.jsii_propertiesObject



687
688
689
690
691
692
693
# File 'api_gateway/cfn_usage_plan.rb', line 687

def self.jsii_properties
  {
    :limit => "limit",
    :offset => "offset",
    :period => "period",
  }
end

Instance Method Details

#to_jsiiObject



695
696
697
698
699
700
701
702
703
# File 'api_gateway/cfn_usage_plan.rb', line 695

def to_jsii
  result = {}
  result.merge!({
    "limit" => @limit,
    "offset" => @offset,
    "period" => @period,
  })
  result.compact
end