-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projenrc.ts
61 lines (58 loc) · 1.55 KB
/
.projenrc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { awscdk } from 'projen';
import { GithubWorkflow } from 'projen/lib/github';
import { JobPermission } from 'projen/lib/github/workflows-model';
const project = new awscdk.AwsCdkTypeScriptApp({
cdkVersion: '2.77.0',
minNodeVersion: '18.0.0',
defaultReleaseBranch: 'main',
name: 'aws-cdk-demo-taimos',
projenrcTs: true,
deps: [
'cdk-iam-floyd',
'aws-cdk-github-oidc',
'@lumigo/cdk-constructs-v2',
'axios',
],
devDeps: [
'@types/aws-lambda',
'esbuild',
],
});
// Deployment setup from GitHub -> AWS
const deploy = new GithubWorkflow(project.github!, 'deploy');
deploy.on({
push: {
branches: ['main'],
},
workflowDispatch: {},
});
deploy.addJob('deploy', {
name: 'Deploy changes to AWS',
runsOn: ['ubuntu-latest'],
permissions: { idToken: JobPermission.WRITE, contents: JobPermission.READ },
steps: [{
name: 'Checkout',
uses: 'actions/checkout@v2',
}, {
name: 'AWS Credentials',
uses: 'aws-actions/configure-aws-credentials@master',
with: {
'role-to-assume': 'arn:aws:iam::538118019757:role/LumigoWebinarDemoDeployRole',
'role-session-name': 'GitHubAction',
'aws-region': 'eu-central-1',
},
}, {
name: 'Install packages',
run: 'yarn install --frozen-lockfile',
}, {
name: 'CDK Synth',
run: 'npx projen build',
}, {
name: 'CDK Diff',
run: 'npx cdk --app cdk.out diff aws-cdk-demo-taimos-hoegertn',
}, {
name: 'CDK Deploy',
run: 'npx cdk --app cdk.out --require-approval never deploy aws-cdk-demo-taimos-hoegertn',
}],
});
project.synth();