Class: AWSCDK::MediaStore::CfnContainerProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
media_store/cfn_container_props.rb

Overview

Properties for defining a CfnContainer.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container_name:, access_logging_enabled: nil, cors_policy: nil, lifecycle_policy: nil, metric_policy: nil, policy: nil, tags: nil) ⇒ CfnContainerProps

Returns a new instance of CfnContainerProps.

Parameters:

  • container_name (String)

    The name for the container.

  • access_logging_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    The state of access logging on the container.

  • cors_policy (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::MediaStore::CfnContainer::CorsRuleProperty>, nil) (defaults to: nil)

    End of support notice: On November 13, 2025, AWS will discontinue support for AWS Elemental MediaStore.

  • lifecycle_policy (String, nil) (defaults to: nil)

    End of support notice: On November 13, 2025, AWS will discontinue support for AWS Elemental MediaStore.

  • metric_policy (AWSCDK::IResolvable, AWSCDK::MediaStore::CfnContainer::MetricPolicyProperty, nil) (defaults to: nil)

    The metric policy that is associated with the container.

  • policy (String, nil) (defaults to: nil)

    Creates an access policy for the specified container to restrict the users and clients that can access it.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'media_store/cfn_container_props.rb', line 16

def initialize(container_name:, access_logging_enabled: nil, cors_policy: nil, lifecycle_policy: nil, metric_policy: nil, policy: nil, tags: nil)
  @container_name = container_name
  Jsii::Type.check_type(@container_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerName")
  @access_logging_enabled = access_logging_enabled
  Jsii::Type.check_type(@access_logging_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "accessLoggingEnabled") unless @access_logging_enabled.nil?
  @cors_policy = cors_policy
  Jsii::Type.check_type(@cors_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbWVkaWFzdG9yZS5DZm5Db250YWluZXIuQ29yc1J1bGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "corsPolicy") unless @cors_policy.nil?
  @lifecycle_policy = lifecycle_policy
  Jsii::Type.check_type(@lifecycle_policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "lifecyclePolicy") unless @lifecycle_policy.nil?
  @metric_policy = metric_policy.is_a?(Hash) ? ::AWSCDK::MediaStore::CfnContainer::MetricPolicyProperty.new(**metric_policy.transform_keys(&:to_sym)) : metric_policy
  Jsii::Type.check_type(@metric_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19tZWRpYXN0b3JlLkNmbkNvbnRhaW5lci5NZXRyaWNQb2xpY3lQcm9wZXJ0eSJ9XX19")), "metricPolicy") unless @metric_policy.nil?
  @policy = policy
  Jsii::Type.check_type(@policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policy") unless @policy.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#access_logging_enabledBoolean, ... (readonly)

The state of access logging on the container.

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.



46
47
48
# File 'media_store/cfn_container_props.rb', line 46

def access_logging_enabled
  @access_logging_enabled
end

#container_nameString (readonly)

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 movies in every region, as long as you don’t have an existing container with that name.



39
40
41
# File 'media_store/cfn_container_props.rb', line 39

def container_name
  @container_name
end

#cors_policyAWSCDK::IResolvable, ... (readonly)

End of support notice: On November 13, 2025, AWS will discontinue support for AWS Elemental MediaStore.

After November 13, 2025, you will no longer be able to access the AWS Elemental MediaStore console or AWS Elemental MediaStore resources. For more information, visit this blog post .

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 .



59
60
61
# File 'media_store/cfn_container_props.rb', line 59

def cors_policy
  @cors_policy
end

#lifecycle_policyString? (readonly)

End of support notice: On November 13, 2025, AWS will discontinue support for AWS Elemental MediaStore.

After November 13, 2025, you will no longer be able to access the AWS Elemental MediaStore console or AWS Elemental MediaStore resources. For more information, visit this blog post .

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 .



70
71
72
# File 'media_store/cfn_container_props.rb', line 70

def lifecycle_policy
  @lifecycle_policy
end

#metric_policyAWSCDK::IResolvable, ... (readonly)

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 .



79
80
81
# File 'media_store/cfn_container_props.rb', line 79

def metric_policy
  @metric_policy
end

#policyString? (readonly)

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 PutContainerPolicy twice, the second command modifies the existing policy.



88
89
90
# File 'media_store/cfn_container_props.rb', line 88

def policy
  @policy
end

#tagsArray<AWSCDK::CfnTag>? (readonly)



91
92
93
# File 'media_store/cfn_container_props.rb', line 91

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



93
94
95
96
97
98
99
100
101
102
103
# File 'media_store/cfn_container_props.rb', line 93

def self.jsii_properties
  {
    :container_name => "containerName",
    :access_logging_enabled => "accessLoggingEnabled",
    :cors_policy => "corsPolicy",
    :lifecycle_policy => "lifecyclePolicy",
    :metric_policy => "metricPolicy",
    :policy => "policy",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'media_store/cfn_container_props.rb', line 105

def to_jsii
  result = {}
  result.merge!({
    "containerName" => @container_name,
    "accessLoggingEnabled" => @access_logging_enabled,
    "corsPolicy" => @cors_policy,
    "lifecyclePolicy" => @lifecycle_policy,
    "metricPolicy" => @metric_policy,
    "policy" => @policy,
    "tags" => @tags,
  })
  result.compact
end