Class CfnContainer
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::MediaStore::Container.
The AWS::MediaStore::Container resource specifies a storage container to hold objects. A container is similar to a bucket in Amazon S3.
When you create a container using AWS CloudFormation , the template manages data for five API actions: creating a container, setting access logging, updating the default container policy, adding a cross-origin resource sharing (CORS) policy, and adding an object lifecycle policy.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.mediastore.*;
CfnContainer cfnContainer = CfnContainer.Builder.create(this, "MyCfnContainer")
.containerName("containerName")
// the properties below are optional
.accessLoggingEnabled(false)
.corsPolicy(List.of(CorsRuleProperty.builder()
.allowedHeaders(List.of("allowedHeaders"))
.allowedMethods(List.of("allowedMethods"))
.allowedOrigins(List.of("allowedOrigins"))
.exposeHeaders(List.of("exposeHeaders"))
.maxAgeSeconds(123)
.build()))
.lifecyclePolicy("lifecyclePolicy")
.metricPolicy(MetricPolicyProperty.builder()
.containerLevelMetrics("containerLevelMetrics")
// the properties below are optional
.metricPolicyRules(List.of(MetricPolicyRuleProperty.builder()
.objectGroup("objectGroup")
.objectGroupName("objectGroupName")
.build()))
.build())
.policy("policy")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnContainer.static interfaceA rule for a CORS policy.static interfaceThe metric policy that is associated with the container.static interfaceA setting that enables metrics at the object level.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnContainer(Construct scope, String id, CfnContainerProps props) Create a newAWS::MediaStore::Container.protectedCfnContainer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnContainer(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe state of access logging on the container.The DNS endpoint of the container.The name for the container.Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.Writes an object lifecycle policy to a container.AWS::MediaStore::Container.MetricPolicy.Creates an access policy for the specified container to restrict the users and clients that can access it.getTags()AWS::MediaStore::Container.Tags.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAccessLoggingEnabled(Boolean value) The state of access logging on the container.voidThe state of access logging on the container.voidsetContainerName(String value) The name for the container.voidsetCorsPolicy(List<Object> value) Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.voidsetCorsPolicy(IResolvable value) Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.voidsetLifecyclePolicy(String value) Writes an object lifecycle policy to a container.voidsetMetricPolicy(IResolvable value) AWS::MediaStore::Container.MetricPolicy.voidAWS::MediaStore::Container.MetricPolicy.voidCreates an access policy for the specified container to restrict the users and clients that can access it.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnContainer
protected CfnContainer(software.amazon.jsii.JsiiObjectRef objRef) -
CfnContainer
protected CfnContainer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnContainer
@Stability(Stable) public CfnContainer(@NotNull Construct scope, @NotNull String id, @NotNull CfnContainerProps props) Create a newAWS::MediaStore::Container.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrEndpoint
The DNS endpoint of the container.Use the endpoint to identify the specific container when sending requests to the data plane. The service assigns this value when the container is created. Once the value has been assigned, it does not change.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
AWS::MediaStore::Container.Tags. -
getContainerName
The name for the container.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
moviesin every region, as long as you don’t have an existing container with that name. -
setContainerName
The name for the container.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
moviesin every region, as long as you don’t have an existing container with that name. -
getAccessLoggingEnabled
The state of access logging on the container.This value is
falseby 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 totrue, indicating that the service delivers access logs for objects stored in that container to CloudWatch Logs. -
setAccessLoggingEnabled
The state of access logging on the container.This value is
falseby 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 totrue, indicating that the service delivers access logs for objects stored in that container to CloudWatch Logs. -
setAccessLoggingEnabled
The state of access logging on the container.This value is
falseby 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 totrue, indicating that the service delivers access logs for objects stored in that container to CloudWatch Logs. -
getCorsPolicy
Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.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 .
-
setCorsPolicy
Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.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 .
-
setCorsPolicy
Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.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 .
-
getLifecyclePolicy
Writes an object lifecycle policy to a container.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 .
-
setLifecyclePolicy
Writes an object lifecycle policy to a container.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 .
-
getMetricPolicy
AWS::MediaStore::Container.MetricPolicy. -
setMetricPolicy
AWS::MediaStore::Container.MetricPolicy. -
setMetricPolicy
AWS::MediaStore::Container.MetricPolicy. -
getPolicy
Creates an access policy for the specified container to restrict the users and clients that can access it.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
PutContainerPolicytwice, the second command modifies the existing policy. -
setPolicy
Creates an access policy for the specified container to restrict the users and clients that can access it.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
PutContainerPolicytwice, the second command modifies the existing policy.
-