Skip to content

Commit 2bcce74

Browse files
jessieweiyikauflucaEC2 Default User
authored
feat(Pipeline): support usage of CodeConnections as Source step for PDK Pipeline (#920)
* feat: support code connection and remove license build step Added modifications to support code connection. Removed one build step for licenses due to stack trace issues. * fix: dependecy fix depedndency * fix: dependencies why am I so dependant * fixes * removed commands * removed commands * feat: fixed latest - adding codestar * chore: fix the merge conflits * chore: remove extra folder * chore: revert changes * chore: keep the PDKPipeline same as previous * chore: remove the validation * chore: add test cases * chore: rename the construct name to be consistent * chore: update test snapshot --------- Co-authored-by: Lucas <[email protected]> Co-authored-by: EC2 Default User <[email protected]>
1 parent 20d28fe commit 2bcce74

File tree

4 files changed

+10063
-98
lines changed

4 files changed

+10063
-98
lines changed

packages/pipeline/docs/developer_guides/pipeline/index.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CodeCommit repository -> CodePipeline
1414
|-> Secret (sonarqube token)
1515
```
1616

17-
### CDK Nag
17+
## CDK Nag
1818

1919
In order to keep CDK Nag happy, make sure you build the pipeline before synth as per https://github.com/aws/aws-cdk/issues/18440.
2020

@@ -26,9 +26,9 @@ The feature is enabled and configured by setting the `branchNamePrefixes` proper
2626

2727
When your PDKPipeline is run, the current branch will be available in the `BRANCH` environment variable. You can use this to give unique names to the stacks and stages created by that branch. You can also enable and disable stages based on the branch name. For example, you may want the PipelineStack and Dev stage to get created for any branch and only create the Prod stage in the default branch.
2828

29-
### PDKPipeline configuration
29+
## PDKPipeline configuration
3030

31-
#### Example: All Branches
31+
### Example: All Branches
3232

3333
pipeline-stack.ts
3434

@@ -40,7 +40,7 @@ this.pipeline = new PDKPipeline(this, "ApplicationPipeline", {
4040
});
4141
```
4242

43-
#### Example: Branches starting with "feature/" or "fix/"
43+
### Example: Branches starting with "feature/" or "fix/"
4444

4545
pipeline-stack.ts
4646

@@ -89,3 +89,24 @@ if (PDKPipeline.isDefaultBranch({ node: app.node })) {
8989
pipelineStack.pipeline.addStage(prodStage);
9090
}
9191
```
92+
93+
## PDKPipeline with CodeConnections as source
94+
95+
The PDKPipelineWithCodeConnection construct provides an alternative source option for your PDKPipeline. This feature allows you to leverage existing third-party git repositories through [CodeConnections](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html), enabling you to build your PDKPipeline using external source code repositories as pipeline source."
96+
97+
### Configuration - Using a CodeConnections as source
98+
99+
pipeline-stacks.ts
100+
101+
```ts
102+
import { PDKPipelineWithCodeConnection } from '@aws/pdk/pipeline';
103+
104+
...
105+
106+
this.pipeline = new PDKPipelineWithCodeConnection(this, "ApplicationPipeline", {
107+
codeConnectionArn: "arn:aws:codeconnections:<region>:<account>:connection/<connection_id>",
108+
repositoryOwnerAndName: "test/test",
109+
primarySynthDirectory: "packages/backend/cdk.out",
110+
});
111+
```
112+

0 commit comments

Comments
 (0)