Class: AWSCDK::Lightsail::CfnDistributionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lightsail/cfn_distribution_props.rb

Overview

Properties for defining a CfnDistribution.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bundle_id:, default_cache_behavior:, distribution_name:, origin:, cache_behaviors: nil, cache_behavior_settings: nil, certificate_name: nil, ip_address_type: nil, is_enabled: nil, tags: nil) ⇒ CfnDistributionProps

Returns a new instance of CfnDistributionProps.

Parameters:



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lightsail/cfn_distribution_props.rb', line 19

def initialize(bundle_id:, default_cache_behavior:, distribution_name:, origin:, cache_behaviors: nil, cache_behavior_settings: nil, certificate_name: nil, ip_address_type: nil, is_enabled: nil, tags: nil)
  @bundle_id = bundle_id
  Jsii::Type.check_type(@bundle_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bundleId")
  @default_cache_behavior = default_cache_behavior.is_a?(Hash) ? ::AWSCDK::Lightsail::CfnDistribution::CacheBehaviorProperty.new(**default_cache_behavior.transform_keys(&:to_sym)) : default_cache_behavior
  Jsii::Type.check_type(@default_cache_behavior, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19saWdodHNhaWwuQ2ZuRGlzdHJpYnV0aW9uLkNhY2hlQmVoYXZpb3JQcm9wZXJ0eSJ9XX19")), "defaultCacheBehavior")
  @distribution_name = distribution_name
  Jsii::Type.check_type(@distribution_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "distributionName")
  @origin = origin.is_a?(Hash) ? ::AWSCDK::Lightsail::CfnDistribution::InputOriginProperty.new(**origin.transform_keys(&:to_sym)) : origin
  Jsii::Type.check_type(@origin, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19saWdodHNhaWwuQ2ZuRGlzdHJpYnV0aW9uLklucHV0T3JpZ2luUHJvcGVydHkifV19fQ==")), "origin")
  @cache_behaviors = cache_behaviors
  Jsii::Type.check_type(@cache_behaviors, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGlnaHRzYWlsLkNmbkRpc3RyaWJ1dGlvbi5DYWNoZUJlaGF2aW9yUGVyUGF0aFByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "cacheBehaviors") unless @cache_behaviors.nil?
  @cache_behavior_settings = cache_behavior_settings.is_a?(Hash) ? ::AWSCDK::Lightsail::CfnDistribution::CacheSettingsProperty.new(**cache_behavior_settings.transform_keys(&:to_sym)) : cache_behavior_settings
  Jsii::Type.check_type(@cache_behavior_settings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19saWdodHNhaWwuQ2ZuRGlzdHJpYnV0aW9uLkNhY2hlU2V0dGluZ3NQcm9wZXJ0eSJ9XX19")), "cacheBehaviorSettings") unless @cache_behavior_settings.nil?
  @certificate_name = certificate_name
  Jsii::Type.check_type(@certificate_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "certificateName") unless @certificate_name.nil?
  @ip_address_type = ip_address_type
  Jsii::Type.check_type(@ip_address_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ipAddressType") unless @ip_address_type.nil?
  @is_enabled = is_enabled
  Jsii::Type.check_type(@is_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "isEnabled") unless @is_enabled.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

#bundle_idString (readonly)

The ID of the bundle applied to the distribution.



46
47
48
# File 'lightsail/cfn_distribution_props.rb', line 46

def bundle_id
  @bundle_id
end

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

An object that describes the cache behavior settings of the distribution.



73
74
75
# File 'lightsail/cfn_distribution_props.rb', line 73

def cache_behavior_settings
  @cache_behavior_settings
end

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

An array of objects that describe the per-path cache behavior of the distribution.



68
69
70
# File 'lightsail/cfn_distribution_props.rb', line 68

def cache_behaviors
  @cache_behaviors
end

#certificate_nameString? (readonly)

The name of the SSL/TLS certificate attached to the distribution.



78
79
80
# File 'lightsail/cfn_distribution_props.rb', line 78

def certificate_name
  @certificate_name
end

#default_cache_behaviorAWSCDK::IResolvable, AWSCDK::Lightsail::CfnDistribution::CacheBehaviorProperty (readonly)

An object that describes the default cache behavior of the distribution.



51
52
53
# File 'lightsail/cfn_distribution_props.rb', line 51

def default_cache_behavior
  @default_cache_behavior
end

#distribution_nameString (readonly)

The name of the distribution.



56
57
58
# File 'lightsail/cfn_distribution_props.rb', line 56

def distribution_name
  @distribution_name
end

#ip_address_typeString? (readonly)

The IP address type of the distribution.

The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6.



85
86
87
# File 'lightsail/cfn_distribution_props.rb', line 85

def ip_address_type
  @ip_address_type
end

#is_enabledBoolean, ... (readonly)

A Boolean value indicating whether the distribution is enabled.



90
91
92
# File 'lightsail/cfn_distribution_props.rb', line 90

def is_enabled
  @is_enabled
end

#originAWSCDK::IResolvable, AWSCDK::Lightsail::CfnDistribution::InputOriginProperty (readonly)

An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.

The distribution pulls, caches, and serves content from the origin.



63
64
65
# File 'lightsail/cfn_distribution_props.rb', line 63

def origin
  @origin
end

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

An array of key-value pairs to apply to this resource.

For more information, see Tag in the AWS CloudFormation User Guide .

The Value of Tags is optional for Lightsail resources.



99
100
101
# File 'lightsail/cfn_distribution_props.rb', line 99

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lightsail/cfn_distribution_props.rb', line 101

def self.jsii_properties
  {
    :bundle_id => "bundleId",
    :default_cache_behavior => "defaultCacheBehavior",
    :distribution_name => "distributionName",
    :origin => "origin",
    :cache_behaviors => "cacheBehaviors",
    :cache_behavior_settings => "cacheBehaviorSettings",
    :certificate_name => "certificateName",
    :ip_address_type => "ipAddressType",
    :is_enabled => "isEnabled",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lightsail/cfn_distribution_props.rb', line 116

def to_jsii
  result = {}
  result.merge!({
    "bundleId" => @bundle_id,
    "defaultCacheBehavior" => @default_cache_behavior,
    "distributionName" => @distribution_name,
    "origin" => @origin,
    "cacheBehaviors" => @cache_behaviors,
    "cacheBehaviorSettings" => @cache_behavior_settings,
    "certificateName" => @certificate_name,
    "ipAddressType" => @ip_address_type,
    "isEnabled" => @is_enabled,
    "tags" => @tags,
  })
  result.compact
end