Class: AWSCDK::Logs::LogRetentionProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Logs::LogRetentionProps
- Defined in:
- logs/log_retention_props.rb
Overview
Construction properties for a LogRetention.
Instance Attribute Summary collapse
-
#log_group_name ⇒ String
readonly
The log group name.
-
#log_group_region ⇒ String?
readonly
The region where the log group should be created.
-
#log_retention_retry_options ⇒ AWSCDK::Logs::LogRetentionRetryOptions?
readonly
Retry options for all AWS API calls.
-
#removal_policy ⇒ AWSCDK::RemovalPolicy?
readonly
The removalPolicy for the log group when the stack is deleted.
-
#retention ⇒ AWSCDK::Logs::RetentionDays
readonly
The number of days log events are kept in CloudWatch Logs.
-
#role ⇒ AWSCDK::IAM::IRole?
readonly
The IAM role for the Lambda function associated with the custom resource.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(log_group_name:, retention:, log_group_region: nil, log_retention_retry_options: nil, removal_policy: nil, role: nil) ⇒ LogRetentionProps
constructor
A new instance of LogRetentionProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(log_group_name:, retention:, log_group_region: nil, log_retention_retry_options: nil, removal_policy: nil, role: nil) ⇒ LogRetentionProps
Returns a new instance of LogRetentionProps.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'logs/log_retention_props.rb', line 13 def initialize(log_group_name:, retention:, log_group_region: nil, log_retention_retry_options: nil, removal_policy: nil, role: nil) @log_group_name = log_group_name Jsii::Type.check_type(@log_group_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "logGroupName") @retention = retention Jsii::Type.check_type(@retention, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5SZXRlbnRpb25EYXlzIn0=")), "retention") @log_group_region = log_group_region Jsii::Type.check_type(@log_group_region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "logGroupRegion") unless @log_group_region.nil? @log_retention_retry_options = .is_a?(Hash) ? ::AWSCDK::Logs::LogRetentionRetryOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@log_retention_retry_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5Mb2dSZXRlbnRpb25SZXRyeU9wdGlvbnMifQ==")), "logRetentionRetryOptions") unless @log_retention_retry_options.nil? @removal_policy = removal_policy Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil? end |
Instance Attribute Details
#log_group_name ⇒ String (readonly)
The log group name.
31 32 33 |
# File 'logs/log_retention_props.rb', line 31 def log_group_name @log_group_name end |
#log_group_region ⇒ String? (readonly)
Default: - same region as the stack
The region where the log group should be created.
40 41 42 |
# File 'logs/log_retention_props.rb', line 40 def log_group_region @log_group_region end |
#log_retention_retry_options ⇒ AWSCDK::Logs::LogRetentionRetryOptions? (readonly)
Default: - AWS SDK default retry options
Retry options for all AWS API calls.
45 46 47 |
# File 'logs/log_retention_props.rb', line 45 def @log_retention_retry_options end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: RemovalPolicy.RETAIN
The removalPolicy for the log group when the stack is deleted.
50 51 52 |
# File 'logs/log_retention_props.rb', line 50 def removal_policy @removal_policy end |
#retention ⇒ AWSCDK::Logs::RetentionDays (readonly)
The number of days log events are kept in CloudWatch Logs.
35 36 37 |
# File 'logs/log_retention_props.rb', line 35 def retention @retention end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - A new role is created
The IAM role for the Lambda function associated with the custom resource.
55 56 57 |
# File 'logs/log_retention_props.rb', line 55 def role @role end |
Class Method Details
.jsii_properties ⇒ Object
57 58 59 60 61 62 63 64 65 66 |
# File 'logs/log_retention_props.rb', line 57 def self.jsii_properties { :log_group_name => "logGroupName", :retention => "retention", :log_group_region => "logGroupRegion", :log_retention_retry_options => "logRetentionRetryOptions", :removal_policy => "removalPolicy", :role => "role", } end |
Instance Method Details
#to_jsii ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'logs/log_retention_props.rb', line 68 def to_jsii result = {} result.merge!({ "logGroupName" => @log_group_name, "retention" => @retention, "logGroupRegion" => @log_group_region, "logRetentionRetryOptions" => @log_retention_retry_options, "removalPolicy" => @removal_policy, "role" => @role, }) result.compact end |