Class: AWSCDK::IAM::FromRoleARNOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::IAM::FromRoleARNOptions
- Defined in:
- iam/from_role_arn_options.rb
Overview
Options allowing customizing the behavior of Role.fromRoleArn.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#add_grants_to_resources ⇒ Boolean?
readonly
For immutable roles: add grants to resources instead of dropping them.
-
#default_policy_name ⇒ String?
readonly
Any policies created by this role will use this value as their ID, if specified.
-
#mutable ⇒ Boolean?
readonly
Whether the imported role can be modified by attaching policy resources to it.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(add_grants_to_resources: nil, default_policy_name: nil, mutable: nil) ⇒ FromRoleARNOptions
constructor
A new instance of FromRoleARNOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(add_grants_to_resources: nil, default_policy_name: nil, mutable: nil) ⇒ FromRoleARNOptions
Returns a new instance of FromRoleARNOptions.
10 11 12 13 14 15 16 17 |
# File 'iam/from_role_arn_options.rb', line 10 def initialize(add_grants_to_resources: nil, default_policy_name: nil, mutable: nil) @add_grants_to_resources = add_grants_to_resources Jsii::Type.check_type(@add_grants_to_resources, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "addGrantsToResources") unless @add_grants_to_resources.nil? @default_policy_name = default_policy_name Jsii::Type.check_type(@default_policy_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultPolicyName") unless @default_policy_name.nil? @mutable = mutable Jsii::Type.check_type(@mutable, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "mutable") unless @mutable.nil? end |
Instance Attribute Details
#add_grants_to_resources ⇒ Boolean? (readonly)
Default: false
For immutable roles: add grants to resources instead of dropping them.
If this is false or not specified, grant permissions added to this role are ignored.
It is your own responsibility to make sure the role has the required permissions.
If this is true, any grant permissions will be added to the resource instead.
28 29 30 |
# File 'iam/from_role_arn_options.rb', line 28 def add_grants_to_resources @add_grants_to_resources end |
#default_policy_name ⇒ String? (readonly)
Default: 'Policy'
Any policies created by this role will use this value as their ID, if specified.
Specify this if importing the same role in multiple stacks, and granting it different permissions in at least two stacks. If this is not specified (or if the same name is specified in more than one stack), a CloudFormation issue will result in the policy created in whichever stack is deployed last overwriting the policies created by the others.
39 40 41 |
# File 'iam/from_role_arn_options.rb', line 39 def default_policy_name @default_policy_name end |
#mutable ⇒ Boolean? (readonly)
Default: true
Whether the imported role can be modified by attaching policy resources to it.
44 45 46 |
# File 'iam/from_role_arn_options.rb', line 44 def mutable @mutable end |
Class Method Details
.jsii_properties ⇒ Object
46 47 48 49 50 51 52 |
# File 'iam/from_role_arn_options.rb', line 46 def self.jsii_properties { :add_grants_to_resources => "addGrantsToResources", :default_policy_name => "defaultPolicyName", :mutable => "mutable", } end |
Instance Method Details
#to_jsii ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'iam/from_role_arn_options.rb', line 54 def to_jsii result = {} result.merge!({ "addGrantsToResources" => @add_grants_to_resources, "defaultPolicyName" => @default_policy_name, "mutable" => @mutable, }) result.compact end |