Class: AWSCDK::IAM::PolicyStatementProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::IAM::PolicyStatementProps
- Defined in:
- iam/policy_statement_props.rb
Overview
Interface for creating a policy statement.
Instance Attribute Summary collapse
-
#actions ⇒ Array<String>?
readonly
List of actions to add to the statement.
-
#conditions ⇒ Hash{String => Object}?
readonly
Conditions to add to the statement.
-
#effect ⇒ AWSCDK::IAM::Effect?
readonly
Whether to allow or deny the actions in this statement.
-
#not_actions ⇒ Array<String>?
readonly
List of not actions to add to the statement.
-
#not_principals ⇒ Array<AWSCDK::IAM::IPrincipal>?
readonly
List of not principals to add to the statement.
-
#not_resources ⇒ Array<String>?
readonly
NotResource ARNs to add to the statement.
-
#principals ⇒ Array<AWSCDK::IAM::IPrincipal>?
readonly
List of principals to add to the statement.
-
#resources ⇒ Array<String>?
readonly
Resource ARNs to add to the statement.
-
#sid ⇒ String?
readonly
The Sid (statement ID) is an optional identifier that you provide for the policy statement.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(actions: nil, conditions: nil, effect: nil, not_actions: nil, not_principals: nil, not_resources: nil, principals: nil, resources: nil, sid: nil) ⇒ PolicyStatementProps
constructor
A new instance of PolicyStatementProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(actions: nil, conditions: nil, effect: nil, not_actions: nil, not_principals: nil, not_resources: nil, principals: nil, resources: nil, sid: nil) ⇒ PolicyStatementProps
Returns a new instance of PolicyStatementProps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'iam/policy_statement_props.rb', line 16 def initialize(actions: nil, conditions: nil, effect: nil, not_actions: nil, not_principals: nil, not_resources: nil, principals: nil, resources: nil, sid: nil) @actions = actions Jsii::Type.check_type(@actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "actions") unless @actions.nil? @conditions = conditions Jsii::Type.check_type(@conditions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "conditions") unless @conditions.nil? @effect = effect Jsii::Type.check_type(@effect, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLkVmZmVjdCJ9")), "effect") unless @effect.nil? @not_actions = not_actions Jsii::Type.check_type(@not_actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "notActions") unless @not_actions.nil? @not_principals = not_principals Jsii::Type.check_type(@not_principals, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pYW0uSVByaW5jaXBhbCJ9LCJraW5kIjoiYXJyYXkifX0=")), "notPrincipals") unless @not_principals.nil? @not_resources = not_resources Jsii::Type.check_type(@not_resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "notResources") unless @not_resources.nil? @principals = principals Jsii::Type.check_type(@principals, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pYW0uSVByaW5jaXBhbCJ9LCJraW5kIjoiYXJyYXkifX0=")), "principals") unless @principals.nil? @resources = resources Jsii::Type.check_type(@resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "resources") unless @resources.nil? @sid = sid Jsii::Type.check_type(@sid, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sid") unless @sid.nil? end |
Instance Attribute Details
#actions ⇒ Array<String>? (readonly)
Default: - no actions
List of actions to add to the statement.
41 42 43 |
# File 'iam/policy_statement_props.rb', line 41 def actions @actions end |
#conditions ⇒ Hash{String => Object}? (readonly)
Default: - no condition
Conditions to add to the statement.
46 47 48 |
# File 'iam/policy_statement_props.rb', line 46 def conditions @conditions end |
#effect ⇒ AWSCDK::IAM::Effect? (readonly)
Default: Effect.ALLOW
Whether to allow or deny the actions in this statement.
51 52 53 |
# File 'iam/policy_statement_props.rb', line 51 def effect @effect end |
#not_actions ⇒ Array<String>? (readonly)
Default: - no not-actions
List of not actions to add to the statement.
56 57 58 |
# File 'iam/policy_statement_props.rb', line 56 def not_actions @not_actions end |
#not_principals ⇒ Array<AWSCDK::IAM::IPrincipal>? (readonly)
Default: - no not principals
List of not principals to add to the statement.
61 62 63 |
# File 'iam/policy_statement_props.rb', line 61 def not_principals @not_principals end |
#not_resources ⇒ Array<String>? (readonly)
Default: - no not-resources
NotResource ARNs to add to the statement.
66 67 68 |
# File 'iam/policy_statement_props.rb', line 66 def not_resources @not_resources end |
#principals ⇒ Array<AWSCDK::IAM::IPrincipal>? (readonly)
Default: - no principals
List of principals to add to the statement.
71 72 73 |
# File 'iam/policy_statement_props.rb', line 71 def principals @principals end |
#resources ⇒ Array<String>? (readonly)
Default: - no resources
Resource ARNs to add to the statement.
76 77 78 |
# File 'iam/policy_statement_props.rb', line 76 def resources @resources end |
#sid ⇒ String? (readonly)
Default: - no sid
The Sid (statement ID) is an optional identifier that you provide for the policy statement.
You can assign a Sid value to each statement in a statement array. In services that let you specify an ID element, such as SQS and SNS, the Sid value is just a sub-ID of the policy document's ID. In IAM, the Sid value must be unique within a JSON policy. In IAM identity policies, the Sid value must contain only alphanumeric characters.
87 88 89 |
# File 'iam/policy_statement_props.rb', line 87 def sid @sid end |
Class Method Details
.jsii_properties ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'iam/policy_statement_props.rb', line 89 def self.jsii_properties { :actions => "actions", :conditions => "conditions", :effect => "effect", :not_actions => "notActions", :not_principals => "notPrincipals", :not_resources => "notResources", :principals => "principals", :resources => "resources", :sid => "sid", } end |
Instance Method Details
#to_jsii ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'iam/policy_statement_props.rb', line 103 def to_jsii result = {} result.merge!({ "actions" => @actions, "conditions" => @conditions, "effect" => @effect, "notActions" => @not_actions, "notPrincipals" => @not_principals, "notResources" => @not_resources, "principals" => @principals, "resources" => @resources, "sid" => @sid, }) result.compact end |