Class CfnPolicyProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnPolicyProps>
- Enclosing interface:
CfnPolicyProps
CfnPolicyProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofCfnPolicyProps.getGroups()
policyDocument
(Object policyDocument) Sets the value ofCfnPolicyProps.getPolicyDocument()
policyName
(String policyName) Sets the value ofCfnPolicyProps.getPolicyName()
Sets the value ofCfnPolicyProps.getRoles()
Sets the value ofCfnPolicyProps.getUsers()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
policyDocument
Sets the value ofCfnPolicyProps.getPolicyDocument()
- Parameters:
policyDocument
- The policy document. This parameter is required. You must provide policies in JSON format in IAM. However, for AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.The regex pattern used to validate this parameter is a string of characters consisting of the following:
- Any printable ASCII character ranging from the space character (
- The printable characters in the Basic Latin and Latin-1 Supplement character set (through
ΓΏ
) - The special characters tab (
- Any printable ASCII character ranging from the space character (
- Returns:
this
-
policyName
Sets the value ofCfnPolicyProps.getPolicyName()
- Parameters:
policyName
- The name of the policy document. This parameter is required. This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-- Returns:
this
-
groups
Sets the value ofCfnPolicyProps.getGroups()
- Parameters:
groups
- The name of the group to associate the policy with. This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-.- Returns:
this
-
roles
Sets the value ofCfnPolicyProps.getRoles()
- Parameters:
roles
- The name of the role to associate the policy with. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-If an external policy (such as
AWS::IAM::Policy
orAWS::IAM::ManagedPolicy
) has aRef
to a role and if a resource (such asAWS::ECS::Service
) also has aRef
to the same role, add aDependsOn
attribute to the resource to make the resource depend on the external policy. This dependency ensures that the role's policy is available throughout the resource's lifecycle. For example, when you delete a stack with anAWS::ECS::Service
resource, theDependsOn
attribute ensures that AWS CloudFormation deletes theAWS::ECS::Service
resource before deleting its role's policy.- Returns:
this
-
users
Sets the value ofCfnPolicyProps.getUsers()
- Parameters:
users
- The name of the user to associate the policy with. This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnPolicyProps>
- Returns:
- a new instance of
CfnPolicyProps
- Throws:
NullPointerException
- if any required attribute was not provided
-