Class: AWSCDK::IAM::RoleLookupOptions
- Inherits:
-
FromRoleARNOptions
- Object
- FromRoleARNOptions
- AWSCDK::IAM::RoleLookupOptions
- Defined in:
- iam/role_lookup_options.rb
Overview
Properties for looking up an existing Role.
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.
-
#role_name ⇒ String
readonly
The name of the role to lookup.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(add_grants_to_resources: nil, default_policy_name: nil, mutable: nil, role_name:) ⇒ RoleLookupOptions
constructor
A new instance of RoleLookupOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(add_grants_to_resources: nil, default_policy_name: nil, mutable: nil, role_name:) ⇒ RoleLookupOptions
Returns a new instance of RoleLookupOptions.
11 12 13 14 15 16 17 18 19 20 |
# File 'iam/role_lookup_options.rb', line 11 def initialize(add_grants_to_resources: nil, default_policy_name: nil, mutable: nil, role_name:) @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? @role_name = role_name Jsii::Type.check_type(@role_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "roleName") 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.
31 32 33 |
# File 'iam/role_lookup_options.rb', line 31 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.
42 43 44 |
# File 'iam/role_lookup_options.rb', line 42 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.
47 48 49 |
# File 'iam/role_lookup_options.rb', line 47 def mutable @mutable end |
#role_name ⇒ String (readonly)
The name of the role to lookup.
If the role you want to lookup is a service role, you need to specify the role name without the 'service-role' prefix. For example, if the role arn is 'arn:aws:iam::123456789012:role/service-role/ExampleServiceExecutionRole', you need to specify the role name as 'ExampleServiceExecutionRole'.
56 57 58 |
# File 'iam/role_lookup_options.rb', line 56 def role_name @role_name end |
Class Method Details
.jsii_properties ⇒ Object
58 59 60 61 62 63 64 65 |
# File 'iam/role_lookup_options.rb', line 58 def self.jsii_properties { :add_grants_to_resources => "addGrantsToResources", :default_policy_name => "defaultPolicyName", :mutable => "mutable", :role_name => "roleName", } end |
Instance Method Details
#to_jsii ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 |
# File 'iam/role_lookup_options.rb', line 67 def to_jsii result = {} result.merge!(super) result.merge!({ "addGrantsToResources" => @add_grants_to_resources, "defaultPolicyName" => @default_policy_name, "mutable" => @mutable, "roleName" => @role_name, }) result.compact end |