Skip to content

Commit 68aa1ff

Browse files
committed
Version update. Exporting required outputs as CFN
1 parent 0e9ccc3 commit 68aa1ff

File tree

5 files changed

+28
-14
lines changed

5 files changed

+28
-14
lines changed

infrastructure-cdk/lib/application-pipeline-stack.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class ApplicationPipelineStack extends Stack {
1717
removalPolicy: RemovalPolicy.DESTROY
1818
});
1919

20-
new JavaBuildPipeline(this, 'java-app', {
20+
const javaBuildPipeline = new JavaBuildPipeline(this, 'java-app', {
2121
appName: APPLICATION_NAME,
2222
deployBucket: artifactBucket,
2323
repositoryName: APPLICATION_NAME
@@ -34,5 +34,10 @@ export class ApplicationPipelineStack extends Stack {
3434
description: "Artifact Bucket Link"
3535
});
3636

37+
new CfnOutput(this, 'ApplicationCodePipelineLink', {
38+
value: "https://console.aws.amazon.com/codesuite/codepipeline/pipelines/" + javaBuildPipeline.pipeline.pipelineName + "/view?region=" + Aws.REGION,
39+
description: "Application AWS CodePipeline Link"
40+
});
41+
3742
}
3843
}

infrastructure-cdk/lib/constructs/java-build-pipeline.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ interface JavaBuildPipelineProps {
2525
}
2626

2727
export class JavaBuildPipeline extends Construct {
28+
readonly pipeline: Pipeline
29+
2830
constructor(scope: Construct, id: string, props: JavaBuildPipelineProps) {
2931
super(scope, id);
3032

@@ -73,7 +75,7 @@ export class JavaBuildPipeline extends Construct {
7375

7476
const buildOutput = new Artifact();
7577

76-
const pipeline = new Pipeline(this, 'CodePipeline', {
78+
this.pipeline = new Pipeline(this, 'CodePipeline', {
7779
stages: [
7880
// In real world use code snippet like below to work with repository
7981
//
@@ -134,7 +136,7 @@ export class JavaBuildPipeline extends Construct {
134136
actions: ["codepipeline:PutJobSuccessResult", "codepipeline:PutJobFailureResult"]
135137
}));
136138

137-
pipeline.addStage({
139+
this.pipeline.addStage({
138140
stageName: "deploy", actions: [new LambdaInvokeAction({
139141
actionName: "Deploy",
140142
lambda: versionUpdateFn

infrastructure-cdk/lib/infra-pipeline-stack.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Fn, Stack, StackProps} from 'aws-cdk-lib';
1+
import {Aws, CfnOutput, Fn, Stack, StackProps} from 'aws-cdk-lib';
22
import {Construct} from 'constructs';
33
import {CodePipeline, CodePipelineSource, ShellStep} from "aws-cdk-lib/pipelines";
44
import {RealtimeApplication} from "./real-time-application";
@@ -12,8 +12,10 @@ export class InfraPipelineStack extends Stack {
1212

1313
const artifactBucket = Bucket.fromBucketName(this, 'artifactBucket-import', Fn.importValue(BUCKET_NAME_OUTPUT))
1414

15+
const pipelineName = "blog-infra-pipeline-" + Aws.ACCOUNT_ID + "-" + Aws.REGION;
1516
const pipeline = new CodePipeline(this, 'Pipeline', {
1617
selfMutation: false,
18+
pipelineName: pipelineName,
1719
synth: new ShellStep('Synth', {
1820
input: CodePipelineSource.s3(artifactBucket, SOURCE_CODE_ZIP),
1921
commands: [
@@ -27,5 +29,10 @@ export class InfraPipelineStack extends Stack {
2729
});
2830

2931
pipeline.addStage(new RealtimeApplication(this, 'app'));
32+
33+
new CfnOutput(this, 'InfraCodePipelineLink', {
34+
value: "https://console.aws.amazon.com/codesuite/codepipeline/pipelines/" + pipelineName + "/view?region=" + Aws.REGION,
35+
description: "Infrastructure AWS CodePipeline Link"
36+
});
3037
}
3138
}

infrastructure-cdk/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infrastructure-cdk/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "pro",
2+
"name": "infrastructure-cdk",
33
"version": "0.1.0",
44
"bin": {
55
"pro": "bin/pro.js"
@@ -21,8 +21,8 @@
2121
"typescript": "~3.9.7"
2222
},
2323
"dependencies": {
24-
"aws-cdk-lib": "2.40.0",
25-
"@aws-cdk/aws-kinesisanalytics-flink-alpha": "2.40.0-alpha.0",
24+
"aws-cdk-lib": "2.41.0",
25+
"@aws-cdk/aws-kinesisanalytics-flink-alpha": "2.41.0-alpha.0",
2626
"constructs": "^10.0.0"
2727
}
2828
}

0 commit comments

Comments
 (0)