| Modifier and Type | Method and Description |
|---|---|
Policy |
build() |
static Policy.Builder |
create(software.constructs.Construct scope,
String id) |
Policy.Builder |
document(PolicyDocument document)
Initial PolicyDocument to use for this Policy.
|
Policy.Builder |
force(Boolean force)
Force creation of an `AWS::IAM::Policy`.
|
Policy.Builder |
groups(List<? extends IGroup> groups)
Groups to attach this policy to.
|
Policy.Builder |
policyName(String policyName)
The name of the policy.
|
Policy.Builder |
roles(List<? extends IRole> roles)
Roles to attach this policy to.
|
Policy.Builder |
statements(List<? extends PolicyStatement> statements)
Initial set of permissions to add to this policy document.
|
Policy.Builder |
users(List<? extends IUser> users)
Users to attach this policy to.
|
@Stability(value=Stable) public static Policy.Builder create(software.constructs.Construct scope, String id)
scope - This parameter is required.id - This parameter is required.Policy.Builder.@Stability(value=Stable) public Policy.Builder document(PolicyDocument document)
If omited, any
PolicyStatement provided in the statements property will be applied
against the empty default PolicyDocument.
Default: - An empty policy.
document - Initial PolicyDocument to use for this Policy. This parameter is required.this@Stability(value=Stable) public Policy.Builder force(Boolean force)
Unless set to true, this Policy construct will not materialize to an
AWS::IAM::Policy CloudFormation resource in case it would have no effect
(for example, if it remains unattached to an IAM identity or if it has no
statements). This is generally desired behavior, since it prevents
creating invalid--and hence undeployable--CloudFormation templates.
In cases where you know the policy must be created and it is actually
an error if no statements have been added to it, you can set this to true.
Default: false
force - Force creation of an `AWS::IAM::Policy`. This parameter is required.this@Stability(value=Stable) public Policy.Builder groups(List<? extends IGroup> groups)
You can also use attachToGroup(group) to attach this policy to a group.
Default: - No groups.
groups - Groups to attach this policy to. This parameter is required.this@Stability(value=Stable) public Policy.Builder policyName(String policyName)
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: - Uses the logical ID of the policy resource, which is ensured to be unique within the stack.
policyName - The name of the policy. This parameter is required.this@Stability(value=Stable) public Policy.Builder roles(List<? extends IRole> roles)
You can also use attachToRole(role) to attach this policy to a role.
Default: - No roles.
roles - Roles to attach this policy to. This parameter is required.this@Stability(value=Stable) public Policy.Builder statements(List<? extends PolicyStatement> statements)
You can also use addStatements(...statement) to add permissions later.
Default: - No statements.
statements - Initial set of permissions to add to this policy document. This parameter is required.this@Stability(value=Stable) public Policy.Builder users(List<? extends IUser> users)
You can also use attachToUser(user) to attach this policy to a user.
Default: - No users.
users - Users to attach this policy to. This parameter is required.thisCopyright © 2022. All rights reserved.