Class FromRoleNameOptions
Options allowing customizing the behavior of Role.fromRoleName.
Inherited Members
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class FromRoleNameOptions : IFromRoleNameOptions, IFromRoleArnOptions
Syntax (vb)
Public Class FromRoleNameOptions Implements IFromRoleNameOptions, IFromRoleArnOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
var fromRoleNameOptions = new FromRoleNameOptions {
AddGrantsToResources = false,
DefaultPolicyName = "defaultPolicyName",
Mutable = false
};
Synopsis
Constructors
| FromRoleNameOptions() | Options allowing customizing the behavior of |
Properties
| AddGrantsToResources | For immutable roles: add grants to resources instead of dropping them. |
| DefaultPolicyName | Any policies created by this role will use this value as their ID, if specified. |
| Mutable | Whether the imported role can be modified by attaching policy resources to it. |
Constructors
FromRoleNameOptions()
Options allowing customizing the behavior of Role.fromRoleName.
public FromRoleNameOptions()
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
var fromRoleNameOptions = new FromRoleNameOptions {
AddGrantsToResources = false,
DefaultPolicyName = "defaultPolicyName",
Mutable = false
};
Properties
AddGrantsToResources
For immutable roles: add grants to resources instead of dropping them.
public bool? AddGrantsToResources { get; set; }
Property Value
bool?
Remarks
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.
Default: false
DefaultPolicyName
Any policies created by this role will use this value as their ID, if specified.
public string? DefaultPolicyName { get; set; }
Property Value
Remarks
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.
Default: 'Policy'
Mutable
Whether the imported role can be modified by attaching policy resources to it.
public bool? Mutable { get; set; }
Property Value
bool?
Remarks
Default: true