Class ManagedPolicy.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ManagedPolicy>
- Enclosing class:
- ManagedPolicy
ManagedPolicy
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
static ManagedPolicy.Builder
description
(String description) A description of the managed policy.document
(PolicyDocument document) Initial PolicyDocument to use for this ManagedPolicy.Groups to attach this policy to.managedPolicyName
(String managedPolicyName) The name of the managed policy.The path for the policy.Roles to attach this policy to.statements
(List<? extends PolicyStatement> statements) Initial set of permissions to add to this policy document.Users to attach this policy to.
-
Method Details
-
create
@Stability(Stable) public static ManagedPolicy.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
ManagedPolicy.Builder
.
-
description
A description of the managed policy.Typically used to store information about the permissions defined in the policy. For example, "Grants access to production DynamoDB tables." The policy description is immutable. After a value is assigned, it cannot be changed.
Default: - empty
- Parameters:
description
- A description of the managed policy. This parameter is required.- Returns:
this
-
document
Initial PolicyDocument to use for this ManagedPolicy.If omited, any
PolicyStatement
provided in thestatements
property will be applied against the empty defaultPolicyDocument
.Default: - An empty policy.
- Parameters:
document
- Initial PolicyDocument to use for this ManagedPolicy. This parameter is required.- Returns:
this
-
groups
Groups to attach this policy to.You can also use
attachToGroup(group)
to attach this policy to a group.Default: - No groups.
- Parameters:
groups
- Groups to attach this policy to. This parameter is required.- Returns:
this
-
managedPolicyName
The name of the managed policy.If you specify multiple policies for an entity, specify unique names. For example, if you specify a list of policies for an IAM role, each policy must have a unique name.
Default: - A name is automatically generated.
- Parameters:
managedPolicyName
- The name of the managed policy. This parameter is required.- Returns:
this
-
path
The path for the policy.This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (!) through the DEL character (), including most punctuation characters, digits, and upper and lowercased letters.
For more information about paths, see IAM Identifiers in the IAM User Guide.
Default: - "/"
- Parameters:
path
- The path for the policy. This parameter is required.- Returns:
this
-
roles
Roles to attach this policy to.You can also use
attachToRole(role)
to attach this policy to a role.Default: - No roles.
- Parameters:
roles
- Roles to attach this policy to. This parameter is required.- Returns:
this
-
statements
@Stability(Stable) public ManagedPolicy.Builder statements(List<? extends PolicyStatement> statements) Initial set of permissions to add to this policy document.You can also use
addPermission(statement)
to add permissions later.Default: - No statements.
- Parameters:
statements
- Initial set of permissions to add to this policy document. This parameter is required.- Returns:
this
-
users
Users to attach this policy to.You can also use
attachToUser(user)
to attach this policy to a user.Default: - No users.
- Parameters:
users
- Users to attach this policy to. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ManagedPolicy>
- Returns:
- a newly built instance of
ManagedPolicy
.
-