aws-cdk-lib.aws_s3.CfnBucket.CorsConfigurationProperty

interface CorsConfigurationProperty

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

Describes the cross-origin access configuration for objects in an Amazon S3 bucket.

For more information, see Enabling Cross-Origin Resource Sharing in the Amazon S3 User Guide .

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';
const corsConfigurationProperty: s3.CfnBucket.CorsConfigurationProperty = {
  corsRules: [{
    allowedMethods: ['allowedMethods'],
    allowedOrigins: ['allowedOrigins'],

    // the properties below are optional
    allowedHeaders: ['allowedHeaders'],
    exposedHeaders: ['exposedHeaders'],
    id: 'id',
    maxAge: 123,
  }],
};

Properties

NameTypeDescription
corsRulesIResolvable | IResolvable | CorsRuleProperty[]A set of origins and methods (cross-origin access that you want to allow).

corsRules

Type: IResolvable | IResolvable | CorsRuleProperty[]

A set of origins and methods (cross-origin access that you want to allow).

You can add up to 100 rules to the configuration.