interface CorsRuleProperty
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.S3.Mixins.CfnBucketPropsMixin.CorsRuleProperty |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awss3/mixins#CfnBucketPropsMixin_CorsRuleProperty |
Java | software.amazon.awscdk.mixins.preview.services.s3.mixins.CfnBucketPropsMixin.CorsRuleProperty |
Python | aws_cdk.mixins_preview.aws_s3.mixins.CfnBucketPropsMixin.CorsRuleProperty |
TypeScript | @aws-cdk/mixins-preview » aws_s3 » mixins » CfnBucketPropsMixin » CorsRuleProperty |
Specifies a cross-origin access rule for an Amazon S3 bucket.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-corsrule.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins as s3_mixins } from '@aws-cdk/mixins-preview/aws-s3';
const corsRuleProperty: s3_mixins.CfnBucketPropsMixin.CorsRuleProperty = {
allowedHeaders: ['allowedHeaders'],
allowedMethods: ['allowedMethods'],
allowedOrigins: ['allowedOrigins'],
exposedHeaders: ['exposedHeaders'],
id: 'id',
maxAge: 123,
};
Properties
| Name | Type | Description |
|---|---|---|
| allowed | string[] | Headers that are specified in the Access-Control-Request-Headers header. |
| allowed | string[] | An HTTP method that you allow the origin to run. |
| allowed | string[] | One or more origins you want customers to be able to access the bucket from. |
| exposed | string[] | One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object). |
| id? | string | A unique identifier for this rule. |
| max | number | The time in seconds that your browser is to cache the preflight response for the specified resource. |
allowedHeaders?
Type:
string[]
(optional)
Headers that are specified in the Access-Control-Request-Headers header.
These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.
allowedMethods?
Type:
string[]
(optional)
An HTTP method that you allow the origin to run.
Allowed values : GET | PUT | HEAD | POST | DELETE
allowedOrigins?
Type:
string[]
(optional)
One or more origins you want customers to be able to access the bucket from.
exposedHeaders?
Type:
string[]
(optional)
One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).
id?
Type:
string
(optional)
A unique identifier for this rule.
The value must be no more than 255 characters.
maxAge?
Type:
number
(optional)
The time in seconds that your browser is to cache the preflight response for the specified resource.

.NET
Go
Java
Python
TypeScript