Interface CfnBucket.ICorsRuleProperty
Specifies a cross-origin access rule for an Amazon S3 bucket.
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ICorsRuleProperty
Syntax (vb)
Public Interface ICorsRuleProperty
Remarks
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-corsrule.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.S3;
var corsRuleProperty = new CorsRuleProperty {
AllowedMethods = new [] { "allowedMethods" },
AllowedOrigins = new [] { "allowedOrigins" },
// the properties below are optional
AllowedHeaders = new [] { "allowedHeaders" },
ExposedHeaders = new [] { "exposedHeaders" },
Id = "id",
MaxAge = 123
};
Synopsis
Properties
AllowedHeaders | Headers that are specified in the |
AllowedMethods | An HTTP method that you allow the origin to run. |
AllowedOrigins | One or more origins you want customers to be able to access the bucket from. |
ExposedHeaders | One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript |
Id | A unique identifier for this rule. |
MaxAge | The time in seconds that your browser is to cache the preflight response for the specified resource. |
Properties
AllowedHeaders
Headers that are specified in the Access-Control-Request-Headers
header.
virtual string[] AllowedHeaders { get; }
Property Value
System.String[]
Remarks
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
An HTTP method that you allow the origin to run.
string[] AllowedMethods { get; }
Property Value
System.String[]
Remarks
Allowed values : GET
| PUT
| HEAD
| POST
| DELETE
AllowedOrigins
One or more origins you want customers to be able to access the bucket from.
string[] AllowedOrigins { get; }
Property Value
System.String[]
Remarks
ExposedHeaders
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).
virtual string[] ExposedHeaders { get; }
Property Value
System.String[]
Remarks
Id
A unique identifier for this rule.
virtual string Id { get; }
Property Value
System.String
Remarks
The value must be no more than 255 characters.
MaxAge
The time in seconds that your browser is to cache the preflight response for the specified resource.
virtual Nullable<double> MaxAge { get; }
Property Value
System.Nullable<System.Double>