Class: AWSCDK::IAM::GrantOnPrincipalAndResourceOptions
- Inherits:
-
CommonGrantOptions
- Object
- CommonGrantOptions
- AWSCDK::IAM::GrantOnPrincipalAndResourceOptions
- Defined in:
- iam/grant_on_principal_and_resource_options.rb
Overview
Options for a grant operation to both identity and resource.
Instance Attribute Summary collapse
-
#actions ⇒ Array<String>
readonly
The actions to grant.
-
#conditions ⇒ Hash{String => Hash{String => Object}}?
readonly
Any conditions to attach to the grant.
-
#grantee ⇒ AWSCDK::IAM::IGrantable
readonly
The principal to grant to.
-
#resource ⇒ AWSCDK::IAM::IResourceWithPolicyV2
readonly
The resource with a resource policy.
-
#resource_arns ⇒ Array<String>
readonly
The resource ARNs to grant to.
-
#resource_policy_principal ⇒ AWSCDK::IAM::IPrincipal?
readonly
The principal to use in the statement for the resource policy.
-
#resource_self_arns ⇒ Array<String>?
readonly
When referring to the resource in a resource policy, use this as ARN.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(actions:, grantee:, resource_arns:, conditions: nil, resource:, resource_policy_principal: nil, resource_self_arns: nil) ⇒ GrantOnPrincipalAndResourceOptions
constructor
A new instance of GrantOnPrincipalAndResourceOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(actions:, grantee:, resource_arns:, conditions: nil, resource:, resource_policy_principal: nil, resource_self_arns: nil) ⇒ GrantOnPrincipalAndResourceOptions
Returns a new instance of GrantOnPrincipalAndResourceOptions.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 14 def initialize(actions:, grantee:, resource_arns:, conditions: nil, resource:, resource_policy_principal: nil, resource_self_arns: nil) @actions = actions Jsii::Type.check_type(@actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "actions") @grantee = grantee Jsii::Type.check_type(@grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") @resource_arns = resource_arns Jsii::Type.check_type(@resource_arns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "resourceArns") @conditions = conditions Jsii::Type.check_type(@conditions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoiYW55In0sImtpbmQiOiJtYXAifX0sImtpbmQiOiJtYXAifX0=")), "conditions") unless @conditions.nil? @resource = resource Jsii::Type.check_type(@resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSZXNvdXJjZVdpdGhQb2xpY3lWMiJ9")), "resource") @resource_policy_principal = resource_policy_principal Jsii::Type.check_type(@resource_policy_principal, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklQcmluY2lwYWwifQ==")), "resourcePolicyPrincipal") unless @resource_policy_principal.nil? @resource_self_arns = resource_self_arns Jsii::Type.check_type(@resource_self_arns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "resourceSelfArns") unless @resource_self_arns.nil? end |
Instance Attribute Details
#actions ⇒ Array<String> (readonly)
The actions to grant.
34 35 36 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 34 def actions @actions end |
#conditions ⇒ Hash{String => Hash{String => Object}}? (readonly)
Default: - No conditions
Any conditions to attach to the grant.
48 49 50 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 48 def conditions @conditions end |
#grantee ⇒ AWSCDK::IAM::IGrantable (readonly)
Default: if principal is undefined, no work is done.
The principal to grant to.
39 40 41 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 39 def grantee @grantee end |
#resource ⇒ AWSCDK::IAM::IResourceWithPolicyV2 (readonly)
The resource with a resource policy.
The statement will always be added to the resource policy.
54 55 56 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 54 def resource @resource end |
#resource_arns ⇒ Array<String> (readonly)
The resource ARNs to grant to.
43 44 45 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 43 def resource_arns @resource_arns end |
#resource_policy_principal ⇒ AWSCDK::IAM::IPrincipal? (readonly)
Default: - the principal of the grantee will be used
The principal to use in the statement for the resource policy.
59 60 61 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 59 def resource_policy_principal @resource_policy_principal end |
#resource_self_arns ⇒ Array<String>? (readonly)
Default: Same as regular resource ARNs
When referring to the resource in a resource policy, use this as ARN.
(Depending on the resource type, this needs to be '*' in a resource policy).
66 67 68 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 66 def resource_self_arns @resource_self_arns end |
Class Method Details
.jsii_properties ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 68 def self.jsii_properties { :actions => "actions", :grantee => "grantee", :resource_arns => "resourceArns", :conditions => "conditions", :resource => "resource", :resource_policy_principal => "resourcePolicyPrincipal", :resource_self_arns => "resourceSelfArns", } end |
Instance Method Details
#to_jsii ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'iam/grant_on_principal_and_resource_options.rb', line 80 def to_jsii result = {} result.merge!(super) result.merge!({ "actions" => @actions, "grantee" => @grantee, "resourceArns" => @resource_arns, "conditions" => @conditions, "resource" => @resource, "resourcePolicyPrincipal" => @resource_policy_principal, "resourceSelfArns" => @resource_self_arns, }) result.compact end |