Class: AWSCDK::ElasticBeanstalk::CfnApplication::MaxCountRuleProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
elastic_beanstalk/cfn_application.rb

Overview

Use the MaxAgeRule property type to specify a max count rule to restrict the number of application versions that are retained for an AWS Elastic Beanstalk application when defining an AWS::ElasticBeanstalk::Application resource in an AWS CloudFormation template.

A lifecycle rule that deletes the oldest application version when the maximum count is exceeded.

MaxCountRule is a property of the ApplicationVersionLifecycleConfig property type.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delete_source_from_s3: nil, enabled: nil, max_count: nil) ⇒ MaxCountRuleProperty

Returns a new instance of MaxCountRuleProperty.

Parameters:

  • delete_source_from_s3 (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.

  • enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specify true to apply the rule, or false to disable it.

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

    Specify the maximum number of application versions to retain.



702
703
704
705
706
707
708
709
# File 'elastic_beanstalk/cfn_application.rb', line 702

def initialize(delete_source_from_s3: nil, enabled: nil, max_count: nil)
  @delete_source_from_s3 = delete_source_from_s3
  Jsii::Type.check_type(@delete_source_from_s3, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "deleteSourceFromS3") unless @delete_source_from_s3.nil?
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enabled") unless @enabled.nil?
  @max_count = max_count
  Jsii::Type.check_type(@max_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxCount") unless @max_count.nil?
end

Instance Attribute Details

#delete_source_from_s3Boolean, ... (readonly)

Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application version.



715
716
717
# File 'elastic_beanstalk/cfn_application.rb', line 715

def delete_source_from_s3
  @delete_source_from_s3
end

#enabledBoolean, ... (readonly)

Specify true to apply the rule, or false to disable it.



720
721
722
# File 'elastic_beanstalk/cfn_application.rb', line 720

def enabled
  @enabled
end

#max_countNumeric? (readonly)

Specify the maximum number of application versions to retain.



725
726
727
# File 'elastic_beanstalk/cfn_application.rb', line 725

def max_count
  @max_count
end

Class Method Details

.jsii_propertiesObject



727
728
729
730
731
732
733
# File 'elastic_beanstalk/cfn_application.rb', line 727

def self.jsii_properties
  {
    :delete_source_from_s3 => "deleteSourceFromS3",
    :enabled => "enabled",
    :max_count => "maxCount",
  }
end

Instance Method Details

#to_jsiiObject



735
736
737
738
739
740
741
742
743
# File 'elastic_beanstalk/cfn_application.rb', line 735

def to_jsii
  result = {}
  result.merge!({
    "deleteSourceFromS3" => @delete_source_from_s3,
    "enabled" => @enabled,
    "maxCount" => @max_count,
  })
  result.compact
end