Class: AWSCDK::CloudFront::CfnFunctionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_front/cfn_function_props.rb

Overview

Properties for defining a CfnFunction.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function_code:, function_config:, name:, auto_publish: nil, function_metadata: nil, tags: nil) ⇒ CfnFunctionProps

Returns a new instance of CfnFunctionProps.

Parameters:



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'cloud_front/cfn_function_props.rb', line 15

def initialize(function_code:, function_config:, name:, auto_publish: nil, function_metadata: nil, tags: nil)
  @function_code = function_code
  Jsii::Type.check_type(@function_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "functionCode")
  @function_config = function_config.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnFunction::FunctionConfigProperty.new(**function_config.transform_keys(&:to_sym)) : function_config
  Jsii::Type.check_type(@function_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmbkZ1bmN0aW9uLkZ1bmN0aW9uQ29uZmlnUHJvcGVydHkifV19fQ==")), "functionConfig")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @auto_publish = auto_publish
  Jsii::Type.check_type(@auto_publish, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "autoPublish") unless @auto_publish.nil?
  @function_metadata = .is_a?(Hash) ? ::AWSCDK::CloudFront::CfnFunction::FunctionMetadataProperty.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@function_metadata, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmbkZ1bmN0aW9uLkZ1bmN0aW9uTWV0YWRhdGFQcm9wZXJ0eSJ9XX19")), "functionMetadata") unless @function_metadata.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

#auto_publishBoolean, ... (readonly)

A flag that determines whether to automatically publish the function to the LIVE stage when it’s created.

To automatically publish to the LIVE stage, set this property to true .



53
54
55
# File 'cloud_front/cfn_function_props.rb', line 53

def auto_publish
  @auto_publish
end

#function_codeString (readonly)

The function code.

For more information about writing a CloudFront function, see Writing function code for CloudFront Functions in the Amazon CloudFront Developer Guide .



36
37
38
# File 'cloud_front/cfn_function_props.rb', line 36

def function_code
  @function_code
end

#function_configAWSCDK::IResolvable, AWSCDK::CloudFront::CfnFunction::FunctionConfigProperty (readonly)

Contains configuration information about a CloudFront function.



41
42
43
# File 'cloud_front/cfn_function_props.rb', line 41

def function_config
  @function_config
end

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

Contains metadata about a CloudFront function.



58
59
60
# File 'cloud_front/cfn_function_props.rb', line 58

def 
  @function_metadata
end

#nameString (readonly)

A name to identify the function.



46
47
48
# File 'cloud_front/cfn_function_props.rb', line 46

def name
  @name
end

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

A complex type that contains zero or more Tag elements.



63
64
65
# File 'cloud_front/cfn_function_props.rb', line 63

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



65
66
67
68
69
70
71
72
73
74
# File 'cloud_front/cfn_function_props.rb', line 65

def self.jsii_properties
  {
    :function_code => "functionCode",
    :function_config => "functionConfig",
    :name => "name",
    :auto_publish => "autoPublish",
    :function_metadata => "functionMetadata",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



76
77
78
79
80
81
82
83
84
85
86
87
# File 'cloud_front/cfn_function_props.rb', line 76

def to_jsii
  result = {}
  result.merge!({
    "functionCode" => @function_code,
    "functionConfig" => @function_config,
    "name" => @name,
    "autoPublish" => @auto_publish,
    "functionMetadata" => @function_metadata,
    "tags" => @tags,
  })
  result.compact
end