CfnContainerPropsMixin

class aws_cdk.mixins_preview.aws_mediastore.mixins.CfnContainerPropsMixin(props, *, strategy=None)

Bases: Mixin

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 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.html

CloudformationResource:

AWS::MediaStore::Container

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_mediastore import mixins as mediastore_mixins

cfn_container_props_mixin = mediastore_mixins.CfnContainerPropsMixin(mediastore_mixins.CfnContainerMixinProps(
    access_logging_enabled=False,
    container_name="containerName",
    cors_policy=[mediastore_mixins.CfnContainerPropsMixin.CorsRuleProperty(
        allowed_headers=["allowedHeaders"],
        allowed_methods=["allowedMethods"],
        allowed_origins=["allowedOrigins"],
        expose_headers=["exposeHeaders"],
        max_age_seconds=123
    )],
    lifecycle_policy="lifecyclePolicy",
    metric_policy=mediastore_mixins.CfnContainerPropsMixin.MetricPolicyProperty(
        container_level_metrics="containerLevelMetrics",
        metric_policy_rules=[mediastore_mixins.CfnContainerPropsMixin.MetricPolicyRuleProperty(
            object_group="objectGroup",
            object_group_name="objectGroupName"
        )]
    ),
    policy="policy",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::MediaStore::Container.

Parameters:
  • props (Union[CfnContainerMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['accessLoggingEnabled', 'containerName', 'corsPolicy', 'lifecyclePolicy', 'metricPolicy', 'policy', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

CorsRuleProperty

class CfnContainerPropsMixin.CorsRuleProperty(*, allowed_headers=None, allowed_methods=None, allowed_origins=None, expose_headers=None, max_age_seconds=None)

Bases: object

A rule for a CORS policy.

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.

Parameters:
  • allowed_headers (Optional[Sequence[str]]) – Specifies which headers are allowed in a preflight OPTIONS request through the Access-Control-Request-Headers header. Each header name that is specified in Access-Control-Request-Headers must have a corresponding entry in the rule. Only the headers that were requested are sent back. This element can contain only one wildcard character (*).

  • allowed_methods (Optional[Sequence[str]]) – Identifies an HTTP method that the origin that is specified in the rule is allowed to execute. Each CORS rule must contain at least one AllowedMethods and one AllowedOrigins element.

  • allowed_origins (Optional[Sequence[str]]) – One or more response headers that you want users to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object). Each CORS rule must have at least one AllowedOrigins element. The string value can include only one wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one wildcard character to allow cross-origin access for all origins.

  • expose_headers (Optional[Sequence[str]]) – One or more headers in the response that you want users to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object). This element is optional for each rule.

  • max_age_seconds (Union[int, float, None]) – The time in seconds that your browser caches the preflight response for the specified resource. A CORS rule can have only one MaxAgeSeconds element.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_mediastore import mixins as mediastore_mixins

cors_rule_property = mediastore_mixins.CfnContainerPropsMixin.CorsRuleProperty(
    allowed_headers=["allowedHeaders"],
    allowed_methods=["allowedMethods"],
    allowed_origins=["allowedOrigins"],
    expose_headers=["exposeHeaders"],
    max_age_seconds=123
)

Attributes

allowed_headers

Specifies which headers are allowed in a preflight OPTIONS request through the Access-Control-Request-Headers header.

Each header name that is specified in Access-Control-Request-Headers must have a corresponding entry in the rule. Only the headers that were requested are sent back.

This element can contain only one wildcard character (*).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-allowedheaders

allowed_methods

Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.

Each CORS rule must contain at least one AllowedMethods and one AllowedOrigins element.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-allowedmethods

allowed_origins

One or more response headers that you want users to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).

Each CORS rule must have at least one AllowedOrigins element. The string value can include only one wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one wildcard character to allow cross-origin access for all origins.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-allowedorigins

expose_headers

One or more headers in the response that you want users to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).

This element is optional for each rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-exposeheaders

max_age_seconds

The time in seconds that your browser caches the preflight response for the specified resource.

A CORS rule can have only one MaxAgeSeconds element.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-maxageseconds

MetricPolicyProperty

class CfnContainerPropsMixin.MetricPolicyProperty(*, container_level_metrics=None, metric_policy_rules=None)

Bases: object

The metric policy that is associated with the container.

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 .

Parameters:
  • container_level_metrics (Optional[str]) – A setting to enable or disable metrics at the container level.

  • metric_policy_rules (Union[IResolvable, Sequence[Union[IResolvable, MetricPolicyRuleProperty, Dict[str, Any]]], None]) – A parameter that holds an array of rules that enable metrics at the object level. This parameter is optional, but if you choose to include it, you must also include at least one rule. By default, you can include up to five rules. You can also request a quota increase to allow up to 300 rules per policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicy.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_mediastore import mixins as mediastore_mixins

metric_policy_property = mediastore_mixins.CfnContainerPropsMixin.MetricPolicyProperty(
    container_level_metrics="containerLevelMetrics",
    metric_policy_rules=[mediastore_mixins.CfnContainerPropsMixin.MetricPolicyRuleProperty(
        object_group="objectGroup",
        object_group_name="objectGroupName"
    )]
)

Attributes

container_level_metrics

A setting to enable or disable metrics at the container level.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicy.html#cfn-mediastore-container-metricpolicy-containerlevelmetrics

metric_policy_rules

A parameter that holds an array of rules that enable metrics at the object level.

This parameter is optional, but if you choose to include it, you must also include at least one rule. By default, you can include up to five rules. You can also request a quota increase to allow up to 300 rules per policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicy.html#cfn-mediastore-container-metricpolicy-metricpolicyrules

MetricPolicyRuleProperty

class CfnContainerPropsMixin.MetricPolicyRuleProperty(*, object_group=None, object_group_name=None)

Bases: object

A setting that enables metrics at the object level.

Each rule contains an object group and an object group name. If the policy includes the MetricPolicyRules parameter, you must include at least one rule. Each metric policy can include up to five rules by default. You can also request a quota increase to allow up to 300 rules per policy.

Parameters:
  • object_group (Optional[str]) – A path or file name that defines which objects to include in the group. Wildcards (*) are acceptable.

  • object_group_name (Optional[str]) – A name that allows you to refer to the object group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicyrule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_mediastore import mixins as mediastore_mixins

metric_policy_rule_property = mediastore_mixins.CfnContainerPropsMixin.MetricPolicyRuleProperty(
    object_group="objectGroup",
    object_group_name="objectGroupName"
)

Attributes

object_group

A path or file name that defines which objects to include in the group.

Wildcards (*) are acceptable.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicyrule.html#cfn-mediastore-container-metricpolicyrule-objectgroup

object_group_name

A name that allows you to refer to the object group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicyrule.html#cfn-mediastore-container-metricpolicyrule-objectgroupname