Class CfnContainerProps
Properties for defining a CfnContainer
.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.MediaStore
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnContainerProps : Object, ICfnContainerProps
Syntax (vb)
Public Class CfnContainerProps
Inherits Object
Implements ICfnContainerProps
Remarks
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.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.MediaStore;
var cfnContainerProps = new CfnContainerProps {
ContainerName = "containerName",
// the properties below are optional
AccessLoggingEnabled = false,
CorsPolicy = new [] { new CorsRuleProperty {
AllowedHeaders = new [] { "allowedHeaders" },
AllowedMethods = new [] { "allowedMethods" },
AllowedOrigins = new [] { "allowedOrigins" },
ExposeHeaders = new [] { "exposeHeaders" },
MaxAgeSeconds = 123
} },
LifecyclePolicy = "lifecyclePolicy",
MetricPolicy = new MetricPolicyProperty {
ContainerLevelMetrics = "containerLevelMetrics",
// the properties below are optional
MetricPolicyRules = new [] { new MetricPolicyRuleProperty {
ObjectGroup = "objectGroup",
ObjectGroupName = "objectGroupName"
} }
},
Policy = "policy",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
Synopsis
Constructors
CfnContainerProps() |
Properties
AccessLoggingEnabled | The state of access logging on the container. |
ContainerName | The name for the container. |
CorsPolicy | Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests. |
LifecyclePolicy | Writes an object lifecycle policy to a container. |
MetricPolicy | The metric policy that is associated with the container. |
Policy | Creates an access policy for the specified container to restrict the users and clients that can access it. |
Tags |
Constructors
CfnContainerProps()
public CfnContainerProps()
Properties
AccessLoggingEnabled
The state of access logging on the container.
public object AccessLoggingEnabled { get; set; }
Property Value
System.Object
Remarks
This value is false
by default, indicating that AWS Elemental MediaStore does not send access logs to Amazon CloudWatch Logs. When you enable access logging on the container, MediaStore changes this value to true
, indicating that the service delivers access logs for objects stored in that container to CloudWatch Logs.
ContainerName
The name for the container.
public string ContainerName { get; set; }
Property Value
System.String
Remarks
The name must be from 1 to 255 characters. Container names must be unique to your AWS account within a specific region. As an example, you could create a container named movies
in every region, as long as you don’t have an existing container with that name.
CorsPolicy
Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.
public object CorsPolicy { get; set; }
Property Value
System.Object
Remarks
For example, you might want to enable a request whose origin is http://www.example.com to access your AWS Elemental MediaStore container at my.example.container.com by using the browser's XMLHttpRequest capability.
To enable CORS on a container, you attach a CORS policy to the container. In the CORS policy, you configure rules that identify origins and the HTTP methods that can be executed on your container. The policy can contain up to 398,000 characters. You can add up to 100 rules to a CORS policy. If more than one rule applies, the service uses the first applicable rule listed.
To learn more about CORS, see Cross-Origin Resource Sharing (CORS) in AWS Elemental MediaStore .
LifecyclePolicy
Writes an object lifecycle policy to a container.
public string LifecyclePolicy { get; set; }
Property Value
System.String
Remarks
If the container already has an object lifecycle policy, the service replaces the existing policy with the new policy. It takes up to 20 minutes for the change to take effect.
For information about how to construct an object lifecycle policy, see Components of an Object Lifecycle Policy .
MetricPolicy
The metric policy that is associated with the container.
public object MetricPolicy { get; set; }
Property Value
System.Object
Remarks
A metric policy allows AWS Elemental MediaStore to send metrics to Amazon CloudWatch. In the policy, you must indicate whether you want MediaStore to send container-level metrics. You can also include rules to define groups of objects that you want MediaStore to send object-level metrics for.
To view examples of how to construct a metric policy for your use case, see Example Metric Policies .
Policy
Creates an access policy for the specified container to restrict the users and clients that can access it.
public string Policy { get; set; }
Property Value
System.String
Remarks
For information about the data that is included in an access policy, see the AWS Identity and Access Management User Guide .
For this release of the REST API, you can create only one policy for a container. If you enter PutContainerPolicy
twice, the second command modifies the existing policy.