@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)",
date="2023-01-31T18:36:52.155Z")
public class Artifact
extends software.amazon.jsii.JsiiObject
Artifacts can be used as input by some actions.
Example:
// later: PipelineProject project; LambdaInvokeAction lambdaInvokeAction = LambdaInvokeAction.Builder.create() .actionName("Lambda") .lambda(Function.Builder.create(this, "Func") .runtime(Runtime.NODEJS_14_X) .handler("index.handler") .code(Code.fromInline("\n const AWS = require('aws-sdk');\n\n exports.handler = async function(event, context) {\n const codepipeline = new AWS.CodePipeline();\n await codepipeline.putJobSuccessResult({\n jobId: event['CodePipeline.job'].id,\n outputVariables: {\n MY_VAR: \"some value\",\n },\n }).promise();\n }\n ")) .build()) .variablesNamespace("MyNamespace") .build(); Artifact sourceOutput = new Artifact(); CodeBuildAction.Builder.create() .actionName("CodeBuild") .project(project) .input(sourceOutput) .environmentVariables(Map.of( "MyVar", BuildEnvironmentVariable.builder() .value(lambdaInvokeAction.variable("MY_VAR")) .build())) .build();
Modifier | Constructor and Description |
---|---|
|
Artifact() |
protected |
Artifact(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Artifact(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static Artifact |
artifact(java.lang.String name)
A static factory method used to create instances of the Artifact class.
|
ArtifactPath |
atPath(java.lang.String fileName)
Returns an ArtifactPath for a file within this artifact.
|
java.lang.String |
getArtifactName() |
java.lang.String |
getBucketName()
The artifact attribute for the name of the S3 bucket where the artifact is stored.
|
java.lang.Object |
getMetadata(java.lang.String key)
Retrieve the metadata stored in this artifact under the given key.
|
java.lang.String |
getObjectKey()
The artifact attribute for The name of the .zip file that contains the artifact that is generated by AWS CodePipeline, such as 1ABCyZZ.zip.
|
java.lang.String |
getParam(java.lang.String jsonFile,
java.lang.String keyName)
Returns a token for a value inside a JSON file within this artifact.
|
Location |
getS3Location()
Returns the location of the .zip file in S3 that this Artifact represents.
|
java.lang.String |
getUrl()
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.
|
void |
setMetadata(java.lang.String key,
java.lang.Object value)
Add arbitrary extra payload to the artifact under a given key.
|
java.lang.String |
toString() |
protected Artifact(software.amazon.jsii.JsiiObjectRef objRef)
protected Artifact(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public Artifact()
public static Artifact artifact(java.lang.String name)
Mainly meant to be used from decdk
.
name
- the (required) name of the Artifact. This parameter is required.public ArtifactPath atPath(java.lang.String fileName)
CfnOutput is in the form "
fileName
- The name of the file. This parameter is required.public java.lang.Object getMetadata(java.lang.String key)
If there is no metadata stored under the given key, null will be returned.
key
- This parameter is required.public java.lang.String getParam(java.lang.String jsonFile, java.lang.String keyName)
jsonFile
- The JSON file name. This parameter is required.keyName
- The hash key. This parameter is required.public void setMetadata(java.lang.String key, java.lang.Object value)
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.
key
- This parameter is required.value
- This parameter is required.public java.lang.String toString()
public java.lang.String getBucketName()
public java.lang.String getObjectKey()
public Location getS3Location()
public java.lang.String getUrl()
public java.lang.String getArtifactName()