Class ManagedPolicyProps.Builder
java.lang.Object
software.amazon.awscdk.services.iam.ManagedPolicyProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ManagedPolicyProps>
- Enclosing interface:
ManagedPolicyProps
@Stability(Stable)
public static final class ManagedPolicyProps.Builder
extends Object
implements software.amazon.jsii.Builder<ManagedPolicyProps>
A builder for
ManagedPolicyProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.description
(String description) Sets the value ofManagedPolicyProps.getDescription()
document
(PolicyDocument document) Sets the value ofManagedPolicyProps.getDocument()
Sets the value ofManagedPolicyProps.getGroups()
managedPolicyName
(String managedPolicyName) Sets the value ofManagedPolicyProps.getManagedPolicyName()
Sets the value ofManagedPolicyProps.getPath()
Sets the value ofManagedPolicyProps.getRoles()
statements
(List<? extends PolicyStatement> statements) Sets the value ofManagedPolicyProps.getStatements()
Sets the value ofManagedPolicyProps.getUsers()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
description
Sets the value ofManagedPolicyProps.getDescription()
- Parameters:
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.- Returns:
this
-
document
Sets the value ofManagedPolicyProps.getDocument()
- Parameters:
document
- Initial PolicyDocument to use for this ManagedPolicy. If omited, anyPolicyStatement
provided in thestatements
property will be applied against the empty defaultPolicyDocument
.- Returns:
this
-
groups
Sets the value ofManagedPolicyProps.getGroups()
- Parameters:
groups
- Groups to attach this policy to. You can also useattachToGroup(group)
to attach this policy to a group.- Returns:
this
-
managedPolicyName
Sets the value ofManagedPolicyProps.getManagedPolicyName()
- Parameters:
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.- Returns:
this
-
path
Sets the value ofManagedPolicyProps.getPath()
- Parameters:
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.
- Returns:
this
-
roles
Sets the value ofManagedPolicyProps.getRoles()
- Parameters:
roles
- Roles to attach this policy to. You can also useattachToRole(role)
to attach this policy to a role.- Returns:
this
-
statements
@Stability(Stable) public ManagedPolicyProps.Builder statements(List<? extends PolicyStatement> statements) Sets the value ofManagedPolicyProps.getStatements()
- Parameters:
statements
- Initial set of permissions to add to this policy document. You can also useaddPermission(statement)
to add permissions later.- Returns:
this
-
users
Sets the value ofManagedPolicyProps.getUsers()
- Parameters:
users
- Users to attach this policy to. You can also useattachToUser(user)
to attach this policy to a user.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ManagedPolicyProps>
- Returns:
- a new instance of
ManagedPolicyProps
- Throws:
NullPointerException
- if any required attribute was not provided
-