Class: AWSCDK::CodeBuild::S3ArtifactsProps

Inherits:
ArtifactsProps
  • Object
show all
Defined in:
code_build/s3_artifacts_props.rb

Overview

Construction properties for S3Artifacts.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier: nil, bucket:, encryption: nil, include_build_id: nil, name: nil, package_zip: nil, path: nil) ⇒ S3ArtifactsProps

Returns a new instance of S3ArtifactsProps.

Parameters:

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

    The artifact identifier.

  • bucket (AWSCDK::S3::IBucket)

    The name of the output bucket.

  • encryption (Boolean, nil) (defaults to: nil)

    If this is false, build output will not be encrypted.

  • include_build_id (Boolean, nil) (defaults to: nil)

    Indicates if the build ID should be included in the path.

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

    The name of the build output ZIP file or folder inside the bucket.

  • package_zip (Boolean, nil) (defaults to: nil)

    If this is true, all build output will be packaged into a single .zip file. Otherwise, all files will be uploaded to /.

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

    The path inside of the bucket for the build output .zip file or folder. If a value is not specified, then build output will be stored at the root of the bucket (or under the directory if includeBuildId is set to true).



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'code_build/s3_artifacts_props.rb', line 14

def initialize(identifier: nil, bucket:, encryption: nil, include_build_id: nil, name: nil, package_zip: nil, path: nil)
  @identifier = identifier
  Jsii::Type.check_type(@identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "identifier") unless @identifier.nil?
  @bucket = bucket
  Jsii::Type.check_type(@bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "bucket")
  @encryption = encryption
  Jsii::Type.check_type(@encryption, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "encryption") unless @encryption.nil?
  @include_build_id = include_build_id
  Jsii::Type.check_type(@include_build_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "includeBuildId") unless @include_build_id.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @package_zip = package_zip
  Jsii::Type.check_type(@package_zip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "packageZip") unless @package_zip.nil?
  @path = path
  Jsii::Type.check_type(@path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") unless @path.nil?
end

Instance Attribute Details

#bucketAWSCDK::S3::IBucket (readonly)

The name of the output bucket.

Returns:



40
41
42
# File 'code_build/s3_artifacts_props.rb', line 40

def bucket
  @bucket
end

#encryptionBoolean? (readonly)

Note:

Default: true - output will be encrypted

If this is false, build output will not be encrypted.

This is useful if the artifact to publish a static website or sharing content with others

Returns:

  • (Boolean, nil)


47
48
49
# File 'code_build/s3_artifacts_props.rb', line 47

def encryption
  @encryption
end

#identifierString? (readonly)

The artifact identifier.

This property is required on secondary artifacts.

Returns:

  • (String, nil)


36
37
38
# File 'code_build/s3_artifacts_props.rb', line 36

def identifier
  @identifier
end

#include_build_idBoolean? (readonly)

Note:

Default: true

Indicates if the build ID should be included in the path.

If this is set to true, then the build artifact will be stored in "//".

Returns:

  • (Boolean, nil)


55
56
57
# File 'code_build/s3_artifacts_props.rb', line 55

def include_build_id
  @include_build_id
end

#nameString? (readonly)

Note:

Default: undefined, and use the name from the buildspec

The name of the build output ZIP file or folder inside the bucket.

The full S3 object key will be "//" or "/" depending on whether include_build_id is set to true.

If not set, override_artifact_name will be set and the name from the buildspec will be used instead.

Returns:

  • (String, nil)


66
67
68
# File 'code_build/s3_artifacts_props.rb', line 66

def name
  @name
end

#package_zipBoolean? (readonly)

Note:

Default: true - files will be archived

If this is true, all build output will be packaged into a single .zip file. Otherwise, all files will be uploaded to /.

Returns:

  • (Boolean, nil)


71
72
73
# File 'code_build/s3_artifacts_props.rb', line 71

def package_zip
  @package_zip
end

#pathString? (readonly)

Note:

Default: the root of the bucket

The path inside of the bucket for the build output .zip file or folder. If a value is not specified, then build output will be stored at the root of the bucket (or under the directory if includeBuildId is set to true).

Returns:

  • (String, nil)


76
77
78
# File 'code_build/s3_artifacts_props.rb', line 76

def path
  @path
end

Class Method Details

.jsii_propertiesObject



78
79
80
81
82
83
84
85
86
87
88
# File 'code_build/s3_artifacts_props.rb', line 78

def self.jsii_properties
  {
    :identifier => "identifier",
    :bucket => "bucket",
    :encryption => "encryption",
    :include_build_id => "includeBuildId",
    :name => "name",
    :package_zip => "packageZip",
    :path => "path",
  }
end

Instance Method Details

#to_jsiiObject



90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'code_build/s3_artifacts_props.rb', line 90

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "identifier" => @identifier,
    "bucket" => @bucket,
    "encryption" => @encryption,
    "includeBuildId" => @include_build_id,
    "name" => @name,
    "packageZip" => @package_zip,
    "path" => @path,
  })
  result.compact
end