Interface PolicyStatementProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
PolicyStatementProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:29:57.362Z")
@Stability(Stable)
public interface PolicyStatementProps
extends software.amazon.jsii.JsiiSerializable
Interface for creating a policy statement.
Example:
// Add gateway endpoints when creating the VPC
Vpc vpc = Vpc.Builder.create(this, "MyVpc")
.gatewayEndpoints(Map.of(
"S3", GatewayVpcEndpointOptions.builder()
.service(GatewayVpcEndpointAwsService.S3)
.build()))
.build();
// Alternatively gateway endpoints can be added on the VPC
GatewayVpcEndpoint dynamoDbEndpoint = vpc.addGatewayEndpoint("DynamoDbEndpoint", GatewayVpcEndpointOptions.builder()
.service(GatewayVpcEndpointAwsService.DYNAMODB)
.build());
// This allows to customize the endpoint policy
dynamoDbEndpoint.addToPolicy(
PolicyStatement.Builder.create() // Restrict to listing and describing tables
.principals(List.of(new AnyPrincipal()))
.actions(List.of("dynamodb:DescribeTable", "dynamodb:ListTables"))
.resources(List.of("*")).build());
// Add an interface endpoint
vpc.addInterfaceEndpoint("EcrDockerEndpoint", InterfaceVpcEndpointOptions.builder()
.service(InterfaceVpcEndpointAwsService.ECR_DOCKER)
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forPolicyStatementPropsstatic final classAn implementation forPolicyStatementProps -
Method Summary
Modifier and TypeMethodDescriptionstatic PolicyStatementProps.Builderbuilder()List of actions to add to the statement.Conditions to add to the statement.default EffectWhether to allow or deny the actions in this statement.List of not actions to add to the statement.default List<IPrincipal>List of not principals to add to the statement.NotResource ARNs to add to the statement.default List<IPrincipal>List of principals to add to the statement.Resource ARNs to add to the statement.default StringgetSid()The Sid (statement ID) is an optional identifier that you provide for the policy statement.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getActions
List of actions to add to the statement.Default: - no actions
-
getConditions
Conditions to add to the statement.Default: - no condition
-
getEffect
Whether to allow or deny the actions in this statement.Default: Effect.ALLOW
-
getNotActions
List of not actions to add to the statement.Default: - no not-actions
-
getNotPrincipals
List of not principals to add to the statement.Default: - no not principals
-
getNotResources
NotResource ARNs to add to the statement.Default: - no not-resources
-
getPrincipals
List of principals to add to the statement.Default: - no principals
-
getResources
Resource ARNs to add to the statement.Default: - no resources
-
getSid
The Sid (statement ID) is an optional identifier that you provide for the policy statement.You can assign a Sid value to each statement in a statement array. In services that let you specify an ID element, such as SQS and SNS, the Sid value is just a sub-ID of the policy document's ID. In IAM, the Sid value must be unique within a JSON policy.
Default: - no sid
-
builder
- Returns:
- a
PolicyStatementProps.BuilderofPolicyStatementProps
-