Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infra: migrate ASG to CDK #8507

Merged
merged 56 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
5373ac6
Initial internal lb migration implementation
ParisaTork Aug 7, 2023
d03f2cd
Appease GHA linter with order of imports
ParisaTork Aug 8, 2023
4cbfdaa
Appease GHA linter by using property shorthand for vpc
ParisaTork Aug 8, 2023
6c8db53
infra: migrate asg to cdk and cleanup cloudformation template
cemms1 Aug 8, 2023
7c1ab57
refactor: set CIDR block outside vpc def
cemms1 Aug 8, 2023
c5a95f7
refactor: remove unnecessary repetition of reason in overriding ids
cemms1 Aug 8, 2023
9de918e
Merge branch 'main' into cemms1/cdk-migrate-asg
cemms1 Aug 8, 2023
3b0e188
refactor: use destructured region from props
cemms1 Aug 8, 2023
cfb7f7a
refactor: move userdata definition to separate file
cemms1 Aug 8, 2023
d813f95
infra: use ssm params for ami id
cemms1 Aug 8, 2023
1f0130d
update logging stream param
cemms1 Aug 8, 2023
0fcd136
remove unused cfn params
cemms1 Aug 8, 2023
9717953
String param for S3 Bucket Name
ParisaTork Aug 8, 2023
1c8ae45
Merge branch 'main' into cdk/InternalLoadBalancer
ParisaTork Aug 8, 2023
4cfc29d
cfnOutput experiment
ParisaTork Aug 8, 2023
004ec81
Appease GHA linter - order of imports
ParisaTork Aug 8, 2023
6d156d3
Change S3 Bucket Name
ParisaTork Aug 9, 2023
1e63e74
Merge branch 'cdk/InternalLoadBalancer' of github.com:guardian/dotcom…
ParisaTork Aug 9, 2023
163c46b
use cfnLoadBalancer
DanielCliftonGuardian Aug 9, 2023
ece1faf
Update dotcom-rendering.ts
DanielCliftonGuardian Aug 9, 2023
b05229a
use load balancer name instead of logical ID
cemms1 Aug 9, 2023
adafaa0
Merge branch 'main' into cdk/InternalLoadBalancer
cemms1 Aug 9, 2023
e6cc573
infa: remove first char of s3 prefix and add public subnets param
cemms1 Aug 9, 2023
dd32d7f
infra: use ref rather than name for lb in cfn
cemms1 Aug 9, 2023
9a77a1c
infra: use correct param type for subnet list
cemms1 Aug 9, 2023
18334c6
Merge branch 'main' into cdk/InternalLoadBalancer
cemms1 Aug 9, 2023
99026c5
remove commented out yaml in cfn
cemms1 Aug 9, 2023
aa2b64b
refactor: clean up cfn and cdk code
cemms1 Aug 9, 2023
5aa57bd
refactor: destructure for all props
cemms1 Aug 9, 2023
6ab4fb8
docs: update description for region
cemms1 Aug 9, 2023
fd10e3b
Merge branch 'main' into cemms1/cdk-refactor
cemms1 Aug 9, 2023
6a69b67
test: update snapshot
cemms1 Aug 9, 2023
847d937
Merge branch 'cemms1/cdk-refactor' into cemms1/cdk-migrate-asg
cemms1 Aug 9, 2023
71767f9
rework public subnet definition
cemms1 Aug 9, 2023
833683f
remove unused param
cemms1 Aug 9, 2023
13f81d6
refactor: use ssmPrefix in path for ssm params
cemms1 Aug 10, 2023
fb92c5b
refactor: use destructured app from props
cemms1 Aug 10, 2023
bcd84ea
docs: improve docstring for getUserData
cemms1 Aug 10, 2023
df92a13
chore: change location of nvmrc check for ami recipe
cemms1 Aug 10, 2023
ec5b82a
Merge branch 'main' into cemms1/cdk-migrate-asg
cemms1 Aug 10, 2023
3166105
Merge branch 'main' into cemms1/cdk-migrate-asg
cemms1 Aug 11, 2023
5eb0c01
refactor: rename userdata file
cemms1 Aug 11, 2023
e7f32a0
chore: keep existing (unused) params in cfn in case of rollback
cemms1 Aug 11, 2023
ed5fb0a
remove vpcid param
cemms1 Aug 11, 2023
856dfda
infra: switch load balancer type (#8558)
cemms1 Aug 14, 2023
2b9e58b
Merge branch 'main' into cemms1/cdk-migrate-asg
cemms1 Aug 14, 2023
c5d2888
Merge branch 'cemms1/cdk-change-lb-definition' into cemms1/cdk-migrat…
cemms1 Aug 14, 2023
960cde0
remove whitespace from start of userdata
cemms1 Aug 15, 2023
eb5190a
remove whitespace in userdata
cemms1 Aug 15, 2023
6139122
change usedata to array join
cemms1 Aug 15, 2023
9301a74
remove imdsv2 requirement
cemms1 Aug 15, 2023
02a9066
base64 encode userdata
cemms1 Aug 15, 2023
16a7834
use private vpc and un-encode userdata
cemms1 Aug 15, 2023
f8aa7d9
Merge branch 'cemms1/cdk-change-lb-definition' into cemms1/cdk-migrat…
cemms1 Aug 15, 2023
d53b1f0
Merge branch 'main' into cemms1/cdk-migrate-asg
cemms1 Aug 22, 2023
5449ce6
Merge branch 'main' into cemms1/cdk-migrate-asg
cemms1 Aug 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions dotcom-rendering/cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,26 @@ import { App } from 'aws-cdk-lib';
import { DotcomRendering } from '../lib/dotcom-rendering';

const app = new App();
new DotcomRendering(app, 'DotcomRendering-PROD', {

const sharedProps = {
app: 'rendering',
stack: 'frontend',
stage: 'PROD',
region: 'eu-west-1',
amiRecipe: 'dotcom-rendering-ARM-jammy-node-18.17.0',
};

new DotcomRendering(app, 'DotcomRendering-PROD', {
stage: 'PROD',
minCapacity: 15,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future optimisation note to parameterise these values

maxCapacity: 60,
instanceType: 't4g.small',
...sharedProps,
});

new DotcomRendering(app, 'DotcomRendering-CODE', {
app: 'rendering',
stack: 'frontend',
stage: 'CODE',
region: 'eu-west-1',
minCapacity: 1,
maxCapacity: 4,
instanceType: 't4g.micro',
...sharedProps,
});
Loading