From a9cb286154a5cc00f7cd4230d2fea9a5516c1429 Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Fri, 7 Mar 2025 15:43:01 +0530 Subject: [PATCH 01/13] Add placeholder --- .../coverage/coverage_codepipeline/index.md | 1 - content/en/user-guide/aws/codepipeline/index.md | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 content/en/user-guide/aws/codepipeline/index.md diff --git a/content/en/references/coverage/coverage_codepipeline/index.md b/content/en/references/coverage/coverage_codepipeline/index.md index b4c1041db4..0620c93229 100644 --- a/content/en/references/coverage/coverage_codepipeline/index.md +++ b/content/en/references/coverage/coverage_codepipeline/index.md @@ -4,7 +4,6 @@ linkTitle: "codepipeline" description: > Implementation details for API codepipeline hide_readingtime: true -draft: true --- ## Coverage Overview diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md new file mode 100644 index 0000000000..763adfcd16 --- /dev/null +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -0,0 +1,16 @@ +--- +title: CodePipeline +linkTitle: CodePipeline +description: > + Get started with CodePipeline on LocalStack +tags: ["Pro image"] +--- + +## Introduction + + +## Getting Started + + +## Limitations + From 6db45368b5c0a2cf62ea231a39b1d39952a4a4be Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Mon, 10 Mar 2025 18:00:48 +0530 Subject: [PATCH 02/13] Add placeholder content --- content/en/user-guide/aws/codepipeline/index.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index 763adfcd16..35b086d5f4 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -8,9 +8,24 @@ tags: ["Pro image"] ## Introduction +CodePipeline is a continuous integration/continuous delivery (CI/CD) service offered by AWS. +CodePipeline can be used to create automated pipelines that handle the build, test and deployment of software. + +With LocalStack, you can ... + ## Getting Started +## Actions + +LocalStack supports following actions + +| Type | Name | +| ---- | ---- | +| Source | [Amazon S3](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3.html) | + ## Limitations +- [V2 pipeline types](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html) are not supported +- [Rollbacks and stage retries](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-stages.html) is not available From eb0444c4f5a900bf58e5e7d2c841831a2321eb55 Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Wed, 23 Apr 2025 19:12:47 +0530 Subject: [PATCH 03/13] Update --- .../en/user-guide/aws/codepipeline/index.md | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index 35b086d5f4..a5e6b6c3a0 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -11,21 +11,39 @@ tags: ["Pro image"] CodePipeline is a continuous integration/continuous delivery (CI/CD) service offered by AWS. CodePipeline can be used to create automated pipelines that handle the build, test and deployment of software. -With LocalStack, you can ... - +With LocalStack, you can create, manage and execute pipelines. +CodePipeline on LocalStack support a variety of actions that integrate with S3, CodeBuild and CodeConnections. ## Getting Started + ## Actions -LocalStack supports following actions +CodePipeline on LocalStack supports the following actions: + +### S3 Source + +The [S3 Source](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3.html) action is used to specify an S3 bucket object as input to the pipeline. + +### S3 Deploy + +The [S3 Deploy](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3Deploy.html) action is used to upload artifacts to a given S3 bucket as the output of the pipeline. + +### CodeConnections Source + +The [CodeConnections Source](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html) action is used to specify a VCS repo as the input to the pipeline. + +Currently LocalStack supports integration with [GitHub](https://github.com/). +Please set the environment configuration option `CODEPIPELINE_GH_TOKEN` with the GitHub Personal Access Token to be able to fetch private repositories. + +### CodeBuild Source and Test -| Type | Name | -| ---- | ---- | -| Source | [Amazon S3](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3.html) | +The [CodeBuild Source and Test](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeBuild.html) action can be used to start a CodeBuild container and run the given buildspec. ## Limitations -- [V2 pipeline types](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html) are not supported -- [Rollbacks and stage retries](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-stages.html) is not available +- [V2 pipeline types](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html) are not supported. +- [Rollbacks and stage retries](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-stages.html) are not available. +- [Triggers](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-triggers.html) are not implemented. + Pipelines are executed only when [CreatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html) and [StartPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StartPipelineExecution.html) are invoked. From 562b13f67d3b80d35be6d5e58accfcca42d168f3 Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Wed, 23 Apr 2025 19:51:14 +0530 Subject: [PATCH 04/13] Update --- .../en/user-guide/aws/codepipeline/index.md | 189 +++++++++++++++++- 1 file changed, 184 insertions(+), 5 deletions(-) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index a5e6b6c3a0..82d995b1ae 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -11,11 +11,190 @@ tags: ["Pro image"] CodePipeline is a continuous integration/continuous delivery (CI/CD) service offered by AWS. CodePipeline can be used to create automated pipelines that handle the build, test and deployment of software. -With LocalStack, you can create, manage and execute pipelines. -CodePipeline on LocalStack support a variety of actions that integrate with S3, CodeBuild and CodeConnections. - -## Getting Started - +LocalStack comes with a bespoke execution engine that can be used to create, manage and execute pipelines. +It supports a variety of actions that integrate with S3, CodeBuild, CodeConnections and more. +The available operations can be found on the [API coverage](https://docs.localstack.cloud/references/coverage/coverage_codepipeline/) page. + +## Getting started + +This guide is for users that are new to IoT and assumes a basic knowledge of the AWS CLI and LocalStack [`awslocal`](https://github.com/localstack/awscli-local) wrapper. + +Start LocalStack using your preferred method. + +In this guide, we will create a simple pipeline that fetches an object from an S3 bucket and uploads it to a different S3 bucket. + +### Create prerequisite buckets + +Start by creating the S3 buckets that will serve as the source and target. + +{{< command >}} +$ awslocal s3 mb s3://source-bucket +$ awslocal s3 mb s3://target-bucket +{{< / command >}} + +It is important to note the CodePipeline requires source S3 buckets to have versioning enabled. +This can be done using the S3 [PutBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) operation. + +{{< command >}} +$ awslocal s3api put-bucket-versioning \ + --bucket source-bucket \ + --versioning-configuration Status=Enabled +{{< /command >}} + +Now create a placeholder file that will flow through the pipeline and upload it to the source bucket. + +{{< command >}} +$ echo "Hello LocalStack!" > file +{{< /command >}} + +{{< command >}} +$ awslocal s3 cp file s3://source-bucket + +upload: ./file to s3://source-bucket/file + +{{< /command >}} + +Pipelines also require an artifact store, which is also an S3 bucket that is used as intermediate storage. + +{{< command >}} +$ awslocal s3 mb s3://artifact-store-bucket +{{< / command >}} + +### Configure IAM + +Depending on the specifics of the declaration, CodePipeline pipelines need access other AWS services. +In this case we want our pipeline to retrieve and upload files to S3. +This requires a properly configured IAM role that our pipeline can assume. + +Create the role as follows: + +```json +# role.json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "codepipeline.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] +} +``` + +{{< command >}} +$ awslocal iam create-role --role-name role --assume-role-policy-document file://role.json +{{< /command >}} + +Now add a permissions policy to this role that permits read and write access to S3. + +```json +# policy.json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "s3:*", + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:PassRole" + ], + "Resource": "*" + } + ] +} +``` + +The permissions in the above example policy are relatively broad. +You might want to use a more focused policy for better security. + +{{< command >}} +$ awslocal iam put-role-policy --role-name role --policy-name policy --policy-document file://policy.json +{{< /command >}} + +### Create pipeline + +Now we can turn our attention to the pipeline declaration. + +```json +{ + "name": "pipeline", + "executionMode": "SUPERSEDED", + "pipelineType": "V1", + "roleArn": "", + "artifactStore": { + "type": "S3", + "location": "" + }, + "version": 1, + "stages": [ + { + "name": "stage1", + "actions": [ + { + "name": "action1", + "actionTypeId": { + "category": "Source", + "owner": "AWS", + "provider": "S3", + "version": "1" + }, + "runOrder": 1, + "configuration": { + "S3Bucket": "", + "S3ObjectKey": "", + "PollForSourceChanges": "false" + }, + "outputArtifacts": [ + { + "name": "intermediate-artifact-file" + } + ], + "inputArtifacts": [] + } + ] + }, + { + "name": "stage2", + "actions": [ + { + "name": "action1", + "actionTypeId": { + "category": "Deploy", + "owner": "AWS", + "provider": "S3", + "version": "1" + }, + "runOrder": 1, + "configuration": { + "BucketName": "", + "Extract": "false", + "ObjectKey": "output-artifact-file" + }, + "inputArtifacts": [ + { + "name": "intermediate-artifact-file" + } + ], + "outputArtifacts": [] + } + ] + } + ] +} +``` + +## Tips + +- Use `runOrder` ## Actions From 00ea9be92d0a900058e75c2d944f80877d8ecac7 Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Thu, 24 Apr 2025 15:49:22 +0530 Subject: [PATCH 05/13] Update --- .../en/user-guide/aws/codepipeline/index.md | 236 +++++++++++++++--- 1 file changed, 207 insertions(+), 29 deletions(-) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index 82d995b1ae..f44c853d49 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -17,15 +17,14 @@ The available operations can be found on the [API coverage](https://docs.localst ## Getting started -This guide is for users that are new to IoT and assumes a basic knowledge of the AWS CLI and LocalStack [`awslocal`](https://github.com/localstack/awscli-local) wrapper. +In this guide, we will create a simple pipeline that fetches an object from an S3 bucket and uploads it to a different S3 bucket. +It is for users that are new to CodePipeline and have a basic knowledge of the AWS CLI and the [`awslocal`](https://github.com/localstack/awscli-local) wrapper. Start LocalStack using your preferred method. -In this guide, we will create a simple pipeline that fetches an object from an S3 bucket and uploads it to a different S3 bucket. - ### Create prerequisite buckets -Start by creating the S3 buckets that will serve as the source and target. +Begin by creating the S3 buckets that will serve as the source and target. {{< command >}} $ awslocal s3 mb s3://source-bucket @@ -66,7 +65,7 @@ Depending on the specifics of the declaration, CodePipeline pipelines need acces In this case we want our pipeline to retrieve and upload files to S3. This requires a properly configured IAM role that our pipeline can assume. -Create the role as follows: +Create the role and make note of the role ARN: ```json # role.json @@ -85,7 +84,10 @@ Create the role as follows: ``` {{< command >}} -$ awslocal iam create-role --role-name role --assume-role-policy-document file://role.json +$ awslocal iam create-role --role-name role --assume-role-policy-document file://role.json | jq .Role.Arn + +"arn:aws:iam::000000000000:role/role" + {{< /command >}} Now add a permissions policy to this role that permits read and write access to S3. @@ -98,7 +100,7 @@ Now add a permissions policy to this role that permits read and write access to { "Effect": "Allow", "Action": [ - "s3:*", + "s3:*" ], "Resource": "*" }, @@ -114,7 +116,7 @@ Now add a permissions policy to this role that permits read and write access to ``` The permissions in the above example policy are relatively broad. -You might want to use a more focused policy for better security. +You might want to use a more focused policy for better security on production systems. {{< command >}} $ awslocal iam put-role-policy --role-name role --policy-name policy --policy-document file://policy.json @@ -124,15 +126,25 @@ $ awslocal iam put-role-policy --role-name role --policy-name policy --policy-do Now we can turn our attention to the pipeline declaration. -```json +A pipeline declaration is used to define the structure of actions and stages to be performed. +The following pipeline defines two stages with one action each. +There is a source action which retrieves a file from an S3 bucket and marks it as the output. +The output is placed in the intermediate bucket until it is picked up by the action in the second stage. +This is a deploy action which uploads the file to the target bucket. + +Pay special attention to `roleArn`, `artifactStore.location` as well as `S3Bucket`, `S3ObjectKey`, and `BucketName`. +These correspond to the resources we created earlier. + +```json {hl_lines=[6,9,26,27,52]} +# declaration.json { "name": "pipeline", "executionMode": "SUPERSEDED", "pipelineType": "V1", - "roleArn": "", + "roleArn": "arn:aws:iam::000000000000:role/role", "artifactStore": { "type": "S3", - "location": "" + "location": "artifact-store-bucket" }, "version": 1, "stages": [ @@ -149,13 +161,13 @@ Now we can turn our attention to the pipeline declaration. }, "runOrder": 1, "configuration": { - "S3Bucket": "", - "S3ObjectKey": "", + "S3Bucket": "source-bucket", + "S3ObjectKey": "file", "PollForSourceChanges": "false" }, "outputArtifacts": [ { - "name": "intermediate-artifact-file" + "name": "intermediate-file" } ], "inputArtifacts": [] @@ -175,13 +187,13 @@ Now we can turn our attention to the pipeline declaration. }, "runOrder": 1, "configuration": { - "BucketName": "", + "BucketName": "target-bucket", "Extract": "false", - "ObjectKey": "output-artifact-file" + "ObjectKey": "output-file" }, "inputArtifacts": [ { - "name": "intermediate-artifact-file" + "name": "intermediate-file" } ], "outputArtifacts": [] @@ -192,37 +204,203 @@ Now we can turn our attention to the pipeline declaration. } ``` -## Tips +Create the pipeline using the following command: -- Use `runOrder` +{{< command >}} +$ awslocal codepipeline create-pipeline --pipeline file://./declaration.json +{{< /command >}} +### Verify pipeline execution -## Actions +A 'pipeline execution' is an instance of a pipeline in running or finished state. -CodePipeline on LocalStack supports the following actions: +The CreatePipeline operation we ran earlier started a pipeline execution. +This can be confirmed using: -### S3 Source +{{< command >}} +$ awslocal codepipeline list-pipeline-executions --pipeline-name pipeline + +{ + "pipelineExecutionSummaries": [ + { + "pipelineExecutionId": "37e8eb2e-0ed9-447a-a016-8dbbd796bfe7", + "status": "Succeeded", + "startTime": 1745486647.138571, + "lastUpdateTime": 1745486648.290341, + "trigger": { + "triggerType": "CreatePipeline" + }, + "executionMode": "SUPERSEDED" + } + ] +} + +{{< /command >}} -The [S3 Source](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3.html) action is used to specify an S3 bucket object as input to the pipeline. +Note the `trigger.triggerType` field specifies what initiated the pipeline execution. +Currently in LocalStack, only two triggers are implemented: `CreatePipeline` and `StartPipelineExecution`. -### S3 Deploy +The above pipeline execution was successful. +This means that we can retrieve the `output-file` object from the `target-bucket` S3 bucket. -The [S3 Deploy](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3Deploy.html) action is used to upload artifacts to a given S3 bucket as the output of the pipeline. +{{< command >}} +$ awslocal s3 cp s3://target-bucket/output-file output-file + +download: s3://target-bucket/output-file to ./output-file + +{{< /command >}} + +To verify that it is the same file as the original input: + +{{< command >}} +$ cat output-file + +Hello LocalStack! + +{{< /command >}} + +### Examine action executions + +Using the [ListActionExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html), detailed information about each action execution such as inputs and outputs can be retrieved. +This is useful when debugging the pipeline. + +{{< command >}} +$ awslocal codepipeline list-action-executions --pipeline-name pipeline + +{ + "actionExecutionDetails": [ + { + "pipelineExecutionId": "37e8eb2e-0ed9-447a-a016-8dbbd796bfe7", + "actionExecutionId": "e38716df-645e-43ce-9597-104735c7f92c", + "pipelineVersion": 1, + "stageName": "stage2", + "actionName": "action1", + "startTime": 1745486647.269867, + "lastUpdateTime": 1745486647.289813, + "status": "Succeeded", + "input": { + "actionTypeId": { + "category": "Deploy", + "owner": "AWS", + "provider": "S3", + "version": "1" + }, + "configuration": { + "BucketName": "target-bucket", + "Extract": "false", + "ObjectKey": "output-file" + }, + "resolvedConfiguration": { + "BucketName": "target-bucket", + "Extract": "false", + "ObjectKey": "output-file" + }, + "region": "eu-central-1", + "inputArtifacts": [ + { + "name": "intermediate-file", + "s3location": { + "bucket": "artifact-store-bucket", + "key": "pipeline/intermediate-file/01410aa4.zip" + } + } + ] + }, + "output": { + "outputArtifacts": [], + "executionResult": { + "externalExecutionId": "bcff0781", + "externalExecutionSummary": "Deployment Succeeded" + }, + "outputVariables": {} + } + }, + { + "pipelineExecutionId": "37e8eb2e-0ed9-447a-a016-8dbbd796bfe7", + "actionExecutionId": "ae99095a-1d43-46ee-8a48-c72b6d60021e", + "pipelineVersion": 1, + "stageName": "stage1", + "actionName": "action1", + ... + +{{< /command >}} + +## Pipelines + +The operations [CreatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html), [GetPipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_GetPipeline.html), [UpdatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_UpdatePipeline.html), [ListPipelines](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelines.html), [DeletePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_DeletePipeline.html) are used to manage pipeline declarations. + +Pipeline executions can be managed with [StartPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StartPipelineExecution.html), [GetPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_GetPipelineExecution.html), [ListPipelineExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) and [StopPipelineExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StopPipelineExecution.html). + +Action executions can be inspected using the [ListActionExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) operation. + +LocalStack supports emulation for V1 pipelines. +V2 pipelines are only created as mocks. + +You can use `runOrder` + +When stopping pipeline executions with StopPipelineExecution, the stop and abandon method is not supported. +Setting the `abandon` flag will have no impact. +This is because LocalStack uses threads as the underlying mechanism to simulate pipelines, and threads can not be cleanly preempted. + +### Tagging pipelines + +LocalStack also supports [resources tagging for pipelines](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-tag.html) using the [TagResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_TagResource.html), [UntagResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_UntagResource.html) and [ListTagsForResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListTagsForResource.html) operations. + +{{< command >}} +$ awslocal codepipeline tag-resource \ + --resource-arn arn:aws:codepipeline:eu-central-1:000000000000:pipeline \ + --tags key=purpose,value=tutorial + +$ awslocal codepipeline list-tags-for-resource \ + --resource-arn arn:aws:codepipeline:eu-central-1:000000000000:pipeline +{ + "tags": [ + { + "key": "purpose", + "value": "tutorial" + } + ] +} + +$ awslocal codepipeline untag-resource \ + --resource-arn arn:aws:codepipeline:eu-central-1:000000000000:pipeline \ + --tag-keys purpose +{{< /command >}} + + +## Stages + +## Variables + +## Actions + +CodePipeline on LocalStack supports the following actions: + +### CodeBuild Source and Test + +The [CodeBuild Source and Test](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeBuild.html) action can be used to start a CodeBuild container and run the given buildspec. ### CodeConnections Source The [CodeConnections Source](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html) action is used to specify a VCS repo as the input to the pipeline. -Currently LocalStack supports integration with [GitHub](https://github.com/). +LocalStack supports integration only with [GitHub](https://github.com/) at this time. Please set the environment configuration option `CODEPIPELINE_GH_TOKEN` with the GitHub Personal Access Token to be able to fetch private repositories. -### CodeBuild Source and Test +### S3 Deploy -The [CodeBuild Source and Test](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeBuild.html) action can be used to start a CodeBuild container and run the given buildspec. +The [S3 Deploy](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3Deploy.html) action is used to upload artifacts to a given S3 bucket as the output of the pipeline. + +### S3 Source + +The [S3 Source](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3.html) action is used to specify an S3 bucket object as input to the pipeline. ## Limitations -- [V2 pipeline types](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html) are not supported. +- Emulation for [V2 pipeline types](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html) is not supported. They will be created as mocks only. - [Rollbacks and stage retries](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-stages.html) are not available. - [Triggers](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-triggers.html) are not implemented. Pipelines are executed only when [CreatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html) and [StartPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StartPipelineExecution.html) are invoked. +- [Execution mode behaviours](https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts-how-it-works.html#concepts-how-it-works-executions) are not implemented. Therefore parallel pipeline executions will not lead to stage locks and waits. +- [Stage transition controls](https://docs.aws.amazon.com/codepipeline/latest/userguide/transitions.html) are not implemented. +- [Manual approval action](https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals-action-add.html) and [PutApprovalResult](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PutApprovalResult.html) operation is not available. From 6d3e05f41241fed7c9d03cc5366b8de704d03434 Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Thu, 24 Apr 2025 16:02:16 +0530 Subject: [PATCH 06/13] Update --- content/en/references/configuration.md | 6 ++++++ content/en/user-guide/aws/codepipeline/index.md | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/content/en/references/configuration.md b/content/en/references/configuration.md index c8ee8e1209..67fb4b7f90 100644 --- a/content/en/references/configuration.md +++ b/content/en/references/configuration.md @@ -125,6 +125,12 @@ This section covers configuration options that are specific to certain AWS servi | - | - | - | | `PROVIDER_OVERRIDE_CLOUDWATCH` | `v1` | Use the old CloudWatch provider. | +### CodePipeline + +| Variable | Example Values | Description | +| - | - | - | +| `CODEPIPELINE_GH_TOKEN` | | GitHub Personal Access Token to used by CodeConnections Source action to access private repositories on GitHub. | + ### DMS | Variable | Example Values | Description | diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index f44c853d49..f5f14f14ab 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -367,7 +367,6 @@ $ awslocal codepipeline untag-resource \ --tag-keys purpose {{< /command >}} - ## Stages ## Variables From d528ab32e1076fa9535dd9bd65c985977b6b95fa Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Thu, 24 Apr 2025 16:33:11 +0530 Subject: [PATCH 07/13] Update --- .../en/user-guide/aws/codepipeline/index.md | 215 ++++++++++-------- 1 file changed, 118 insertions(+), 97 deletions(-) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index f5f14f14ab..1b39d781f0 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -70,16 +70,16 @@ Create the role and make note of the role ARN: ```json # role.json { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "codepipeline.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "codepipeline.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] } ``` @@ -95,23 +95,16 @@ Now add a permissions policy to this role that permits read and write access to ```json # policy.json { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "s3:*" - ], - "Resource": "*" - }, - { - "Effect": "Allow", - "Action": [ - "iam:PassRole" - ], - "Resource": "*" - } - ] + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "s3:*" + ], + "Resource": "*" + } + ] } ``` @@ -138,69 +131,69 @@ These correspond to the resources we created earlier. ```json {hl_lines=[6,9,26,27,52]} # declaration.json { - "name": "pipeline", - "executionMode": "SUPERSEDED", - "pipelineType": "V1", - "roleArn": "arn:aws:iam::000000000000:role/role", - "artifactStore": { - "type": "S3", - "location": "artifact-store-bucket" - }, - "version": 1, - "stages": [ - { - "name": "stage1", - "actions": [ - { - "name": "action1", - "actionTypeId": { - "category": "Source", - "owner": "AWS", - "provider": "S3", - "version": "1" - }, - "runOrder": 1, - "configuration": { - "S3Bucket": "source-bucket", - "S3ObjectKey": "file", - "PollForSourceChanges": "false" - }, - "outputArtifacts": [ - { - "name": "intermediate-file" - } - ], - "inputArtifacts": [] - } - ] + "name": "pipeline", + "executionMode": "SUPERSEDED", + "pipelineType": "V1", + "roleArn": "arn:aws:iam::000000000000:role/role", + "artifactStore": { + "type": "S3", + "location": "artifact-store-bucket" }, - { - "name": "stage2", - "actions": [ + "version": 1, + "stages": [ { - "name": "action1", - "actionTypeId": { - "category": "Deploy", - "owner": "AWS", - "provider": "S3", - "version": "1" - }, - "runOrder": 1, - "configuration": { - "BucketName": "target-bucket", - "Extract": "false", - "ObjectKey": "output-file" - }, - "inputArtifacts": [ - { - "name": "intermediate-file" - } - ], - "outputArtifacts": [] + "name": "stage1", + "actions": [ + { + "name": "action1", + "actionTypeId": { + "category": "Source", + "owner": "AWS", + "provider": "S3", + "version": "1" + }, + "runOrder": 1, + "configuration": { + "S3Bucket": "source-bucket", + "S3ObjectKey": "file", + "PollForSourceChanges": "false" + }, + "outputArtifacts": [ + { + "name": "intermediate-file" + } + ], + "inputArtifacts": [] + } + ] + }, + { + "name": "stage2", + "actions": [ + { + "name": "action1", + "actionTypeId": { + "category": "Deploy", + "owner": "AWS", + "provider": "S3", + "version": "1" + }, + "runOrder": 1, + "configuration": { + "BucketName": "target-bucket", + "Extract": "false", + "ObjectKey": "output-file" + }, + "inputArtifacts": [ + { + "name": "intermediate-file" + } + ], + "outputArtifacts": [] + } + ] } - ] - } - ] + ] } ``` @@ -214,7 +207,7 @@ $ awslocal codepipeline create-pipeline --pipeline file://./declaration.json A 'pipeline execution' is an instance of a pipeline in running or finished state. -The CreatePipeline operation we ran earlier started a pipeline execution. +The [CreatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html) operation we ran earlier started a pipeline execution. This can be confirmed using: {{< command >}} @@ -325,26 +318,35 @@ $ awslocal codepipeline list-action-executions --pipeline-name pipeline {{< /command >}} -## Pipelines +{{< callout >}} +LocalStack does not use the same logic to generate external execution IDs as AWS so there may be minor discrepancies. +Same is true for status and error messages produced by actions. +{{< /callout >}} -The operations [CreatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html), [GetPipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_GetPipeline.html), [UpdatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_UpdatePipeline.html), [ListPipelines](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelines.html), [DeletePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_DeletePipeline.html) are used to manage pipeline declarations. -Pipeline executions can be managed with [StartPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StartPipelineExecution.html), [GetPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_GetPipelineExecution.html), [ListPipelineExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) and [StopPipelineExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StopPipelineExecution.html). +## Pipelines -Action executions can be inspected using the [ListActionExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) operation. +The operations [CreatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html), [GetPipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_GetPipeline.html), [UpdatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_UpdatePipeline.html), [ListPipelines](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelines.html), [DeletePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_DeletePipeline.html) are used to manage pipeline declarations. LocalStack supports emulation for V1 pipelines. V2 pipelines are only created as mocks. -You can use `runOrder` +{{< callout "tip" >}} +Emulation for V2 pipelines is not supported. +Make sure that the pipeline type is explicitly set in the declaration. +{{< /callout >}} + +Pipeline executions can be managed with [StartPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StartPipelineExecution.html), [GetPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_GetPipelineExecution.html), [ListPipelineExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) and [StopPipelineExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StopPipelineExecution.html). When stopping pipeline executions with StopPipelineExecution, the stop and abandon method is not supported. Setting the `abandon` flag will have no impact. This is because LocalStack uses threads as the underlying mechanism to simulate pipelines, and threads can not be cleanly preempted. +Action executions can be inspected using the [ListActionExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) operation. + ### Tagging pipelines -LocalStack also supports [resources tagging for pipelines](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-tag.html) using the [TagResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_TagResource.html), [UntagResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_UntagResource.html) and [ListTagsForResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListTagsForResource.html) operations. +Pipelines resources can be [tagged](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-tag.html) using the [TagResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_TagResource.html), [UntagResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_UntagResource.html) and [ListTagsForResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListTagsForResource.html) operations. {{< command >}} $ awslocal codepipeline tag-resource \ @@ -367,13 +369,32 @@ $ awslocal codepipeline untag-resource \ --tag-keys purpose {{< /command >}} -## Stages - ## Variables +CodePipeline on LocalStack supports [variables](https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-variables.html) which allow dynamic configuration of pipeline actions. + +Actions produce output variables which can be referenced in the configuration of subsequent actions. +Make note that only when the action defines a namespace, its output variables are availabe to downstream actions. + +{{< callout "tip" >}} +If an action does not use a namespace, its output variables are not available to downstream actions. +{{< /callout >}} + +CodePipeline's variable placeholder syntax is as follows: + +``` +#{namespace.variable} +``` + +As with AWS, LocalStack only makes the `codepipeline.PipelineExecutionId` variable available by default in a pipeline. + ## Actions -CodePipeline on LocalStack supports the following actions: +You can use [`runOrder`](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-requirements.html#action.runOrder) to control parallel or sequential order of execution of actions. + +The supported actions in LocalStack CodePipeline are listed below. +Using an unsupported action will make the pipeline fail. +If you would like support for more actions, please [raise a feature request](https://github.com/localstack/localstack/issues/new/choose). ### CodeBuild Source and Test From 449fc0c37e3afae13340a699cbfca41c54ab0d8e Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Thu, 24 Apr 2025 16:35:53 +0530 Subject: [PATCH 08/13] Linting --- content/en/user-guide/aws/codepipeline/index.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index 1b39d781f0..aac8c077e5 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -239,14 +239,14 @@ This means that we can retrieve the `output-file` object from the `target-bucket {{< command >}} $ awslocal s3 cp s3://target-bucket/output-file output-file -download: s3://target-bucket/output-file to ./output-file +download: s3://target-bucket/output-file to ./output-file {{< /command >}} To verify that it is the same file as the original input: {{< command >}} -$ cat output-file +$ cat output-file Hello LocalStack! @@ -323,7 +323,6 @@ LocalStack does not use the same logic to generate external execution IDs as AWS Same is true for status and error messages produced by actions. {{< /callout >}} - ## Pipelines The operations [CreatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html), [GetPipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_GetPipeline.html), [UpdatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_UpdatePipeline.html), [ListPipelines](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelines.html), [DeletePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_DeletePipeline.html) are used to manage pipeline declarations. @@ -382,7 +381,7 @@ If an action does not use a namespace, its output variables are not available to CodePipeline's variable placeholder syntax is as follows: -``` +```text #{namespace.variable} ``` @@ -417,10 +416,12 @@ The [S3 Source](https://docs.aws.amazon.com/codepipeline/latest/userguide/action ## Limitations -- Emulation for [V2 pipeline types](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html) is not supported. They will be created as mocks only. +- Emulation for [V2 pipeline types](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html) is not supported. + They will be created as mocks only. - [Rollbacks and stage retries](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-stages.html) are not available. - [Triggers](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-triggers.html) are not implemented. Pipelines are executed only when [CreatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html) and [StartPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StartPipelineExecution.html) are invoked. -- [Execution mode behaviours](https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts-how-it-works.html#concepts-how-it-works-executions) are not implemented. Therefore parallel pipeline executions will not lead to stage locks and waits. +- [Execution mode behaviours](https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts-how-it-works.html#concepts-how-it-works-executions) are not implemented. + Parallel pipeline executions will not lead to stage locks and waits. - [Stage transition controls](https://docs.aws.amazon.com/codepipeline/latest/userguide/transitions.html) are not implemented. - [Manual approval action](https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals-action-add.html) and [PutApprovalResult](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PutApprovalResult.html) operation is not available. From 0bcf2b4eed82368c3c7b28d3e8099cdfbe978f47 Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Thu, 15 May 2025 18:04:38 +0530 Subject: [PATCH 09/13] Add new actions --- .../en/user-guide/aws/codepipeline/index.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index aac8c077e5..3f1d3655f2 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -406,6 +406,25 @@ The [CodeConnections Source](https://docs.aws.amazon.com/codepipeline/latest/use LocalStack supports integration only with [GitHub](https://github.com/) at this time. Please set the environment configuration option `CODEPIPELINE_GH_TOKEN` with the GitHub Personal Access Token to be able to fetch private repositories. +### ECR Source + +The [ECR Source](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-ECR.html) action is used to specify an Elastic Container Registry image as a source artifact. + +### ECS CodeDeploy Blue/Green + +The [ECS CodeDeply Blue/Green](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-ECSbluegreen.html) action is used to deploy container application using a blue/green deployment. + +LocalStack does not accurately emulate a blue/green deployment due to limitations in ELB and ECS. +It will only update the running ECS service with a new task definition and wait for the service to be stable. + +### ECS Deploy + +The [ECS Deploy](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-ECS.html) action creates a revision of a task definition based on an already deployed ECS service. + +### Manual Approval + +The Manual Approval action can be included in the pipeline declaration but it will only function as a no-op. + ### S3 Deploy The [S3 Deploy](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3Deploy.html) action is used to upload artifacts to a given S3 bucket as the output of the pipeline. From 16fa109e0f51bf90b26efc08b9f3cc1bbbac52fc Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Wed, 21 May 2025 13:26:17 +0530 Subject: [PATCH 10/13] Update content/en/user-guide/aws/codepipeline/index.md Co-authored-by: Giovanni Grano --- content/en/user-guide/aws/codepipeline/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index 3f1d3655f2..46887e3bc9 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -443,4 +443,4 @@ The [S3 Source](https://docs.aws.amazon.com/codepipeline/latest/userguide/action - [Execution mode behaviours](https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts-how-it-works.html#concepts-how-it-works-executions) are not implemented. Parallel pipeline executions will not lead to stage locks and waits. - [Stage transition controls](https://docs.aws.amazon.com/codepipeline/latest/userguide/transitions.html) are not implemented. -- [Manual approval action](https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals-action-add.html) and [PutApprovalResult](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PutApprovalResult.html) operation is not available. +- [Manual approval action](https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals-action-add.html) and [PutApprovalResult](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PutApprovalResult.html) operations are not available. From 70e84e524dc5d145996fa17d960fb9db2f3b77d1 Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Wed, 21 May 2025 19:50:49 +0530 Subject: [PATCH 11/13] Use ref shortcode --- content/en/user-guide/aws/codepipeline/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index 46887e3bc9..c5286786e8 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -13,7 +13,7 @@ CodePipeline can be used to create automated pipelines that handle the build, te LocalStack comes with a bespoke execution engine that can be used to create, manage and execute pipelines. It supports a variety of actions that integrate with S3, CodeBuild, CodeConnections and more. -The available operations can be found on the [API coverage](https://docs.localstack.cloud/references/coverage/coverage_codepipeline/) page. +The available operations can be found on the [API coverage]({{< ref "coverage_codepipeline" >}}) page. ## Getting started From e708a6e31e91aaf4cfa0323246c1ee90234bc8a0 Mon Sep 17 00:00:00 2001 From: Viren Nadkarni Date: Fri, 30 May 2025 15:59:20 +0530 Subject: [PATCH 12/13] Update title for coverage page --- content/en/references/coverage/coverage_codepipeline/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/references/coverage/coverage_codepipeline/index.md b/content/en/references/coverage/coverage_codepipeline/index.md index 0620c93229..eb16ddf50c 100644 --- a/content/en/references/coverage/coverage_codepipeline/index.md +++ b/content/en/references/coverage/coverage_codepipeline/index.md @@ -1,6 +1,6 @@ --- -title: "codepipeline" -linkTitle: "codepipeline" +title: "CodePipeline" +linkTitle: "CodePipeline" description: > Implementation details for API codepipeline hide_readingtime: true From c5ddcb09282b6a56613e5dc312db28b2f7145b36 Mon Sep 17 00:00:00 2001 From: Quetzalli Date: Wed, 4 Jun 2025 19:43:47 -0700 Subject: [PATCH 13/13] grammar fixes & syntax highlighting --- .../en/user-guide/aws/codepipeline/index.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/content/en/user-guide/aws/codepipeline/index.md b/content/en/user-guide/aws/codepipeline/index.md index c5286786e8..2fe106686c 100644 --- a/content/en/user-guide/aws/codepipeline/index.md +++ b/content/en/user-guide/aws/codepipeline/index.md @@ -11,8 +11,8 @@ tags: ["Pro image"] CodePipeline is a continuous integration/continuous delivery (CI/CD) service offered by AWS. CodePipeline can be used to create automated pipelines that handle the build, test and deployment of software. -LocalStack comes with a bespoke execution engine that can be used to create, manage and execute pipelines. -It supports a variety of actions that integrate with S3, CodeBuild, CodeConnections and more. +LocalStack comes with a bespoke execution engine that can be used to create, manage, and execute pipelines. +It supports a variety of actions that integrate with S3, CodeBuild, CodeConnections, and more. The available operations can be found on the [API coverage]({{< ref "coverage_codepipeline" >}}) page. ## Getting started @@ -32,7 +32,7 @@ $ awslocal s3 mb s3://target-bucket {{< / command >}} It is important to note the CodePipeline requires source S3 buckets to have versioning enabled. -This can be done using the S3 [PutBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) operation. +This can be done using the S3 [`PutBucketVersioning`](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) operation. {{< command >}} $ awslocal s3api put-bucket-versioning \ @@ -205,9 +205,9 @@ $ awslocal codepipeline create-pipeline --pipeline file://./declaration.json ### Verify pipeline execution -A 'pipeline execution' is an instance of a pipeline in running or finished state. +A 'pipeline execution' is an instance of a pipeline in a running or finished state. -The [CreatePipeline](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html) operation we ran earlier started a pipeline execution. +The [`CreatePipeline`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_CreatePipeline.html) operation we ran earlier started a pipeline execution. This can be confirmed using: {{< command >}} @@ -254,7 +254,7 @@ Hello LocalStack! ### Examine action executions -Using the [ListActionExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html), detailed information about each action execution such as inputs and outputs can be retrieved. +Using the [`ListActionExecutions`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html), detailed information about each action execution such as inputs and outputs can be retrieved. This is useful when debugging the pipeline. {{< command >}} @@ -320,7 +320,7 @@ $ awslocal codepipeline list-action-executions --pipeline-name pipeline {{< callout >}} LocalStack does not use the same logic to generate external execution IDs as AWS so there may be minor discrepancies. -Same is true for status and error messages produced by actions. +The same is true for status and error messages produced by actions. {{< /callout >}} ## Pipelines @@ -335,17 +335,17 @@ Emulation for V2 pipelines is not supported. Make sure that the pipeline type is explicitly set in the declaration. {{< /callout >}} -Pipeline executions can be managed with [StartPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StartPipelineExecution.html), [GetPipelineExecution](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_GetPipelineExecution.html), [ListPipelineExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) and [StopPipelineExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StopPipelineExecution.html). +Pipeline executions can be managed with [`StartPipelineExecution`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StartPipelineExecution.html), [`GetPipelineExecution`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_GetPipelineExecution.html), [`ListPipelineExecutions`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) and [`StopPipelineExecutions`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_StopPipelineExecution.html). -When stopping pipeline executions with StopPipelineExecution, the stop and abandon method is not supported. +When stopping pipeline executions with `StopPipelineExecution`, the stop and abandon method is not supported. Setting the `abandon` flag will have no impact. -This is because LocalStack uses threads as the underlying mechanism to simulate pipelines, and threads can not be cleanly preempted. +This is because LocalStack uses threads as the underlying mechanism to simulate pipelines, and threads cannot be cleanly preempted. -Action executions can be inspected using the [ListActionExecutions](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) operation. +Action executions can be inspected using the [`ListActionExecutions`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListPipelineExecutions.html) operation. ### Tagging pipelines -Pipelines resources can be [tagged](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-tag.html) using the [TagResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_TagResource.html), [UntagResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_UntagResource.html) and [ListTagsForResource](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListTagsForResource.html) operations. +Pipelines resources can be [tagged](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-tag.html) using the [`TagResource`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_TagResource.html), [`UntagResource`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_UntagResource.html) and [`ListTagsForResource`](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_ListTagsForResource.html) operations. {{< command >}} $ awslocal codepipeline tag-resource \