Class: AWSCDK::Logs::CfnLogGroupProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
logs/cfn_log_group_props.rb

Overview

Properties for defining a CfnLogGroup.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bearer_token_authentication_enabled: nil, data_protection_policy: nil, deletion_protection_enabled: nil, field_index_policies: nil, kms_key_id: nil, log_group_class: nil, log_group_name: nil, resource_policy_document: nil, retention_in_days: nil, tags: nil) ⇒ CfnLogGroupProps

Returns a new instance of CfnLogGroupProps.

Parameters:

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

    Indicates whether bearer token authentication is enabled for this log group.

  • data_protection_policy (Object, nil) (defaults to: nil)

    Creates a data protection policy and assigns it to the log group.

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

    Indicates whether deletion protection is enabled for this log group.

  • field_index_policies (Array<Object>, AWSCDK::IResolvable, nil) (defaults to: nil)

    Creates or updates a field index policy for the specified log group.

  • kms_key_id (String, AWSCDK::Interfaces::AWSKMS::IKeyRef, nil) (defaults to: nil)

    The Amazon Resource Name (ARN) of the AWS key to use when encrypting log data.

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

    Specifies the log group class for this log group. There are two classes:.

  • log_group_name (String, AWSCDK::Interfaces::AWSLambda::IFunctionRef, nil) (defaults to: nil)

    The name of the log group.

  • resource_policy_document (Object, nil) (defaults to: nil)

    Creates or updates a resource policy for the specified log group that allows other services to put log events to this account.

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

    The number of days to retain the log events in the specified log group.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    An array of key-value pairs to apply to the log group.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'logs/cfn_log_group_props.rb', line 19

def initialize(bearer_token_authentication_enabled: nil, data_protection_policy: nil, deletion_protection_enabled: nil, field_index_policies: nil, kms_key_id: nil, log_group_class: nil, log_group_name: nil, resource_policy_document: nil, retention_in_days: nil, tags: nil)
  @bearer_token_authentication_enabled = bearer_token_authentication_enabled
  Jsii::Type.check_type(@bearer_token_authentication_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "bearerTokenAuthenticationEnabled") unless @bearer_token_authentication_enabled.nil?
  @data_protection_policy = data_protection_policy
  Jsii::Type.check_type(@data_protection_policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "dataProtectionPolicy") unless @data_protection_policy.nil?
  @deletion_protection_enabled = deletion_protection_enabled
  Jsii::Type.check_type(@deletion_protection_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "deletionProtectionEnabled") unless @deletion_protection_enabled.nil?
  @field_index_policies = field_index_policies
  Jsii::Type.check_type(@field_index_policies, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siY29sbGVjdGlvbiI6eyJlbGVtZW50dHlwZSI6eyJwcmltaXRpdmUiOiJhbnkifSwia2luZCI6ImFycmF5In19LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "fieldIndexPolicies") unless @field_index_policies.nil?
  @kms_key_id = kms_key_id
  Jsii::Type.check_type(@kms_key_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19rbXMuSUtleVJlZiJ9XX19")), "kmsKeyId") unless @kms_key_id.nil?
  @log_group_class = log_group_class
  Jsii::Type.check_type(@log_group_class, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "logGroupClass") unless @log_group_class.nil?
  @log_group_name = log_group_name
  Jsii::Type.check_type(@log_group_name, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19sYW1iZGEuSUZ1bmN0aW9uUmVmIn1dfX0=")), "logGroupName") unless @log_group_name.nil?
  @resource_policy_document = resource_policy_document
  Jsii::Type.check_type(@resource_policy_document, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "resourcePolicyDocument") unless @resource_policy_document.nil?
  @retention_in_days = retention_in_days
  Jsii::Type.check_type(@retention_in_days, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retentionInDays") unless @retention_in_days.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#bearer_token_authentication_enabledBoolean, ... (readonly)

Note:

Default: - false

Indicates whether bearer token authentication is enabled for this log group.

When enabled, bearer token authentication is allowed on operations until it is explicitly disabled.



49
50
51
# File 'logs/cfn_log_group_props.rb', line 49

def bearer_token_authentication_enabled
  @bearer_token_authentication_enabled
end

#data_protection_policyObject? (readonly)

Creates a data protection policy and assigns it to the log group.

A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.



56
57
58
# File 'logs/cfn_log_group_props.rb', line 56

def data_protection_policy
  @data_protection_policy
end

#deletion_protection_enabledBoolean, ... (readonly)

Note:

Default: - false

Indicates whether deletion protection is enabled for this log group.

When enabled, deletion protection blocks all deletion operations until it is explicitly disabled.



64
65
66
# File 'logs/cfn_log_group_props.rb', line 64

def deletion_protection_enabled
  @deletion_protection_enabled
end

#field_index_policiesArray<Object>, ... (readonly)

Creates or updates a field index policy for the specified log group.

Only log groups in the Standard log class support field index policies. For more information about log classes, see Log classes .

You can use field index policies to create field indexes on fields found in log events in the log group. Creating field indexes lowers the costs for CloudWatch Logs Insights queries that reference those field indexes, because these queries attempt to skip the processing of log events that are known to not match the indexed field. Good fields to index are fields that you often need to query for and fields that have high cardinality of values Common examples of indexes include request ID, session ID, userID, and instance IDs. For more information, see Create field indexes to improve query performance and reduce costs .

Currently, this array supports only one field index policy object.



75
76
77
# File 'logs/cfn_log_group_props.rb', line 75

def field_index_policies
  @field_index_policies
end

#kms_key_idString, ... (readonly)

The Amazon Resource Name (ARN) of the AWS key to use when encrypting log data.

To associate an AWS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs . This enables CloudWatch Logs to decrypt this data whenever it is requested.

If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an InvalidParameterException error.

Log group data is always encrypted in CloudWatch Logs . If you omit this key, the encryption does not use AWS . For more information, see Encrypt log data in CloudWatch Logs using AWS Key Management Service



86
87
88
# File 'logs/cfn_log_group_props.rb', line 86

def kms_key_id
  @kms_key_id
end

#log_group_classString? (readonly)

Note:

Default: - "STANDARD"

Specifies the log group class for this log group. There are two classes:.

  • The Standard log class supports all CloudWatch Logs features.
  • The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs lower costs.

For details about the features supported by each class, see Log classes



97
98
99
# File 'logs/cfn_log_group_props.rb', line 97

def log_group_class
  @log_group_class
end

#log_group_nameString, ... (readonly)

The name of the log group.

If you don't specify a name, AWS CloudFormation generates a unique ID for the log group.



104
105
106
# File 'logs/cfn_log_group_props.rb', line 104

def log_group_name
  @log_group_name
end

#resource_policy_documentObject? (readonly)

Creates or updates a resource policy for the specified log group that allows other services to put log events to this account.

A LogGroup can have 1 resource policy.



111
112
113
# File 'logs/cfn_log_group_props.rb', line 111

def resource_policy_document
  @resource_policy_document
end

#retention_in_daysNumeric? (readonly)

The number of days to retain the log events in the specified log group.

Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.

To set a log group so that its log events do not expire, do not specify this property.



120
121
122
# File 'logs/cfn_log_group_props.rb', line 120

def retention_in_days
  @retention_in_days
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

An array of key-value pairs to apply to the log group.

For more information, see Tag .



127
128
129
# File 'logs/cfn_log_group_props.rb', line 127

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'logs/cfn_log_group_props.rb', line 129

def self.jsii_properties
  {
    :bearer_token_authentication_enabled => "bearerTokenAuthenticationEnabled",
    :data_protection_policy => "dataProtectionPolicy",
    :deletion_protection_enabled => "deletionProtectionEnabled",
    :field_index_policies => "fieldIndexPolicies",
    :kms_key_id => "kmsKeyId",
    :log_group_class => "logGroupClass",
    :log_group_name => "logGroupName",
    :resource_policy_document => "resourcePolicyDocument",
    :retention_in_days => "retentionInDays",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'logs/cfn_log_group_props.rb', line 144

def to_jsii
  result = {}
  result.merge!({
    "bearerTokenAuthenticationEnabled" => @bearer_token_authentication_enabled,
    "dataProtectionPolicy" => @data_protection_policy,
    "deletionProtectionEnabled" => @deletion_protection_enabled,
    "fieldIndexPolicies" => @field_index_policies,
    "kmsKeyId" => @kms_key_id,
    "logGroupClass" => @log_group_class,
    "logGroupName" => @log_group_name,
    "resourcePolicyDocument" => @resource_policy_document,
    "retentionInDays" => @retention_in_days,
    "tags" => @tags,
  })
  result.compact
end