Class CfnContainer

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:05.753Z") @Stability(Stable) public class CfnContainer extends CfnResource implements IInspectable, ITaggable
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();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnContainerProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrEndpoint

      @Stability(Stable) @NotNull public String 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.

    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getContainerName

      @Stability(Stable) @NotNull public String getContainerName()
      The name for the container.
    • setContainerName

      @Stability(Stable) public void setContainerName(@NotNull String value)
      The name for the container.
    • getAccessLoggingEnabled

      @Stability(Stable) @Nullable public Object getAccessLoggingEnabled()
      The state of access logging on the container.
    • setAccessLoggingEnabled

      @Stability(Stable) public void setAccessLoggingEnabled(@Nullable Boolean value)
      The state of access logging on the container.
    • setAccessLoggingEnabled

      @Stability(Stable) public void setAccessLoggingEnabled(@Nullable IResolvable value)
      The state of access logging on the container.
    • getCorsPolicy

      @Stability(Stable) @Nullable public Object getCorsPolicy()
      Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.
    • setCorsPolicy

      @Stability(Stable) public void setCorsPolicy(@Nullable IResolvable value)
      Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.
    • setCorsPolicy

      @Stability(Stable) public void setCorsPolicy(@Nullable List<Object> value)
      Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests.
    • getLifecyclePolicy

      @Stability(Stable) @Nullable public String getLifecyclePolicy()
      Writes an object lifecycle policy to a container.
    • setLifecyclePolicy

      @Stability(Stable) public void setLifecyclePolicy(@Nullable String value)
      Writes an object lifecycle policy to a container.
    • getMetricPolicy

      @Stability(Stable) @Nullable public Object getMetricPolicy()
      The metric policy that is associated with the container.
    • setMetricPolicy

      @Stability(Stable) public void setMetricPolicy(@Nullable IResolvable value)
      The metric policy that is associated with the container.
    • setMetricPolicy

      @Stability(Stable) public void setMetricPolicy(@Nullable CfnContainer.MetricPolicyProperty value)
      The metric policy that is associated with the container.
    • getPolicy

      @Stability(Stable) @Nullable public String getPolicy()
      Creates an access policy for the specified container to restrict the users and clients that can access it.
    • setPolicy

      @Stability(Stable) public void setPolicy(@Nullable String value)
      Creates an access policy for the specified container to restrict the users and clients that can access it.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)