Class: AWSCDK::Logs::CfnAccountPolicyProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Logs::CfnAccountPolicyProps
- Defined in:
- logs/cfn_account_policy_props.rb
Overview
Properties for defining a CfnAccountPolicy.
Instance Attribute Summary collapse
-
#policy_document ⇒ String
readonly
Specify the policy, in JSON.
-
#policy_name ⇒ String
readonly
A name for the policy.
-
#policy_type ⇒ String
readonly
The type of policy that you're creating or updating.
-
#scope ⇒ String?
readonly
Currently the only valid value for this parameter is
ALL, which specifies that the policy applies to all log groups in the account. -
#selection_criteria ⇒ String?
readonly
Use this parameter to apply the new policy to a subset of log groups in the account.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(policy_document:, policy_name:, policy_type:, scope: nil, selection_criteria: nil) ⇒ CfnAccountPolicyProps
constructor
A new instance of CfnAccountPolicyProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(policy_document:, policy_name:, policy_type:, scope: nil, selection_criteria: nil) ⇒ CfnAccountPolicyProps
Returns a new instance of CfnAccountPolicyProps.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'logs/cfn_account_policy_props.rb', line 14 def initialize(policy_document:, policy_name:, policy_type:, scope: nil, selection_criteria: nil) @policy_document = policy_document Jsii::Type.check_type(@policy_document, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyDocument") @policy_name = policy_name Jsii::Type.check_type(@policy_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyName") @policy_type = policy_type Jsii::Type.check_type(@policy_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyType") @scope = scope Jsii::Type.check_type(@scope, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "scope") unless @scope.nil? @selection_criteria = selection_criteria Jsii::Type.check_type(@selection_criteria, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "selectionCriteria") unless @selection_criteria.nil? end |
Instance Attribute Details
#policy_document ⇒ String (readonly)
Specify the policy, in JSON.
Data protection policy
A data protection policy must include two JSON blocks:
- The first block must include both a
DataIdentiferarray and anOperationproperty with anAuditaction. TheDataIdentiferarray lists the types of sensitive data that you want to mask. For more information about the available options, see Types of data that you can mask .
The Operation property with an Audit action is required to find the sensitive data terms. This Audit action must contain a FindingsDestination object. You can optionally use that FindingsDestination object to list one or more destinations to send audit findings to. If you specify destinations such as log groups, Firehose streams, and S3 buckets, they must already exist.
- The second block must include both a
DataIdentiferarray and anOperationproperty with anDeidentifyaction. TheDataIdentiferarray must exactly match theDataIdentiferarray in the first block of the policy.
The Operation property with the Deidentify action is what actually masks the data, and it must contain the "MaskConfig": {} object. The "MaskConfig": {} object must be empty.
The contents of the two
DataIdentiferarrays must match exactly.
In addition to the two JSON blocks, the policy_document can also include Name , Description , and Version fields. The Name is different than the operation's policy_name parameter, and is used as a dimension when CloudWatch Logs reports audit findings metrics to CloudWatch .
The JSON specified in policy_document can be up to 30,720 characters long.
Subscription filter policy
A subscription filter policy can include the following attributes in a JSON block:
- DestinationArn The ARN of the destination to deliver log events to. Supported destinations are:
- An Kinesis Data Streams data stream in the same account as the subscription policy, for same-account delivery.
- An Firehose data stream in the same account as the subscription policy, for same-account delivery.
- A Lambda function in the same account as the subscription policy, for same-account delivery.
- A logical destination in a different account created with PutDestination , for cross-account delivery. Kinesis Data Streams and Firehose are supported as logical destinations.
- RoleArn The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don't need to provide the ARN when you are working with a logical destination for cross-account delivery.
- FilterPattern A filter pattern for subscribing to a filtered stream of log events.
- Distribution The method used to distribute log data to the destination. By default, log data is grouped by log stream, but the grouping can be set to
Randomfor a more even distribution. This property is only applicable when the destination is an Kinesis Data Streams data stream.
Field index policy
A field index filter policy can include the following attribute in a JSON block:
- Fields The array of field indexes to create.
The following is an example of an index policy document that creates two indexes, RequestId and TransactionId .
"policyDocument": "{ \"Fields\": [ \"RequestId\", \"TransactionId\" ] }"
Transformer policy
A transformer policy must include one JSON block with the array of processors and their configurations. For more information about available processors, see Processors that you can use .
76 77 78 |
# File 'logs/cfn_account_policy_props.rb', line 76 def policy_document @policy_document end |
#policy_name ⇒ String (readonly)
A name for the policy.
This must be unique within the account.
83 84 85 |
# File 'logs/cfn_account_policy_props.rb', line 83 def policy_name @policy_name end |
#policy_type ⇒ String (readonly)
The type of policy that you're creating or updating.
88 89 90 |
# File 'logs/cfn_account_policy_props.rb', line 88 def policy_type @policy_type end |
#scope ⇒ String? (readonly)
Currently the only valid value for this parameter is ALL , which specifies that the policy applies to all log groups in the account.
If you omit this parameter, the default of ALL is used. To scope down a subscription filter policy to a subset of log groups, use the SelectionCriteria parameter.
95 96 97 |
# File 'logs/cfn_account_policy_props.rb', line 95 def scope @scope end |
#selection_criteria ⇒ String? (readonly)
Use this parameter to apply the new policy to a subset of log groups in the account.
You need to specify SelectionCriteria only when you specify SUBSCRIPTION_FILTER_POLICY , FIELD_INDEX_POLICY or TRANSFORMER_POLICY for PolicyType .
If PolicyType is SUBSCRIPTION_FILTER_POLICY , the only supported SelectionCriteria filter is LogGroupName NOT IN []
If PolicyType is FIELD_INDEX_POLICY or TRANSFORMER_POLICY , the only supported SelectionCriteria filter is LogGroupNamePrefix
The SelectionCriteria string can be up to 25KB in length. The length is determined by using its UTF-8 bytes.
Using the SelectionCriteria parameter with SUBSCRIPTION_FILTER_POLICY is useful to help prevent infinite loops. For more information, see Log recursion prevention .
110 111 112 |
# File 'logs/cfn_account_policy_props.rb', line 110 def selection_criteria @selection_criteria end |
Class Method Details
.jsii_properties ⇒ Object
112 113 114 115 116 117 118 119 120 |
# File 'logs/cfn_account_policy_props.rb', line 112 def self.jsii_properties { :policy_document => "policyDocument", :policy_name => "policyName", :policy_type => "policyType", :scope => "scope", :selection_criteria => "selectionCriteria", } end |
Instance Method Details
#to_jsii ⇒ Object
122 123 124 125 126 127 128 129 130 131 132 |
# File 'logs/cfn_account_policy_props.rb', line 122 def to_jsii result = {} result.merge!({ "policyDocument" => @policy_document, "policyName" => @policy_name, "policyType" => @policy_type, "scope" => @scope, "selectionCriteria" => @selection_criteria, }) result.compact end |