@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.950Z") @Stability(value=Stable) public class CfnContainer extends CfnResource implements IInspectable
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnContainer.Builder
A fluent builder for
CfnContainer. |
static interface |
CfnContainer.CorsRuleProperty
A rule for a CORS policy.
|
static interface |
CfnContainer.MetricPolicyProperty
The metric policy that is associated with the container.
|
static interface |
CfnContainer.MetricPolicyRuleProperty
A setting that enables metrics at the object level.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnContainer(software.constructs.Construct scope,
String id,
CfnContainerProps props)
Create a new `AWS::MediaStore::Container`.
|
protected |
CfnContainer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnContainer(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAccessLoggingEnabled()
The state of access logging on the container.
|
String |
getAttrEndpoint()
The DNS endpoint of the container.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getContainerName()
The name for the container.
|
Object |
getCorsPolicy()
Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.
|
String |
getLifecyclePolicy()
Writes an object lifecycle policy to a container.
|
Object |
getMetricPolicy()
`AWS::MediaStore::Container.MetricPolicy`.
|
String |
getPolicy()
Creates an access policy for the specified container to restrict the users and clients that can access it.
|
TagManager |
getTags()
`AWS::MediaStore::Container.Tags`.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAccessLoggingEnabled(Boolean value)
The state of access logging on the container.
|
void |
setAccessLoggingEnabled(IResolvable value)
The state of access logging on the container.
|
void |
setContainerName(String value)
The name for the container.
|
void |
setCorsPolicy(IResolvable value)
Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.
|
void |
setCorsPolicy(List<Object> value)
Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.
|
void |
setLifecyclePolicy(String value)
Writes an object lifecycle policy to a container.
|
void |
setMetricPolicy(CfnContainer.MetricPolicyProperty value)
`AWS::MediaStore::Container.MetricPolicy`.
|
void |
setMetricPolicy(IResolvable value)
`AWS::MediaStore::Container.MetricPolicy`.
|
void |
setPolicy(String value)
Creates an access policy for the specified container to restrict the users and clients that can access it.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnContainer(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnContainer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnContainer(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnContainerProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrEndpoint()
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.
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public String getContainerName()
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.
@Stability(value=Stable)
public void setContainerName(@NotNull
String value)
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.
@Stability(value=Stable) @Nullable public Object getAccessLoggingEnabled()
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.
@Stability(value=Stable)
public void setAccessLoggingEnabled(@Nullable
Boolean value)
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.
@Stability(value=Stable)
public void setAccessLoggingEnabled(@Nullable
IResolvable value)
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.
@Stability(value=Stable) @Nullable public Object getCorsPolicy()
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 .
@Stability(value=Stable)
public void setCorsPolicy(@Nullable
IResolvable value)
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 .
@Stability(value=Stable)
public void setCorsPolicy(@Nullable
List<Object> value)
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 .
@Stability(value=Stable) @Nullable public String getLifecyclePolicy()
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 .
@Stability(value=Stable)
public void setLifecyclePolicy(@Nullable
String value)
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 .
@Stability(value=Stable) @Nullable public Object getMetricPolicy()
@Stability(value=Stable)
public void setMetricPolicy(@Nullable
CfnContainer.MetricPolicyProperty value)
@Stability(value=Stable)
public void setMetricPolicy(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public String getPolicy()
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.
@Stability(value=Stable)
public void setPolicy(@Nullable
String value)
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.
Copyright © 2022. All rights reserved.