[ aws . codepipeline ]

update-pipeline

Description

Updates a specified pipeline with edits or changes to its structure. Use a JSON file with the pipeline structure and UpdatePipeline to provide the full structure of the pipeline. Updating the pipeline increases the version number of the pipeline by 1.

See also: AWS API Documentation

Synopsis

  update-pipeline
--pipeline <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]

Options

--pipeline (structure)

The name of the pipeline to be updated.

name -> (string)

The name of the pipeline.

roleArn -> (string)

The Amazon Resource Name (ARN) for AWS CodePipeline to use to either perform actions with no actionRoleArn , or to use to assume roles for actions with an actionRoleArn .

artifactStore -> (structure)

Represents information about the S3 bucket where artifacts are stored for the pipeline.

Note

You must include either artifactStore or artifactStores in your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must use artifactStores .

type -> (string)

The type of the artifact store, such as S3.

location -> (string)

The S3 bucket used for storing the artifacts for a pipeline. You can specify the name of an S3 bucket but not a folder in the bucket. A folder to contain the pipeline artifacts is created for you based on the name of the pipeline. You can use any S3 bucket in the same AWS Region as the pipeline to store your pipeline artifacts.

encryptionKey -> (structure)

The encryption key used to encrypt the data in the artifact store, such as an AWS Key Management Service (AWS KMS) key. If this is undefined, the default key for Amazon S3 is used.

id -> (string)

The ID used to identify the key. For an AWS KMS key, you can use the key ID, the key ARN, or the alias ARN.

Note

Aliases are recognized only in the account that created the customer master key (CMK). For cross-account actions, you can only use the key ID or key ARN to identify the key.

type -> (string)

The type of encryption key, such as an AWS Key Management Service (AWS KMS) key. When creating or updating a pipeline, the value must be set to ‘KMS’.

artifactStores -> (map)

A mapping of artifactStore objects and their corresponding AWS Regions. There must be an artifact store for the pipeline Region and for each cross-region action in the pipeline.

Note

You must include either artifactStore or artifactStores in your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must use artifactStores .

key -> (string)

value -> (structure)

The S3 bucket where artifacts for the pipeline are stored.

Note

You must include either artifactStore or artifactStores in your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must use artifactStores .

type -> (string)

The type of the artifact store, such as S3.

location -> (string)

The S3 bucket used for storing the artifacts for a pipeline. You can specify the name of an S3 bucket but not a folder in the bucket. A folder to contain the pipeline artifacts is created for you based on the name of the pipeline. You can use any S3 bucket in the same AWS Region as the pipeline to store your pipeline artifacts.

encryptionKey -> (structure)

The encryption key used to encrypt the data in the artifact store, such as an AWS Key Management Service (AWS KMS) key. If this is undefined, the default key for Amazon S3 is used.

id -> (string)

The ID used to identify the key. For an AWS KMS key, you can use the key ID, the key ARN, or the alias ARN.

Note

Aliases are recognized only in the account that created the customer master key (CMK). For cross-account actions, you can only use the key ID or key ARN to identify the key.

type -> (string)

The type of encryption key, such as an AWS Key Management Service (AWS KMS) key. When creating or updating a pipeline, the value must be set to ‘KMS’.

stages -> (list)

The stage in which to perform the action.

(structure)

Represents information about a stage and its definition.

name -> (string)

The name of the stage.

blockers -> (list)

Reserved for future use.

(structure)

Reserved for future use.

name -> (string)

Reserved for future use.

type -> (string)

Reserved for future use.

actions -> (list)

The actions included in a stage.

(structure)

Represents information about an action declaration.

name -> (string)

The action declaration’s name.

actionTypeId -> (structure)

Specifies the action type and the provider of the action.

category -> (string)

A category defines what kind of action can be taken in the stage, and constrains the provider type for the action. Valid categories are limited to one of the following values.

  • Source

  • Build

  • Test

  • Deploy

  • Invoke

  • Approval

owner -> (string)

The creator of the action being called. There are three valid values for the Owner field in the action category section within your pipeline structure: AWS , ThirdParty , and Custom . For more information, see Valid Action Types and Providers in CodePipeline .

provider -> (string)

The provider of the service being called by the action. Valid providers are determined by the action category. For example, an action in the Deploy category type might have a provider of AWS CodeDeploy, which would be specified as CodeDeploy. For more information, see Valid Action Types and Providers in CodePipeline .

version -> (string)

A string that describes the action version.

runOrder -> (integer)

The order in which actions are run.

configuration -> (map)

The action’s configuration. These are key-value pairs that specify input values for an action. For more information, see Action Structure Requirements in CodePipeline . For the list of configuration properties for the AWS CloudFormation action type in CodePipeline, see Configuration Properties Reference in the AWS CloudFormation User Guide . For template snippets with examples, see Using Parameter Override Functions with CodePipeline Pipelines in the AWS CloudFormation User Guide .

The values can be represented in either JSON or YAML format. For example, the JSON configuration item format is as follows:

JSON:

"Configuration" : { Key : Value },

key -> (string)

value -> (string)

outputArtifacts -> (list)

The name or ID of the result of the action declaration, such as a test or build artifact.

(structure)

Represents information about the output of an action.

name -> (string)

The name of the output of an artifact, such as “My App”.

The input artifact of an action must exactly match the output artifact declared in a preceding action, but the input artifact does not have to be the next action in strict sequence from the action that provided the output artifact. Actions in parallel can declare different output artifacts, which are in turn consumed by different following actions.

Output artifact names must be unique within a pipeline.

inputArtifacts -> (list)

The name or ID of the artifact consumed by the action, such as a test or build artifact.

(structure)

Represents information about an artifact to be worked on, such as a test or build artifact.

name -> (string)

The name of the artifact to be worked on (for example, “My App”).

The input artifact of an action must exactly match the output artifact declared in a preceding action, but the input artifact does not have to be the next action in strict sequence from the action that provided the output artifact. Actions in parallel can declare different output artifacts, which are in turn consumed by different following actions.

roleArn -> (string)

The ARN of the IAM service role that performs the declared action. This is assumed through the roleArn for the pipeline.

region -> (string)

The action declaration’s AWS Region, such as us-east-1.

namespace -> (string)

The variable namespace associated with the action. All variables produced as output by this action fall under this namespace.

version -> (integer)

The version number of the pipeline. A new pipeline always has a version number of 1. This number is incremented when a pipeline is updated.

JSON Syntax:

{
  "name": "string",
  "roleArn": "string",
  "artifactStore": {
    "type": "S3",
    "location": "string",
    "encryptionKey": {
      "id": "string",
      "type": "KMS"
    }
  },
  "artifactStores": {"string": {
        "type": "S3",
        "location": "string",
        "encryptionKey": {
          "id": "string",
          "type": "KMS"
        }
      }
    ...},
  "stages": [
    {
      "name": "string",
      "blockers": [
        {
          "name": "string",
          "type": "Schedule"
        }
        ...
      ],
      "actions": [
        {
          "name": "string",
          "actionTypeId": {
            "category": "Source"|"Build"|"Deploy"|"Test"|"Invoke"|"Approval",
            "owner": "AWS"|"ThirdParty"|"Custom",
            "provider": "string",
            "version": "string"
          },
          "runOrder": integer,
          "configuration": {"string": "string"
            ...},
          "outputArtifacts": [
            {
              "name": "string"
            }
            ...
          ],
          "inputArtifacts": [
            {
              "name": "string"
            }
            ...
          ],
          "roleArn": "string",
          "region": "string",
          "namespace": "string"
        }
        ...
      ]
    }
    ...
  ],
  "version": integer
}

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command’s default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination.

--output (string)

The formatting style for command output.

  • json

  • text

  • table

  • yaml

  • yaml-stream

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on

  • off

  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

--cli-binary-format (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.

  • base64

  • raw-in-base64-out

--no-cli-pager (boolean)

Disable cli pager for output.

--cli-auto-prompt (boolean)

Automatically prompt for CLI input parameters.

--no-cli-auto-prompt (boolean)

Disable automatically prompt for CLI input parameters.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

To update the structure of a pipeline

This example uses the update-pipeline command with the –cli-input-json argument. This example uses a pre-defined JSON file (MyFirstPipeline.json) to update the structure of a pipeline. AWS CodePipeline recognizes the pipeline name contained in the JSON file, and then applies any changes from modified fields in the pipeline structure to update the pipeline.

Use the following guidelines when creating the pre-defined JSON file:

  • If you are working with a pipeline structure retrieved using the get-pipeline command, you must remove the metadata section from the pipeline structure in the JSON file (the “metadata”: { } lines and the “created,” “pipelineARN,” and “updated” fields within).

  • The pipeline name cannot be changed.

Command:

aws codepipeline update-pipeline --cli-input-json file://MyFirstPipeline.json

Sample JSON file contents:

{
 "pipeline": {
  "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service",
  "stages": [
    {
      "name": "Source",
      "actions": [
        {
          "inputArtifacts": [],
          "name": "Source",
          "actionTypeId": {
            "category": "Source",
            "owner": "AWS",
            "version": "1",
            "provider": "S3"
          },
          "outputArtifacts": [
            {
              "name": "MyApp"
            }
          ],
          "configuration": {
            "S3Bucket": "awscodepipeline-demo-bucket2",
            "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip"
          },
          "runOrder": 1
        }
      ]
    },
    {
      "name": "Beta",
      "actions": [
        {
          "inputArtifacts": [
            {
              "name": "MyApp"
            }
          ],
          "name": "CodePipelineDemoFleet",
          "actionTypeId": {
            "category": "Deploy",
            "owner": "AWS",
            "version": "1",
            "provider": "CodeDeploy"
          },
          "outputArtifacts": [],
          "configuration": {
            "ApplicationName": "CodePipelineDemoApplication",
            "DeploymentGroupName": "CodePipelineDemoFleet"
          },
          "runOrder": 1
        }
      ]
    }
  ],
  "artifactStore": {
    "type": "S3",
    "location": "codepipeline-us-east-1-11EXAMPLE11"
  },
  "name": "MyFirstPipeline",
  "version": 1
 }
}

Output:

{
 "pipeline": {
  "artifactStore": {
    "location": "codepipeline-us-east-1-11EXAMPLE11",
    "type": "S3"
  },
  "name": "MyFirstPipeline",
  "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service",
  "stages": [
    {
      "actions": [
        {
          "actionTypeId": {
            "__type": "ActionTypeId",
            "category": "Source",
            "owner": "AWS",
            "provider": "S3",
            "version": "1"
          },
          "configuration": {
            "S3Bucket": "awscodepipeline-demo-bucket2",
            "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip"
          },
          "inputArtifacts": [],
          "name": "Source",
          "outputArtifacts": [
            {
              "name": "MyApp"
            }
          ],
          "runOrder": 1
        }
      ],
      "name": "Source"
    },
    {
      "actions": [
        {
          "actionTypeId": {
            "__type": "ActionTypeId",
            "category": "Deploy",
            "owner": "AWS",
            "provider": "CodeDeploy",
            "version": "1"
          },
          "configuration": {
            "ApplicationName": "CodePipelineDemoApplication",
            "DeploymentGroupName": "CodePipelineDemoFleet"
          },
          "inputArtifacts": [
            {
              "name": "MyApp"
            }
          ],
          "name": "CodePipelineDemoFleet",
          "outputArtifacts": [],
          "runOrder": 1
        }
      ],
      "name": "Beta"
    }
  ],
  "version": 3
 }
}

Output

pipeline -> (structure)

The structure of the updated pipeline.

name -> (string)

The name of the pipeline.

roleArn -> (string)

The Amazon Resource Name (ARN) for AWS CodePipeline to use to either perform actions with no actionRoleArn , or to use to assume roles for actions with an actionRoleArn .

artifactStore -> (structure)

Represents information about the S3 bucket where artifacts are stored for the pipeline.

Note

You must include either artifactStore or artifactStores in your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must use artifactStores .

type -> (string)

The type of the artifact store, such as S3.

location -> (string)

The S3 bucket used for storing the artifacts for a pipeline. You can specify the name of an S3 bucket but not a folder in the bucket. A folder to contain the pipeline artifacts is created for you based on the name of the pipeline. You can use any S3 bucket in the same AWS Region as the pipeline to store your pipeline artifacts.

encryptionKey -> (structure)

The encryption key used to encrypt the data in the artifact store, such as an AWS Key Management Service (AWS KMS) key. If this is undefined, the default key for Amazon S3 is used.

id -> (string)

The ID used to identify the key. For an AWS KMS key, you can use the key ID, the key ARN, or the alias ARN.

Note

Aliases are recognized only in the account that created the customer master key (CMK). For cross-account actions, you can only use the key ID or key ARN to identify the key.

type -> (string)

The type of encryption key, such as an AWS Key Management Service (AWS KMS) key. When creating or updating a pipeline, the value must be set to ‘KMS’.

artifactStores -> (map)

A mapping of artifactStore objects and their corresponding AWS Regions. There must be an artifact store for the pipeline Region and for each cross-region action in the pipeline.

Note

You must include either artifactStore or artifactStores in your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must use artifactStores .

key -> (string)

value -> (structure)

The S3 bucket where artifacts for the pipeline are stored.

Note

You must include either artifactStore or artifactStores in your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must use artifactStores .

type -> (string)

The type of the artifact store, such as S3.

location -> (string)

The S3 bucket used for storing the artifacts for a pipeline. You can specify the name of an S3 bucket but not a folder in the bucket. A folder to contain the pipeline artifacts is created for you based on the name of the pipeline. You can use any S3 bucket in the same AWS Region as the pipeline to store your pipeline artifacts.

encryptionKey -> (structure)

The encryption key used to encrypt the data in the artifact store, such as an AWS Key Management Service (AWS KMS) key. If this is undefined, the default key for Amazon S3 is used.

id -> (string)

The ID used to identify the key. For an AWS KMS key, you can use the key ID, the key ARN, or the alias ARN.

Note

Aliases are recognized only in the account that created the customer master key (CMK). For cross-account actions, you can only use the key ID or key ARN to identify the key.

type -> (string)

The type of encryption key, such as an AWS Key Management Service (AWS KMS) key. When creating or updating a pipeline, the value must be set to ‘KMS’.

stages -> (list)

The stage in which to perform the action.

(structure)

Represents information about a stage and its definition.

name -> (string)

The name of the stage.

blockers -> (list)

Reserved for future use.

(structure)

Reserved for future use.

name -> (string)

Reserved for future use.

type -> (string)

Reserved for future use.

actions -> (list)

The actions included in a stage.

(structure)

Represents information about an action declaration.

name -> (string)

The action declaration’s name.

actionTypeId -> (structure)

Specifies the action type and the provider of the action.

category -> (string)

A category defines what kind of action can be taken in the stage, and constrains the provider type for the action. Valid categories are limited to one of the following values.

  • Source

  • Build

  • Test

  • Deploy

  • Invoke

  • Approval

owner -> (string)

The creator of the action being called. There are three valid values for the Owner field in the action category section within your pipeline structure: AWS , ThirdParty , and Custom . For more information, see Valid Action Types and Providers in CodePipeline .

provider -> (string)

The provider of the service being called by the action. Valid providers are determined by the action category. For example, an action in the Deploy category type might have a provider of AWS CodeDeploy, which would be specified as CodeDeploy. For more information, see Valid Action Types and Providers in CodePipeline .

version -> (string)

A string that describes the action version.

runOrder -> (integer)

The order in which actions are run.

configuration -> (map)

The action’s configuration. These are key-value pairs that specify input values for an action. For more information, see Action Structure Requirements in CodePipeline . For the list of configuration properties for the AWS CloudFormation action type in CodePipeline, see Configuration Properties Reference in the AWS CloudFormation User Guide . For template snippets with examples, see Using Parameter Override Functions with CodePipeline Pipelines in the AWS CloudFormation User Guide .

The values can be represented in either JSON or YAML format. For example, the JSON configuration item format is as follows:

JSON:

"Configuration" : { Key : Value },

key -> (string)

value -> (string)

outputArtifacts -> (list)

The name or ID of the result of the action declaration, such as a test or build artifact.

(structure)

Represents information about the output of an action.

name -> (string)

The name of the output of an artifact, such as “My App”.

The input artifact of an action must exactly match the output artifact declared in a preceding action, but the input artifact does not have to be the next action in strict sequence from the action that provided the output artifact. Actions in parallel can declare different output artifacts, which are in turn consumed by different following actions.

Output artifact names must be unique within a pipeline.

inputArtifacts -> (list)

The name or ID of the artifact consumed by the action, such as a test or build artifact.

(structure)

Represents information about an artifact to be worked on, such as a test or build artifact.

name -> (string)

The name of the artifact to be worked on (for example, “My App”).

The input artifact of an action must exactly match the output artifact declared in a preceding action, but the input artifact does not have to be the next action in strict sequence from the action that provided the output artifact. Actions in parallel can declare different output artifacts, which are in turn consumed by different following actions.

roleArn -> (string)

The ARN of the IAM service role that performs the declared action. This is assumed through the roleArn for the pipeline.

region -> (string)

The action declaration’s AWS Region, such as us-east-1.

namespace -> (string)

The variable namespace associated with the action. All variables produced as output by this action fall under this namespace.

version -> (integer)

The version number of the pipeline. A new pipeline always has a version number of 1. This number is incremented when a pipeline is updated.