Class: AWSCDK::Synthetics::AssetCode

Inherits:
Code
  • Object
show all
Defined in:
synthetics/asset_code.rb

Overview

Canary code from an Asset.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asset_path, options = nil) ⇒ AssetCode

Returns a new instance of AssetCode.

Parameters:



10
11
12
13
14
15
# File 'synthetics/asset_code.rb', line 10

def initialize(asset_path, options = nil)
  options = options.is_a?(Hash) ? ::AWSCDK::S3Assets::AssetOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(asset_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assetPath")
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczNfYXNzZXRzLkFzc2V0T3B0aW9ucyJ9")), "options") unless options.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(asset_path, options)
end

Class Method Details

.jsii_overridable_methodsObject



17
18
19
20
21
# File 'synthetics/asset_code.rb', line 17

def self.jsii_overridable_methods
  {
    :bind => { kind: :method, name: "bind", is_optional: false },
  }
end

Instance Method Details

#bind(scope, handler, family, runtime_name = nil) ⇒ AWSCDK::Synthetics::CodeConfig

Called when the canary is initialized to allow this object to bind to the stack, add resources and have fun.

Parameters:

Returns:



30
31
32
33
34
35
36
# File 'synthetics/asset_code.rb', line 30

def bind(scope, handler, family, runtime_name = nil)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(handler, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "handler")
  Jsii::Type.check_type(family, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3ludGhldGljcy5SdW50aW1lRmFtaWx5In0=")), "family")
  Jsii::Type.check_type(runtime_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "runtimeName") unless runtime_name.nil?
  jsii_call_method("bind", [scope, handler, family, runtime_name])
end