Class: AWSCDK::S3Deployment::DeployTimeSubstitutedFileProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
s3_deployment/deploy_time_substituted_file_props.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(destination_bucket:, source:, substitutions:, destination_key: nil, role: nil) ⇒ DeployTimeSubstitutedFileProps

Returns a new instance of DeployTimeSubstitutedFileProps.

Parameters:

  • destination_bucket (AWSCDK::S3::IBucket)

    The S3 bucket to sync the contents of the zip file to.

  • source (String)

    Path to the user's local file.

  • substitutions (Hash{String => String})

    User-defined substitutions to make in the file.

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

    The object key in the destination bucket where the processed file would be written to.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    Execution role associated with this function.



11
12
13
14
15
16
17
18
19
20
21
22
# File 's3_deployment/deploy_time_substituted_file_props.rb', line 11

def initialize(destination_bucket:, source:, substitutions:, destination_key: nil, role: nil)
  @destination_bucket = destination_bucket
  Jsii::Type.check_type(@destination_bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "destinationBucket")
  @source = source
  Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source")
  @substitutions = substitutions
  Jsii::Type.check_type(@substitutions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "substitutions")
  @destination_key = destination_key
  Jsii::Type.check_type(@destination_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "destinationKey") unless @destination_key.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
end

Instance Attribute Details

#destination_bucketAWSCDK::S3::IBucket (readonly)

The S3 bucket to sync the contents of the zip file to.

Returns:



27
28
29
# File 's3_deployment/deploy_time_substituted_file_props.rb', line 27

def destination_bucket
  @destination_bucket
end

#destination_keyString? (readonly)

Note:

Default: - Fingerprint of the file content would be used as object key

The object key in the destination bucket where the processed file would be written to.

Returns:

  • (String, nil)


45
46
47
# File 's3_deployment/deploy_time_substituted_file_props.rb', line 45

def destination_key
  @destination_key
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A role is automatically created

Execution role associated with this function.

Returns:



50
51
52
# File 's3_deployment/deploy_time_substituted_file_props.rb', line 50

def role
  @role
end

#sourceString (readonly)

Path to the user's local file.

Returns:

  • (String)


31
32
33
# File 's3_deployment/deploy_time_substituted_file_props.rb', line 31

def source
  @source
end

#substitutionsHash{String => String} (readonly)

User-defined substitutions to make in the file.

Placeholders in the user's local file must be specified with double curly brackets and spaces. For example, if you use the key 'xxxx' in the file, it must be written as: xxxx } to be recognized by the construct as a substitution.

Returns:

  • (Hash{String => String})


40
41
42
# File 's3_deployment/deploy_time_substituted_file_props.rb', line 40

def substitutions
  @substitutions
end

Class Method Details

.jsii_propertiesObject



52
53
54
55
56
57
58
59
60
# File 's3_deployment/deploy_time_substituted_file_props.rb', line 52

def self.jsii_properties
  {
    :destination_bucket => "destinationBucket",
    :source => "source",
    :substitutions => "substitutions",
    :destination_key => "destinationKey",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



62
63
64
65
66
67
68
69
70
71
72
# File 's3_deployment/deploy_time_substituted_file_props.rb', line 62

def to_jsii
  result = {}
  result.merge!({
    "destinationBucket" => @destination_bucket,
    "source" => @source,
    "substitutions" => @substitutions,
    "destinationKey" => @destination_key,
    "role" => @role,
  })
  result.compact
end