Class: AWSCDK::Logs::ResourcePolicyProps

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

Overview

Properties to define Cloudwatch log group resource policy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(policy_statements: nil, resource_policy_name: nil) ⇒ ResourcePolicyProps

Returns a new instance of ResourcePolicyProps.

Parameters:

  • policy_statements (Array<AWSCDK::IAM::PolicyStatement>, nil) (defaults to: nil)

    Initial statements to add to the resource policy.

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

    Name of the log group resource policy.



9
10
11
12
13
14
# File 'logs/resource_policy_props.rb', line 9

def initialize(policy_statements: nil, resource_policy_name: nil)
  @policy_statements = policy_statements
  Jsii::Type.check_type(@policy_statements, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pYW0uUG9saWN5U3RhdGVtZW50In0sImtpbmQiOiJhcnJheSJ9fQ==")), "policyStatements") unless @policy_statements.nil?
  @resource_policy_name = resource_policy_name
  Jsii::Type.check_type(@resource_policy_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourcePolicyName") unless @resource_policy_name.nil?
end

Instance Attribute Details

#policy_statementsArray<AWSCDK::IAM::PolicyStatement>? (readonly)

Note:

Default: - No statements

Initial statements to add to the resource policy.

Returns:



20
21
22
# File 'logs/resource_policy_props.rb', line 20

def policy_statements
  @policy_statements
end

#resource_policy_nameString? (readonly)

Note:

Default: - Uses a unique id based on the construct path

Name of the log group resource policy.

Returns:

  • (String, nil)


25
26
27
# File 'logs/resource_policy_props.rb', line 25

def resource_policy_name
  @resource_policy_name
end

Class Method Details

.jsii_propertiesObject



27
28
29
30
31
32
# File 'logs/resource_policy_props.rb', line 27

def self.jsii_properties
  {
    :policy_statements => "policyStatements",
    :resource_policy_name => "resourcePolicyName",
  }
end

Instance Method Details

#to_jsiiObject



34
35
36
37
38
39
40
41
# File 'logs/resource_policy_props.rb', line 34

def to_jsii
  result = {}
  result.merge!({
    "policyStatements" => @policy_statements,
    "resourcePolicyName" => @resource_policy_name,
  })
  result.compact
end