Class: AWSCDK::Codepipeline::Artifact

Inherits:
Jsii::Object
  • Object
show all
Defined in:
codepipeline/artifact.rb

Overview

An output artifact of an action.

Artifacts can be used as input by some actions.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(artifact_name = nil, artifact_files = nil) ⇒ Artifact

An output artifact of an action.

Artifacts can be used as input by some actions.

Parameters:

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

    the (required) name of the Artifact.

  • artifact_files (Array<String>, nil) (defaults to: nil)

    file paths that you want to export as the output artifact for the action.



16
17
18
19
20
# File 'codepipeline/artifact.rb', line 16

def initialize(artifact_name = nil, artifact_files = nil)
  Jsii::Type.check_type(artifact_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "artifactName") unless artifact_name.nil?
  Jsii::Type.check_type(artifact_files, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "artifactFiles") unless artifact_files.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(artifact_name, artifact_files)
end

Class Method Details

.artifact(name, files = nil) ⇒ AWSCDK::Codepipeline::Artifact

A static factory method used to create instances of the Artifact class.

Mainly meant to be used from decdk.

Parameters:

  • name (String)

    the (required) name of the Artifact.

  • files (Array<String>, nil) (defaults to: nil)

    file paths that you want to export as the output artifact for the action.

Returns:

  • (AWSCDK::Codepipeline::Artifact)


45
46
47
48
49
# File 'codepipeline/artifact.rb', line 45

def self.artifact(name, files = nil)
  Jsii::Type.check_type(name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  Jsii::Type.check_type(files, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "files") unless files.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_codepipeline.Artifact", "artifact", [name, files])
end

.jsii_overridable_methodsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'codepipeline/artifact.rb', line 22

def self.jsii_overridable_methods
  {
    :bucket_name => { kind: :property, name: "bucketName", is_optional: false },
    :object_key => { kind: :property, name: "objectKey", is_optional: false },
    :s3_location => { kind: :property, name: "s3Location", is_optional: false },
    :url => { kind: :property, name: "url", is_optional: false },
    :artifact_files => { kind: :property, name: "artifactFiles", is_optional: true },
    :artifact_name => { kind: :property, name: "artifactName", is_optional: true },
    :at_path => { kind: :method, name: "atPath", is_optional: false },
    :get_metadata => { kind: :method, name: "getMetadata", is_optional: false },
    :get_param => { kind: :method, name: "getParam", is_optional: false },
    :set_metadata => { kind: :method, name: "setMetadata", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
  }
end

Instance Method Details

#artifact_filesArray<String>?

The file paths that you want to export as the output artifact for the action.

This property can only be used in artifacts for CommandsAction.

Returns:

  • (Array<String>, nil)


84
85
86
# File 'codepipeline/artifact.rb', line 84

def artifact_files()
  jsii_get_property("artifactFiles")
end

#artifact_nameString?

Returns:

  • (String, nil)


89
90
91
# File 'codepipeline/artifact.rb', line 89

def artifact_name()
  jsii_get_property("artifactName")
end

#at_path(file_name) ⇒ AWSCDK::Codepipeline::ArtifactPath

Returns an ArtifactPath for a file within this artifact.

CfnOutput is in the form "::"

Parameters:

  • file_name (String)

    The name of the file.

Returns:



99
100
101
102
# File 'codepipeline/artifact.rb', line 99

def at_path(file_name)
  Jsii::Type.check_type(file_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fileName")
  jsii_call_method("atPath", [file_name])
end

#bucket_nameString

The artifact attribute for the name of the S3 bucket where the artifact is stored.

Returns:

  • (String)


54
55
56
# File 'codepipeline/artifact.rb', line 54

def bucket_name()
  jsii_get_property("bucketName")
end

#get_metadata(key) ⇒ Object

Retrieve the metadata stored in this artifact under the given key.

If there is no metadata stored under the given key, null will be returned.

Parameters:

  • key (String)

Returns:

  • (Object)


111
112
113
114
# File 'codepipeline/artifact.rb', line 111

def (key)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  jsii_call_method("getMetadata", [key])
end

#get_param(json_file, key_name) ⇒ String

Returns a token for a value inside a JSON file within this artifact.

Parameters:

  • json_file (String)

    The JSON file name.

  • key_name (String)

    The hash key.

Returns:

  • (String)


121
122
123
124
125
# File 'codepipeline/artifact.rb', line 121

def get_param(json_file, key_name)
  Jsii::Type.check_type(json_file, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jsonFile")
  Jsii::Type.check_type(key_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyName")
  jsii_call_method("getParam", [json_file, key_name])
end

#object_keyString

The artifact attribute for The name of the .zip file that contains the artifact that is generated by AWS CodePipeline, such as 1ABCyZZ.zip.

Returns:

  • (String)


61
62
63
# File 'codepipeline/artifact.rb', line 61

def object_key()
  jsii_get_property("objectKey")
end

#s3_locationAWSCDK::S3::Location

Returns the location of the .zip file in S3 that this Artifact represents. Used by Lambda's CfnParametersCode when being deployed in a CodePipeline.



68
69
70
# File 'codepipeline/artifact.rb', line 68

def s3_location()
  jsii_get_property("s3Location")
end

#set_metadata(key, value) ⇒ void

This method returns an undefined value.

Add arbitrary extra payload to the artifact under a given key.

This can be used by CodePipeline actions to communicate data between themselves. If metadata was already present under the given key, it will be overwritten with the new value.

Parameters:

  • key (String)
  • value (Object)


136
137
138
139
140
# File 'codepipeline/artifact.rb', line 136

def (key, value)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_call_method("setMetadata", [key, value])
end

#to_stringString?

Returns:

  • (String, nil)


143
144
145
# File 'codepipeline/artifact.rb', line 143

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

#urlString

The artifact attribute of the Amazon Simple Storage Service (Amazon S3) URL of the artifact, such as https://s3-us-west-2.amazonaws.com/artifactstorebucket-yivczw8jma0c/test/TemplateSo/1ABCyZZ.zip.

Returns:

  • (String)


75
76
77
# File 'codepipeline/artifact.rb', line 75

def url()
  jsii_get_property("url")
end