Class: AWSCDK::S3Deployment::DeployTimeSubstitutedFile

Inherits:
BucketDeployment
  • Object
show all
Defined in:
s3_deployment/deploy_time_substituted_file.rb

Overview

DeployTimeSubstitutedFile is an extension of BucketDeployment that allows users to upload individual files and specify to make substitutions in the file.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ DeployTimeSubstitutedFile

Returns a new instance of DeployTimeSubstitutedFile.

Parameters:



11
12
13
14
15
16
17
# File 's3_deployment/deploy_time_substituted_file.rb', line 11

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::S3Deployment::DeployTimeSubstitutedFileProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczNfZGVwbG95bWVudC5EZXBsb3lUaW1lU3Vic3RpdHV0ZWRGaWxlUHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 's3_deployment/deploy_time_substituted_file.rb', line 19

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :deployed_bucket => { kind: :property, name: "deployedBucket", is_optional: false },
    :handler_role => { kind: :property, name: "handlerRole", is_optional: false },
    :object_keys => { kind: :property, name: "objectKeys", is_optional: false },
    :bucket => { kind: :property, name: "bucket", is_optional: false },
    :object_key => { kind: :property, name: "objectKey", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :add_source => { kind: :method, name: "addSource", is_optional: false },
  }
end

Instance Method Details

#add_source(source) ⇒ void

This method returns an undefined value.

Add an additional source to the bucket deployment.

Examples:

# Example automatically generated from non-compiling source. May contain errors.
website_bucket = nil
deployment = S3deploy::BucketDeployment.new(self, "Deployment", {
    sources: [S3deploy::Source.asset("./website-dist")],
    destination_bucket: website_bucket,
})

deployment.add_source(S3deploy::Source.asset("./another-asset"))

Parameters:



124
125
126
127
# File 's3_deployment/deploy_time_substituted_file.rb', line 124

def add_source(source)
  Jsii::Type.check_type(source, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczNfZGVwbG95bWVudC5JU291cmNlIn0=")), "source")
  jsii_call_method("addSource", [source])
end

#bucketAWSCDK::S3::IBucket

Returns:



79
80
81
# File 's3_deployment/deploy_time_substituted_file.rb', line 79

def bucket()
  jsii_get_property("bucket")
end

#deployed_bucketAWSCDK::S3::IBucket

The bucket after the deployment.

If you want to reference the destination bucket in another construct and make sure the bucket deployment has happened before the next operation is started, pass the other construct a reference to deployment.deployedBucket.

Note that this only returns an immutable reference to the destination bucket. If sequenced access to the original destination bucket is required, you may add a dependency on the bucket deployment instead: otherResource.node.addDependency(deployment)

Returns:



51
52
53
# File 's3_deployment/deploy_time_substituted_file.rb', line 51

def deployed_bucket()
  jsii_get_property("deployedBucket")
end

#handler_roleAWSCDK::IAM::IRole

Execution role of the Lambda function behind the custom CloudFormation resource of type Custom::CDKBucketDeployment.

Returns:



58
59
60
# File 's3_deployment/deploy_time_substituted_file.rb', line 58

def handler_role()
  jsii_get_property("handlerRole")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


36
37
38
# File 's3_deployment/deploy_time_substituted_file.rb', line 36

def node()
  jsii_get_property("node")
end

#object_keyString

Returns:

  • (String)


84
85
86
# File 's3_deployment/deploy_time_substituted_file.rb', line 84

def object_key()
  jsii_get_property("objectKey")
end

#object_keysArray<String>

The object keys for the sources deployed to the S3 bucket.

This returns a list of tokenized object keys for source files that are deployed to the bucket.

This can be useful when using BucketDeployment with extract set to false and you need to reference the object key that resides in the bucket for that zip source file somewhere else in your CDK application, such as in a CFN output.

For example, use Fn.select(0, myBucketDeployment.objectKeys) to reference the object key of the first source file in your bucket deployment.

Returns:

  • (Array<String>)


74
75
76
# File 's3_deployment/deploy_time_substituted_file.rb', line 74

def object_keys()
  jsii_get_property("objectKeys")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


91
92
93
# File 's3_deployment/deploy_time_substituted_file.rb', line 91

def to_string()
  jsii_call_method("toString", [])
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



104
105
106
107
108
109
# File 's3_deployment/deploy_time_substituted_file.rb', line 104

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end