@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.737Z") @Stability(value=Stable) public interface CfnPolicyProps extends software.amazon.jsii.JsiiSerializable
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iam.*;
Object policyDocument;
CfnPolicyProps cfnPolicyProps = CfnPolicyProps.builder()
.policyDocument(policyDocument)
.policyName("policyName")
// the properties below are optional
.groups(List.of("groups"))
.roles(List.of("roles"))
.users(List.of("users"))
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
CfnPolicyProps.Builder
A builder for
CfnPolicyProps |
static class |
CfnPolicyProps.Jsii$Proxy
An implementation for
CfnPolicyProps |
| Modifier and Type | Method and Description |
|---|---|
static CfnPolicyProps.Builder |
builder() |
default List<String> |
getGroups()
The name of the group to associate the policy with.
|
Object |
getPolicyDocument()
The policy document.
|
String |
getPolicyName()
The name of the policy document.
|
default List<String> |
getRoles()
The name of the role to associate the policy with.
|
default List<String> |
getUsers()
The name of the user to associate the policy with.
|
@Stability(value=Stable) @NotNull Object getPolicyDocument()
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:
\ u0020 ) through the end of the ASCII character range\ u00FF )\ u0009 ), line feed ( \ u000A ), and carriage return ( \ u000D )@Stability(value=Stable) @NotNull String getPolicyName()
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: _+=,.@-
@Stability(value=Stable) @Nullable default List<String> getGroups()
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: _+=,.@-.
@Stability(value=Stable) @Nullable default List<String> getRoles()
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::PolicyorAWS::IAM::ManagedPolicy) has aRefto a role and if a resource (such asAWS::ECS::Service) also has aRefto the same role, add aDependsOnattribute 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::Serviceresource, theDependsOnattribute ensures that AWS CloudFormation deletes theAWS::ECS::Serviceresource before deleting its role's policy.
@Stability(value=Stable) @Nullable default List<String> getUsers()
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: _+=,.@-
@Stability(value=Stable) static CfnPolicyProps.Builder builder()
CfnPolicyProps.Builder of CfnPolicyPropsCopyright © 2022. All rights reserved.