🎹
- https://youtu.be/Ra_fbW4OcS0?si=KE_TFR77V6bhXMlu&t=122
- https://youtu.be/P2p3zYvt5pU?si=TY3sVaxZVx1wRo__&t=159
- https://yt3.ggpht.com/WBS7goCya7Peazlx6OKG7G3lS4hofLvNMzdHvurkEmVHF5vImgyGP9z7pcEkRAeschHIu-h6iDInNw=s1024-c-fcrop64=1,0000014afffffeb5-rw-nd-v1
- https://x.com/AlinejadMasih/status/1853096281855479984
- https://youtu.be/xDvj2cRRNOI?si=BDvkbXIyim6bGHuO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Duration } from "aws-cdk-lib"; | |
if (stage.valueAsString === 'CODE') { | |
new GuAlarm(this, 'LatencyScalingAlarm', { | |
app, | |
metricName: 'Latency', | |
namespace: 'AWS/ELB', | |
dimensions: { | |
LoadBalancerName: lb.loadBalancerName, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GuAlarm, GuStack } from '@guardian/cdk'; | |
import { Metric, ComparisonOperator } from '@aws-cdk/aws-cloudwatch'; | |
const Backend5XXAlarmThreshold = 100; | |
const Backend5XXAlarmPeriod = 1; | |
const Backend5XXConsecutivePeriod = 5; | |
const criticalAlertsTopic = sns.Topic.fromTopicArn(this, 'CriticalAlertsTopic', 'arn:aws:sns:<region>:<account-id>:Frontend-PROD-CriticalAlerts'); // modify to CODE in the meantime? I don't think we have one for CODE, so we may need to set this up | |
const alarm = new GuAlarm(stack, 'Backend5xxAlarm', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GuClassicLoadBalancer } from '@guardian/cdk'; | |
const lb = new GuClassicLoadBalancer(stack, 'InternalLoadBalancer', { | |
app: 'rendering', | |
stack: 'frontend', | |
stage: 'CODE', | |
vpc: stack.vpc, | |
scheme: elb.LoadBalancerScheme.INTERNAL, | |
loadBalancerName: `${stack}-${stage}-${app}-ELB`, | |
listeners: [{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Docs: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.InstanceProfile.html | |
// Sample: https://github.com/aws/aws-cdk/blob/03c6f6fb667a1d7034537b514103215bb949a8da/packages/aws-cdk-lib/aws-ec2/README.md?plain=1#L1870 | |
// add to ts cdk file | |
import { InstanceProfile } from 'aws-cdk-lib/aws-iam'; | |
const instanceProfile = new InstanceProfile(this, 'InstanceProfile', { | |
role: instanceRole | |
}); |