aws-cdk-lib.aws_s3.CfnBucketPolicyProps

interface CfnBucketPolicyProps

LanguageType name
.NETAmazon.CDK.AWS.S3.CfnBucketPolicyProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awss3#CfnBucketPolicyProps
Javasoftware.amazon.awscdk.services.s3.CfnBucketPolicyProps
Pythonaws_cdk.aws_s3.CfnBucketPolicyProps
TypeScript aws-cdk-lib » aws_s3 » CfnBucketPolicyProps

Properties for defining a CfnBucketPolicy.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';

declare const policyDocument: any;
const cfnBucketPolicyProps: s3.CfnBucketPolicyProps = {
  bucket: 'bucket',
  policyDocument: policyDocument,
};

Properties

NameTypeDescription
bucketstringThe name of the Amazon S3 bucket to which the policy applies.
policyDocumentanyA policy document containing permissions to add to the specified bucket.

bucket

Type: string

The name of the Amazon S3 bucket to which the policy applies.


policyDocument

Type: any

A policy document containing permissions to add to the specified bucket.

In IAM, you must provide policy documents in JSON format. However, in CloudFormation you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to IAM. For more information, see the AWS::IAM::Policy PolicyDocument resource description in this guide and Access Policy Language Overview in the Amazon S3 User Guide .