java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.codepipeline.Artifact
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:23:58.842Z") @Stability(Stable) public class Artifact extends software.amazon.jsii.JsiiObject
An output artifact of an action.

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_LATEST)
                 .handler("index.handler")
                 .code(Code.fromInline("\n        const { CodePipeline } = require('@aws-sdk/client-codepipeline');\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            });\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();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
     
     
    Artifact(String artifactName)
     
    protected
    Artifact(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Artifact(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Artifact
    A static factory method used to create instances of the Artifact class.
    atPath(String fileName)
    Returns an ArtifactPath for a file within this artifact.
     
    The artifact attribute for the name of the S3 bucket where the artifact is stored.
    Retrieve the metadata stored in this artifact under the given key.
    The artifact attribute for The name of the .zip file that contains the artifact that is generated by AWS CodePipeline, such as 1ABCyZZ.zip.
    getParam(String jsonFile, String keyName)
    Returns a token for a value inside a JSON file within this artifact.
    Returns the location of the .zip file in S3 that this Artifact represents.
    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(String key, Object value)
    Add arbitrary extra payload to the artifact under a given key.
     

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • Artifact

      protected Artifact(software.amazon.jsii.JsiiObjectRef objRef)
    • Artifact

      protected Artifact(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Artifact

      @Stability(Stable) public Artifact(@Nullable String artifactName)
      Parameters:
      artifactName -
    • Artifact

      @Stability(Stable) public Artifact()
  • Method Details

    • artifact

      @Stability(Stable) @NotNull public static Artifact artifact(@NotNull String name)
      A static factory method used to create instances of the Artifact class.

      Mainly meant to be used from decdk.

      Parameters:
      name - the (required) name of the Artifact. This parameter is required.
    • atPath

      @Stability(Stable) @NotNull public ArtifactPath atPath(@NotNull String fileName)
      Returns an ArtifactPath for a file within this artifact.

      CfnOutput is in the form "invalid input: '<'artifact-name>::invalid input: '<'file-name>"

      Parameters:
      fileName - The name of the file. This parameter is required.
    • getMetadata

      @Stability(Stable) @NotNull public Object getMetadata(@NotNull String key)
      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 - This parameter is required.
    • getParam

      @Stability(Stable) @NotNull public String getParam(@NotNull String jsonFile, @NotNull String keyName)
      Returns a token for a value inside a JSON file within this artifact.

      Parameters:
      jsonFile - The JSON file name. This parameter is required.
      keyName - The hash key. This parameter is required.
    • setMetadata

      @Stability(Stable) public void setMetadata(@NotNull String key, @NotNull Object 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 - This parameter is required.
      value - This parameter is required.
    • toString

      @Stability(Stable) @Nullable public String toString()
      Overrides:
      toString in class Object
    • getBucketName

      @Stability(Stable) @NotNull public String getBucketName()
      The artifact attribute for the name of the S3 bucket where the artifact is stored.
    • getObjectKey

      @Stability(Stable) @NotNull public 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.
    • getS3Location

      @Stability(Stable) @NotNull public Location getS3Location()
      Returns the location of the .zip file in S3 that this Artifact represents. Used by Lambda's CfnParametersCode when being deployed in a CodePipeline.
    • getUrl

      @Stability(Stable) @NotNull public 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.
    • getArtifactName

      @Stability(Stable) @Nullable public String getArtifactName()