Class: AWSCDK::ECS::EnvironmentFile

Inherits:
Jsii::Object
  • Object
show all
Defined in:
ecs/environment_file.rb

Overview

Constructs for types of environment files.

Direct Known Subclasses

AssetEnvironmentFile, S3EnvironmentFile

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEnvironmentFile

Returns a new instance of EnvironmentFile.



8
9
10
# File 'ecs/environment_file.rb', line 8

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.from_asset(path, options = nil) ⇒ AWSCDK::ECS::AssetEnvironmentFile

Loads the environment file from a local disk path.

Parameters:

Returns:



23
24
25
26
27
28
# File 'ecs/environment_file.rb', line 23

def self.from_asset(path, options = nil)
  Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path")
  options = options.is_a?(Hash) ? ::AWSCDK::S3Assets::AssetOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczNfYXNzZXRzLkFzc2V0T3B0aW9ucyJ9")), "options") unless options.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.EnvironmentFile", "fromAsset", [path, options])
end

.from_bucket(bucket, key, object_version = nil) ⇒ AWSCDK::ECS::S3EnvironmentFile

Loads the environment file from an S3 bucket.

Parameters:

  • bucket (AWSCDK::S3::IBucket)

    The S3 bucket.

  • key (String)

    The object key.

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

    Optional S3 object version.

Returns:



36
37
38
39
40
41
# File 'ecs/environment_file.rb', line 36

def self.from_bucket(bucket, key, object_version = nil)
  Jsii::Type.check_type(bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "bucket")
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Type.check_type(object_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "objectVersion") unless object_version.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.EnvironmentFile", "fromBucket", [bucket, key, object_version])
end

.jsii_overridable_methodsObject



12
13
14
15
16
# File 'ecs/environment_file.rb', line 12

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

Instance Method Details

#bind(scope) ⇒ AWSCDK::ECS::EnvironmentFileConfig

Called when the container is initialized to allow this object to bind to the stack.

Parameters:

  • scope (Constructs::Construct)

    The binding scope.

Returns:



47
48
49
50
# File 'ecs/environment_file.rb', line 47

def bind(scope)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  jsii_call_method("bind", [scope])
end