Skip to content

Commit

Permalink
chore: cdk-assets install bug example
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmiller committed Aug 29, 2024
1 parent 159da36 commit 5c8e002
Show file tree
Hide file tree
Showing 6 changed files with 1,309 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .projenrc.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { awscdk } from 'projen';
const project = new awscdk.AwsCdkTypeScriptApp({
cdkVersion: '2.1.0',
cdkVersion: '2.154.1',
defaultReleaseBranch: 'main',
name: 'cdk-assets-bug-2',
name: 'cdk-assets-bug',
projenrcTs: true,

// deps: [], /* Runtime dependencies of this module. */
Expand Down
6 changes: 3 additions & 3 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 45 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,52 @@
import { App, Stack, StackProps } from 'aws-cdk-lib';
import { App, Stack, StackProps, Stage, StageProps } from 'aws-cdk-lib';
import { Role } from 'aws-cdk-lib/aws-iam';
import { CrossAccountZoneDelegationRecord, HostedZone } from 'aws-cdk-lib/aws-route53';
import { ShellStep, CodePipeline, CodePipelineSource } from 'aws-cdk-lib/pipelines';
import { Construct } from 'constructs';

class MyServiceStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);

// This Construct adds a node with the type `publish-assets` which triggers the behavior.
new CrossAccountZoneDelegationRecord(this, 'cross-account-zone', {
delegatedZone: HostedZone.fromHostedZoneAttributes(this, 'my-hosted-zone', {
hostedZoneId: 'Z01201272X6Y0ABCDE0FG',
zoneName: 'zone.name',
}),
delegationRole: Role.fromRoleName(this, 'my-role', 'my-role-name'),
parentHostedZoneId: 'parent-hosted-zone',
});
}
}

class MyStage extends Stage {
constructor(scope: Construct, id: string, props?: StageProps) {
super(scope, id, props);

new MyServiceStack(this, 'my-stack');
}
}

export class MyStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps = {}) {
super(scope, id, props);

// define resources here...
const pipeline = new CodePipeline(this, 'my-pipeline', {
synth: new ShellStep('my-build', {
input: CodePipelineSource.gitHub(
'my-org/my-repo',
'main',
),
commands: [
"echo 'hello world'",
],
}),
cliVersion: '2.154.1',
});

const wave = pipeline.addWave('my-wave');
wave.addStage(new MyStage(this, 'my-stage'));
}
}

Expand All @@ -17,7 +58,6 @@ const devEnv = {

const app = new App();

new MyStack(app, 'cdk-assets-bug-2-dev', { env: devEnv });
// new MyStack(app, 'cdk-assets-bug-2-prod', { env: prodEnv });
new MyStack(app, 'cdk-assets-bug-dev', { env: devEnv });

app.synth();
app.synth();
Loading

0 comments on commit 5c8e002

Please sign in to comment.