Skip to content

Commit

Permalink
feat(ecs): introduce a new Image type, TagParameterContainerImage, me…
Browse files Browse the repository at this point in the history
…ant to be used in CodePipeline

While CDK Pipelines is the idiomatic way of deploying ECS applications in CDK,
it does not handle the case where the application's source code is kept in a separate source code repository from the CDK infrastructure code.
This adds a new class to the ECS module,
`TagParameterContainerImage`, that allows deploying a service managed that way through CodePipeline.

Related to aws#1237
Related to aws#7746
  • Loading branch information
skinny85 committed Nov 30, 2020
1 parent 2f0a598 commit 1b4a2a6
Show file tree
Hide file tree
Showing 6 changed files with 2,226 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/@aws-cdk/aws-codepipeline-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ directly from a CodeCommit repository, with a manual approval step in between to
See [the AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline.html)
for more details about using CloudFormation in CodePipeline.

##### Actions defined by this package
#### Available actions

This package defines the following actions:
This package contains the following CloudFormation actions:

* **CloudFormationCreateUpdateStackAction** - Deploy a CloudFormation template directly from the pipeline. The indicated stack is created,
or updated if it already exists. If the stack is in a failure state, deployment will fail (unless `replaceOnFailure`
Expand All @@ -523,7 +523,7 @@ This package defines the following actions:
changes from the people (or system) applying the changes.
* **CloudFormationExecuteChangeSetAction** - Execute a change set prepared previously.

##### Lambda deployed through CodePipeline
#### Lambda deployed through CodePipeline

If you want to deploy your Lambda through CodePipeline,
and you don't use assets (for example, because your CDK code and Lambda code are separate),
Expand Down Expand Up @@ -654,6 +654,18 @@ const deployStage = pipeline.addStage({

[image definition file]: https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html#pipelines-create-image-definitions

#### Deploying ECS applications stored in a separate source code repository

The idiomatic CDK way of deploying an ECS application is to have their Docker files and the CDK code residing in the same source code repository,
leveraging [Docker Assets])(https://docs.aws.amazon.com/cdk/latest/guide/assets.html#assets_types_docker),
and use the [CDK Pipelines module](https://docs.aws.amazon.com/cdk/api/latest/docs/pipelines-readme.html).

However, if you want to deploy a Docker application whose source code is kept in a separate version control repository than the CDK code,
you can use the `TagParameterContainerImage` class from the ECS module.
Here's an example:

[example ECS pipeline for an application in a separate source code repository](test/integ.pipeline-ecs-separate-source.lit.ts)

### AWS S3

To use an S3 Bucket as a deployment target in CodePipeline:
Expand Down
Loading

0 comments on commit 1b4a2a6

Please sign in to comment.