@guardian/cdk 62.3.0 → 62.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"asg.d.ts","sourceRoot":"","sources":["../../../src/constructs/autoscaling/asg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAgB,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAuB,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAsB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIpD,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,SAAS,CAAC;AAM9D,MAAM,WAAW,uBACf,SAAQ,IAAI,CACR,qBAAqB,EACnB,SAAS,GACT,QAAQ,GACR,cAAc,GACd,UAAU,GACV,aAAa,GACb,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,eAAe,CAClB,EACD,WAAW,EACX,aAAa;IACf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;;;;;;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G,CAAC,CAAC;IAC1C,CAAC;CACF;AAhHD,gDAgHC","sourcesContent":["import type { Duration } from \"aws-cdk-lib\";\nimport { Tags, Token } from \"aws-cdk-lib\";\nimport { AutoScalingGroup, GroupMetrics } from \"aws-cdk-lib/aws-autoscaling\";\nimport type { AutoScalingGroupProps, CfnAutoScalingGroup } from \"aws-cdk-lib/aws-autoscaling\";\nimport { LaunchTemplate, OperatingSystemType } from \"aws-cdk-lib/aws-ec2\";\nimport type { InstanceType, ISecurityGroup, MachineImageConfig, UserData } from \"aws-cdk-lib/aws-ec2\";\nimport type { ApplicationTargetGroup } from \"aws-cdk-lib/aws-elasticloadbalancingv2\";\nimport type { GuAsgCapacity } from \"../../types\";\nimport type { AmigoProps } from \"../../types/amigo\";\nimport { GuAppAwareConstruct } from \"../../utils/mixin/app-aware-construct\";\nimport { GuAmiParameter } from \"../core\";\nimport type { AppIdentity, GuStack } from \"../core\";\nimport { GuHttpsEgressSecurityGroup } from \"../ec2\";\nimport { GuInstanceRole } from \"../iam\";\n\nexport type InstanceMetricGranularity = \"1Minute\" | \"5Minute\";\n\n// Since we want to override the types of what gets passed in for the below props,\n// we need to use Omit<T, U> to remove them from the interface this extends\n// https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys\n// TODO avoid prop nesting to improve discoverability. See https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md#flat.\nexport interface GuAutoScalingGroupProps\n extends Omit<\n AutoScalingGroupProps,\n | \"imageId\"\n | \"osType\"\n | \"machineImage\"\n | \"userData\"\n | \"minCapacity\"\n | \"maxCapacity\"\n | \"desiredCapacity\"\n | \"requireImdsv2\"\n | \"securityGroup\"\n >,\n AppIdentity,\n GuAsgCapacity {\n /**\n * @deprecated\n * It shouldn't be necessary to specify a value here.\n * GuCDK will create an AMI parameter by default. Riff-Raff can use this parameter to inject the latest AMI ID for\n * your AMIgo recipe.\n */\n imageId?: GuAmiParameter;\n /**\n * If you are using GuCDK to generate your riff-raff.yaml file, specify AMIgo props here.\n * If you are using a hardcoded riff-raff.yaml file (usually found in project root) then providing a value here has no\n * effect.\n */\n imageRecipe?: string | AmigoProps;\n instanceType: InstanceType;\n userData: UserData;\n\n /**\n * How often to send EC2 metrics, such as CPU usage.\n * By default, AWS will produce `5Minute` granular metrics.\n *\n * It is recommended to produce `1Minute` granular metrics in production,\n * especially when using ASG metrics to trigger horizontal scaling as it allows for earlier scaling.\n *\n * @see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html\n */\n instanceMetricGranularity: InstanceMetricGranularity;\n\n additionalSecurityGroups?: ISecurityGroup[];\n targetGroup?: ApplicationTargetGroup;\n httpPutResponseHopLimit?: number;\n defaultInstanceWarmup?: Duration;\n}\n\n/**\n * Construct which creates an Auto Scaling group.\n *\n * By default, all EC2 instances in this group will use [[`GuInstanceRole`]],\n * which provides common permissions (e.g. the ability to download an artifact and write logs to the account's logging Kinesis stream).\n *\n * If additional IAM permissions are required, a custom role can be provided via the `role` prop.\n * You may wish to instantiate [[`GuInstanceRole`]] yourself as a basis for this custom role, as it allows custom permissions\n * to be passed in.\n *\n * All EC2 instances in this group will be automatically associated with the [[`GuHttpsEgressSecurityGroup`]] security groups,\n * which allows outbound traffic over HTTPS.\n *\n * If additional ingress or egress rules are required, define custom security groups and pass them in via the\n * `additionalSecurityGroups` prop.\n *\n * All EC2 instances provisioned via this construct will use\n * [IMDSv2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html).\n */\nexport class GuAutoScalingGroup extends GuAppAwareConstruct(AutoScalingGroup) {\n public readonly app: string;\n public readonly amiParameter: GuAmiParameter;\n public readonly imageRecipe?: string | AmigoProps;\n\n // Sadly this cannot be named `launchTemplate` as it would clash with a private property on the `AutoScalingGroup` class\n public readonly instanceLaunchTemplate: LaunchTemplate;\n\n constructor(scope: GuStack, id: string, props: GuAutoScalingGroupProps) {\n const {\n app,\n additionalSecurityGroups = [],\n blockDevices,\n imageId = new GuAmiParameter(scope, { app }),\n imageRecipe,\n instanceType,\n groupMetrics = [GroupMetrics.all()],\n minimumInstances,\n maximumInstances,\n role = new GuInstanceRole(scope, { app }),\n targetGroup,\n userData,\n vpc,\n httpPutResponseHopLimit,\n updatePolicy,\n defaultInstanceWarmup,\n instanceMetricGranularity,\n } = props;\n\n // Ensure min and max are defined in the same way. Throwing an `Error` when necessary. For example when min is defined via a Mapping, but max is not.\n if (Token.isUnresolved(minimumInstances) && !Token.isUnresolved(maximumInstances)) {\n throw new Error(\n \"minimumInstances is defined via a Mapping, but maximumInstances is not. Create maximumInstances via a Mapping too.\",\n );\n }\n\n const detailedMonitoring = instanceMetricGranularity === \"1Minute\";\n\n // Generate an ID unique to this app\n const launchTemplateId = `${scope.stack}-${scope.stage}-${app}`;\n const launchTemplate = new LaunchTemplate(scope, launchTemplateId, {\n blockDevices,\n detailedMonitoring,\n instanceType,\n machineImage: {\n getImage: (): MachineImageConfig => {\n return {\n osType: OperatingSystemType.LINUX,\n userData,\n imageId: imageId.valueAsString,\n };\n },\n },\n // Do not use the default AWS security group which allows egress on any port.\n // Favour HTTPS only egress rules by default.\n securityGroup: GuHttpsEgressSecurityGroup.forVpc(scope, { app, vpc }),\n\n /*\n Ensure we satisfy FSBP EC2.8 control. If needed, an escape hatch can override this.\n See https://docs.aws.amazon.com/securityhub/latest/userguide/ec2-controls.html#ec2-8.\n */\n requireImdsv2: true,\n\n instanceMetadataTags: true,\n userData,\n role,\n httpPutResponseHopLimit,\n });\n\n // Add additional consumer specified Security Groups\n // Note: Launch templates via CDK allow specifying only one SG, so use connections\n // https://github.com/aws/aws-cdk/issues/18712\n additionalSecurityGroups.forEach((sg) => launchTemplate.connections.addSecurityGroup(sg));\n\n const asgProps: AutoScalingGroupProps = {\n ...props,\n launchTemplate,\n maxCapacity: maximumInstances ?? minimumInstances * 2,\n minCapacity: minimumInstances,\n groupMetrics: groupMetrics,\n\n // Omit userData, instanceType, blockDevices & role from asgProps\n // As this are specified by the LaunchTemplate and must not be duplicated\n blockDevices: undefined,\n instanceType: undefined,\n role: undefined,\n userData: undefined,\n defaultInstanceWarmup,\n };\n\n super(scope, id, asgProps);\n\n this.app = app;\n this.amiParameter = imageId;\n this.imageRecipe = imageRecipe;\n this.instanceLaunchTemplate = launchTemplate;\n\n if (targetGroup) {\n this.attachToApplicationTargetGroup(targetGroup);\n }\n\n const cfnAsg = this.node.defaultChild as CfnAutoScalingGroup;\n\n // A CDK AutoScalingGroup comes with this update policy, whereas the CFN autscaling group\n // leaves it to the default value, which is actually false.\n // { UpdatePolicy: { autoScalingScheduledAction: { IgnoreUnmodifiedGroupSizeProperties: true }}\n if (!updatePolicy) {\n cfnAsg.addDeletionOverride(\"UpdatePolicy\");\n }\n\n Tags.of(launchTemplate).add(\"App\", app);\n }\n}\n"]}
1
+ {"version":3,"file":"asg.js","sourceRoot":"","sources":["../../../src/constructs/autoscaling/asg.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAC1C,iEAA6E;AAE7E,iDAA0E;AAK1E,+EAA4E;AAC5E,kCAAyC;AAEzC,gCAAoD;AACpD,gCAAwC;AAyDxC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,kBAAmB,SAAQ,IAAA,yCAAmB,EAAC,kCAAgB,CAAC;IAQ3E,YAAY,KAAc,EAAE,EAAU,EAAE,KAA8B;QACpE,MAAM,EACJ,GAAG,EACH,wBAAwB,GAAG,EAAE,EAC7B,YAAY,EACZ,OAAO,GAAG,IAAI,qBAAc,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAC5C,WAAW,EACX,YAAY,EACZ,YAAY,GAAG,CAAC,8BAAY,CAAC,GAAG,EAAE,CAAC,EACnC,gBAAgB,EAChB,gBAAgB,EAChB,IAAI,GAAG,IAAI,oBAAc,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EACzC,WAAW,EACX,QAAQ,EACR,GAAG,EACH,uBAAuB,EACvB,YAAY,EACZ,qBAAqB,E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C7B,YAAY,EAAE,YAAY;YAE1B,iEAAiE;YACjE,yEAAyE;YACzE,YAAY,EAAE,SAAS;YACvB,YAAY,EAAE,SAAS;YACvB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,SAAS;YACnB,qBAAqB;SACtB,CAAC;QAEF,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;QAE3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,sBAAsB,GAAG,cAAc,CAAC;QAE7C,IAAI,WAAW,EAAE;YACf,IAAI,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC;SAClD;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,YAAmC,CAAC;QAE7D,yFAAyF;QACzF,2DAA2D;QAC3D,+FAA+F;QAC/F,IAAI,CAAC,YAAY,EAAE;YACjB,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;SAC5C;QAED,kBAAI,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;CACF;AAhHD,gDAgHC","sourcesContent":["import type { Duration } from \"aws-cdk-lib\";\nimport { Tags, Token } from \"aws-cdk-lib\";\nimport { AutoScalingGroup, GroupMetrics } from \"aws-cdk-lib/aws-autoscaling\";\nimport type { AutoScalingGroupProps, CfnAutoScalingGroup } from \"aws-cdk-lib/aws-autoscaling\";\nimport { LaunchTemplate, OperatingSystemType } from \"aws-cdk-lib/aws-ec2\";\nimport type { InstanceType, ISecurityGroup, MachineImageConfig, UserData } from \"aws-cdk-lib/aws-ec2\";\nimport type { ApplicationTargetGroup } from \"aws-cdk-lib/aws-elasticloadbalancingv2\";\nimport type { GuAsgCapacity } from \"../../types\";\nimport type { AmigoProps } from \"../../types/amigo\";\nimport { GuAppAwareConstruct } from \"../../utils/mixin/app-aware-construct\";\nimport { GuAmiParameter } from \"../core\";\nimport type { AppIdentity, GuStack } from \"../core\";\nimport { GuHttpsEgressSecurityGroup } from \"../ec2\";\nimport { GuInstanceRole } from \"../iam\";\n\nexport type InstanceMetricGranularity = \"1Minute\" | \"5Minute\";\n\n// Since we want to override the types of what gets passed in for the below props,\n// we need to use Omit<T, U> to remove them from the interface this extends\n// https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys\n// TODO avoid prop nesting to improve discoverability. See https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md#flat.\nexport interface GuAutoScalingGroupProps\n extends\n Omit<\n AutoScalingGroupProps,\n | \"imageId\"\n | \"osType\"\n | \"machineImage\"\n | \"userData\"\n | \"minCapacity\"\n | \"maxCapacity\"\n | \"desiredCapacity\"\n | \"requireImdsv2\"\n | \"securityGroup\"\n >,\n AppIdentity,\n GuAsgCapacity {\n /**\n * @deprecated\n * It shouldn't be necessary to specify a value here.\n * GuCDK will create an AMI parameter by default. Riff-Raff can use this parameter to inject the latest AMI ID for\n * your AMIgo recipe.\n */\n imageId?: GuAmiParameter;\n /**\n * If you are using GuCDK to generate your riff-raff.yaml file, specify AMIgo props here.\n * If you are using a hardcoded riff-raff.yaml file (usually found in project root) then providing a value here has no\n * effect.\n */\n imageRecipe?: string | AmigoProps;\n instanceType: InstanceType;\n userData: UserData;\n\n /**\n * How often to send EC2 metrics, such as CPU usage.\n * By default, AWS will produce `5Minute` granular metrics.\n *\n * It is recommended to produce `1Minute` granular metrics in production,\n * especially when using ASG metrics to trigger horizontal scaling as it allows for earlier scaling.\n *\n * @see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html\n */\n instanceMetricGranularity: InstanceMetricGranularity;\n\n additionalSecurityGroups?: ISecurityGroup[];\n targetGroup?: ApplicationTargetGroup;\n httpPutResponseHopLimit?: number;\n defaultInstanceWarmup?: Duration;\n}\n\n/**\n * Construct which creates an Auto Scaling group.\n *\n * By default, all EC2 instances in this group will use [[`GuInstanceRole`]],\n * which provides common permissions (e.g. the ability to download an artifact and write logs to the account's logging Kinesis stream).\n *\n * If additional IAM permissions are required, a custom role can be provided via the `role` prop.\n * You may wish to instantiate [[`GuInstanceRole`]] yourself as a basis for this custom role, as it allows custom permissions\n * to be passed in.\n *\n * All EC2 instances in this group will be automatically associated with the [[`GuHttpsEgressSecurityGroup`]] security groups,\n * which allows outbound traffic over HTTPS.\n *\n * If additional ingress or egress rules are required, define custom security groups and pass them in via the\n * `additionalSecurityGroups` prop.\n *\n * All EC2 instances provisioned via this construct will use\n * [IMDSv2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html).\n */\nexport class GuAutoScalingGroup extends GuAppAwareConstruct(AutoScalingGroup) {\n public readonly app: string;\n public readonly amiParameter: GuAmiParameter;\n public readonly imageRecipe?: string | AmigoProps;\n\n // Sadly this cannot be named `launchTemplate` as it would clash with a private property on the `AutoScalingGroup` class\n public readonly instanceLaunchTemplate: LaunchTemplate;\n\n constructor(scope: GuStack, id: string, props: GuAutoScalingGroupProps) {\n const {\n app,\n additionalSecurityGroups = [],\n blockDevices,\n imageId = new GuAmiParameter(scope, { app }),\n imageRecipe,\n instanceType,\n groupMetrics = [GroupMetrics.all()],\n minimumInstances,\n maximumInstances,\n role = new GuInstanceRole(scope, { app }),\n targetGroup,\n userData,\n vpc,\n httpPutResponseHopLimit,\n updatePolicy,\n defaultInstanceWarmup,\n instanceMetricGranularity,\n } = props;\n\n // Ensure min and max are defined in the same way. Throwing an `Error` when necessary. For example when min is defined via a Mapping, but max is not.\n if (Token.isUnresolved(minimumInstances) && !Token.isUnresolved(maximumInstances)) {\n throw new Error(\n \"minimumInstances is defined via a Mapping, but maximumInstances is not. Create maximumInstances via a Mapping too.\",\n );\n }\n\n const detailedMonitoring = instanceMetricGranularity === \"1Minute\";\n\n // Generate an ID unique to this app\n const launchTemplateId = `${scope.stack}-${scope.stage}-${app}`;\n const launchTemplate = new LaunchTemplate(scope, launchTemplateId, {\n blockDevices,\n detailedMonitoring,\n instanceType,\n machineImage: {\n getImage: (): MachineImageConfig => {\n return {\n osType: OperatingSystemType.LINUX,\n userData,\n imageId: imageId.valueAsString,\n };\n },\n },\n // Do not use the default AWS security group which allows egress on any port.\n // Favour HTTPS only egress rules by default.\n securityGroup: GuHttpsEgressSecurityGroup.forVpc(scope, { app, vpc }),\n\n /*\n Ensure we satisfy FSBP EC2.8 control. If needed, an escape hatch can override this.\n See https://docs.aws.amazon.com/securityhub/latest/userguide/ec2-controls.html#ec2-8.\n */\n requireImdsv2: true,\n\n instanceMetadataTags: true,\n userData,\n role,\n httpPutResponseHopLimit,\n });\n\n // Add additional consumer specified Security Groups\n // Note: Launch templates via CDK allow specifying only one SG, so use connections\n // https://github.com/aws/aws-cdk/issues/18712\n additionalSecurityGroups.forEach((sg) => launchTemplate.connections.addSecurityGroup(sg));\n\n const asgProps: AutoScalingGroupProps = {\n ...props,\n launchTemplate,\n maxCapacity: maximumInstances ?? minimumInstances * 2,\n minCapacity: minimumInstances,\n groupMetrics: groupMetrics,\n\n // Omit userData, instanceType, blockDevices & role from asgProps\n // As this are specified by the LaunchTemplate and must not be duplicated\n blockDevices: undefined,\n instanceType: undefined,\n role: undefined,\n userData: undefined,\n defaultInstanceWarmup,\n };\n\n super(scope, id, asgProps);\n\n this.app = app;\n this.amiParameter = imageId;\n this.imageRecipe = imageRecipe;\n this.instanceLaunchTemplate = launchTemplate;\n\n if (targetGroup) {\n this.attachToApplicationTargetGroup(targetGroup);\n }\n\n const cfnAsg = this.node.defaultChild as CfnAutoScalingGroup;\n\n // A CDK AutoScalingGroup comes with this update policy, whereas the CFN autscaling group\n // leaves it to the default value, which is actually false.\n // { UpdatePolicy: { autoScalingScheduledAction: { IgnoreUnmodifiedGroupSizeProperties: true }}\n if (!updatePolicy) {\n cfnAsg.addDeletionOverride(\"UpdatePolicy\");\n }\n\n Tags.of(launchTemplate).add(\"App\", app);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"alarm.d.ts","sourceRoot":"","sources":["../../../src/constructs/cloudwatch/alarm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEpD,MAAM,WAAW,YAAa,SAAQ,UAAU,EAAE,WAAW;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBACf,SAAQ,IAAI,CACV,YAAY,EACZ,cAAc,GAAG,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,kBAAkB,GAAG,KAAK,CACtG;IACD,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wCAAwC,CAAC,EAAE,MAAM,CAAC;CACnD;AAED,MAAM,WAAW,iBACf,SAAQ,IAAI,CACV,YAAY,EACZ,cAAc,GAAG,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,kBAAkB,GAAG,KAAK,CACtG;IACD,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wCAAwC,CAAC,EAAE,MAAM,CAAC;CACnD;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,OAAQ,SAAQ,KAAK;gBACpB,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY;CAa5D"}
1
+ {"version":3,"file":"alarm.d.ts","sourceRoot":"","sources":["../../../src/constructs/cloudwatch/alarm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,OAAO,K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AAE,cAAc,EAAE,CAAC,CAAC;QAE/C,MAAM,QAAQ,GAAW,eAAe,MAAM,IAAI,OAAO,IAAI,YAAY,EAAE,CAAC;QAC5E,MAAM,QAAQ,GAAW,eAAK,CAAC,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;QACjF,IAAI,CAAC,cAAc,CAAC,IAAI,kCAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7C,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,IAAI,kCAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC3C;IACH,CAAC;CACF;AAdD,0BAcC","sourcesContent":["import { Alarm } from \"aws-cdk-lib/aws-cloudwatch\";\nimport type { AlarmProps } from \"aws-cdk-lib/aws-cloudwatch\";\nimport { SnsAction } from \"aws-cdk-lib/aws-cloudwatch-actions\";\nimport { Topic } from \"aws-cdk-lib/aws-sns\";\nimport type { ITopic } from \"aws-cdk-lib/aws-sns\";\nimport type { AppIdentity, GuStack } from \"../core\";\n\nexport interface GuAlarmProps extends AlarmProps, AppIdentity {\n snsTopicName: string;\n okAction?: boolean;\n}\n\nexport interface Http4xxAlarmProps\n extends Omit<\n GuAlarmProps,\n \"snsTopicName\" | \"evaluationPeriods\" | \"metric\" | \"period\" | \"threshold\" | \"treatMissingData\" | \"app\"\n > {\n tolerated4xxPercentage: number;\n numberOfMinutesAboveThresholdBeforeAlarm?: number;\n}\n\nexport interface Http5xxAlarmProps\n extends Omit<\n GuAlarmProps,\n \"snsTopicName\" | \"evaluationPeriods\" | \"metric\" | \"period\" | \"threshold\" | \"treatMissingData\" | \"app\"\n > {\n tolerated5xxPercentage: number;\n numberOfMinutesAboveThresholdBeforeAlarm?: number;\n}\n\n/**\n * Creates a CloudWatch alarm which sends notifications to the specified SNS topic.\n *\n * Alarm actions are enabled by default.\n *\n * To enable the alarm only in PROD, use the value of `Stage`:\n * ```typescript\n * new GuAlarm(stack, \"alarm\", {\n * // other required props\n * actionsEnabled: this.stage === \"PROD\",\n * });\n * ```\n *\n * This library provides an implementation of some commonly used alarms, which require less boilerplate than this construct,\n * for example the [[`GuAlb5xxPercentageAlarm`]]. Prefer using these more specific implementations where possible.\n */\nexport class GuAlarm extends Alarm {\n constructor(scope: GuStack, id: string, props: GuAlarmProps) {\n const { region, account } = scope;\n const { snsTopicName, actionsEnabled = true, okAction } = props;\n\n super(scope, id, { ...props, actionsEnabled });\n\n const topicArn: string = `arn:aws:sns:${region}:${account}:${snsTopicName}`;\n const snsTopic: ITopic = Topic.fromTopicArn(scope, `SnsTopicFor${id}`, topicArn);\n this.addAlarmAction(new SnsAction(snsTopic));\n if (okAction) {\n this.addOkAction(new SnsAction(snsTopic));\n }\n }\n}\n"]}
1
+ {"version":3,"file":"alarm.js","sourceRoot":"","sources":["../../../src/constructs/cloudwatch/alarm.ts"],"names":[],"mappings":";;;AAAA,+DAAmD;AAEnD,+EAA+D;AAC/D,iDAA4C;AAyB5C;;;;;;;;;;;;;;;GAeG;AACH,MAAa,OAAQ,SAAQ,sBAAK;IAChC,YAAY,KAAc,EAAE,EAAU,EAAE,KAAmB;QACzD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;QAClC,MAAM,EAAE,YAAY,EAAE,cAAc,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;QAEhE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC;QAE/C,MAAM,QAAQ,GAAW,eAAe,MAAM,IAAI,OAAO,IAAI,YAAY,EAAE,CAAC;QAC5E,MAAM,QAAQ,GAAW,eAAK,CAAC,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;QACjF,IAAI,CAAC,cAAc,CAAC,IAAI,kCAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7C,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,IAAI,kCAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC3C;IACH,CAAC;CACF;AAdD,0BAcC","sourcesContent":["import { Alarm } from \"aws-cdk-lib/aws-cloudwatch\";\nimport type { AlarmProps } from \"aws-cdk-lib/aws-cloudwatch\";\nimport { SnsAction } from \"aws-cdk-lib/aws-cloudwatch-actions\";\nimport { Topic } from \"aws-cdk-lib/aws-sns\";\nimport type { ITopic } from \"aws-cdk-lib/aws-sns\";\nimport type { AppIdentity, GuStack } from \"../core\";\n\nexport interface GuAlarmProps extends AlarmProps, AppIdentity {\n snsTopicName: string;\n okAction?: boolean;\n}\n\nexport interface Http4xxAlarmProps extends Omit<\n GuAlarmProps,\n \"snsTopicName\" | \"evaluationPeriods\" | \"metric\" | \"period\" | \"threshold\" | \"treatMissingData\" | \"app\"\n> {\n tolerated4xxPercentage: number;\n numberOfMinutesAboveThresholdBeforeAlarm?: number;\n}\n\nexport interface Http5xxAlarmProps extends Omit<\n GuAlarmProps,\n \"snsTopicName\" | \"evaluationPeriods\" | \"metric\" | \"period\" | \"threshold\" | \"treatMissingData\" | \"app\"\n> {\n tolerated5xxPercentage: number;\n numberOfMinutesAboveThresholdBeforeAlarm?: number;\n}\n\n/**\n * Creates a CloudWatch alarm which sends notifications to the specified SNS topic.\n *\n * Alarm actions are enabled by default.\n *\n * To enable the alarm only in PROD, use the value of `Stage`:\n * ```typescript\n * new GuAlarm(stack, \"alarm\", {\n * // other required props\n * actionsEnabled: this.stage === \"PROD\",\n * });\n * ```\n *\n * This library provides an implementation of some commonly used alarms, which require less boilerplate than this construct,\n * for example the [[`GuAlb5xxPercentageAlarm`]]. Prefer using these more specific implementations where possible.\n */\nexport class GuAlarm extends Alarm {\n constructor(scope: GuStack, id: string, props: GuAlarmProps) {\n const { region, account } = scope;\n const { snsTopicName, actionsEnabled = true, okAction } = props;\n\n super(scope, id, { ...props, actionsEnabled });\n\n const topicArn: string = `arn:aws:sns:${region}:${account}:${snsTopicName}`;\n const snsTopic: ITopic = Topic.fromTopicArn(scope, `SnsTopicFor${id}`, topicArn);\n this.addAlarmAction(new SnsAction(snsTopic));\n if (okAction) {\n this.addOkAction(new SnsAction(snsTopic));\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"api-gateway-alarms.d.ts","sourceRoot":"","sources":["../../../src/constructs/cloudwatch/api-gateway-alarms.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,UAAU,mCACR,SAAQ,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,EACxC,iBAAiB,EACjB,WAAW;IACb,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,8BAA+B,SAAQ,OAAO;gBAC7C,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,mCAAmC;CAwBvE"}
1
+ {"version":3,"file":"api-gateway-alarms.d.ts","sourceRoot":"","sources":["../../../src/constructs/cloudwatch/api-gateway-alarms.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,UAAU,mCACR,SAAQ,IAAI,CAAC,YAAY,EAAE,cAAc,CA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AI,kBAAkB;YAC9D,iBAAiB,EAAE,KAAK,CAAC,wCAAwC,IAAI,CAAC;SACvE,CAAC;QACF,KAAK,CAAC,KAAK,EAAE,kBAAW,CAAC,UAAU,CAAC,KAAK,EAAE,kCAAkC,CAAC,EAAE,UAAU,CAAC,CAAC;IAC9F,CAAC;CACF;AAzBD,wEAyBC","sourcesContent":["import { Duration } from \"aws-cdk-lib\";\nimport type { RestApi } from \"aws-cdk-lib/aws-apigateway\";\nimport { ComparisonOperator, MathExpression, TreatMissingData } from \"aws-cdk-lib/aws-cloudwatch\";\nimport type { GuStack } from \"../core\";\nimport { AppIdentity } from \"../core\";\nimport type { GuAlarmProps, Http5xxAlarmProps } from \"./alarm\";\nimport { GuAlarm } from \"./alarm\";\n\ninterface GuApiGateway5xxPercentageAlarmProps\n extends Pick<GuAlarmProps, \"snsTopicName\">,\n Http5xxAlarmProps,\n AppIdentity {\n apiGatewayInstance: RestApi;\n}\n\n/**\n * Creates an alarm which is triggered whenever the percentage of requests with a 5xx response code exceeds\n * the specified threshold.\n */\nexport class GuApiGateway5xxPercentageAlarm extends GuAlarm {\n constructor(scope: GuStack, props: GuApiGateway5xxPercentageAlarmProps) {\n const mathExpression = new MathExpression({\n expression: \"100*m1/m2\",\n usingMetrics: {\n m1: props.apiGatewayInstance.metricServerError(),\n m2: props.apiGatewayInstance.metricCount(),\n },\n label: `% of 5XX responses served for ${props.app}`,\n period: Duration.minutes(1),\n });\n const defaultAlarmName = `High 5XX error percentage from ${props.app} (ApiGateway) in ${scope.stage}`;\n const defaultDescription = `${props.app} exceeded ${props.tolerated5xxPercentage}% error rate`;\n const alarmProps = {\n ...props,\n metric: mathExpression,\n treatMissingData: TreatMissingData.NOT_BREACHING,\n threshold: props.tolerated5xxPercentage,\n comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD,\n alarmName: props.alarmName ?? defaultAlarmName,\n alarmDescription: props.alarmDescription ?? defaultDescription,\n evaluationPeriods: props.numberOfMinutesAboveThresholdBeforeAlarm ?? 1,\n };\n super(scope, AppIdentity.suffixText(props, \"ApiGatewayHigh5xxPercentageAlarm\"), alarmProps);\n }\n}\n"]}
1
+ {"version":3,"file":"api-gateway-alarms.js","sourceRoot":"","sources":["../../../src/constructs/cloudwatch/api-gateway-alarms.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AAEvC,+DAAkG;AAElG,kCAAsC;AAEtC,mCAAkC;AAOlC;;;GAGG;AACH,MAAa,8BAA+B,SAAQ,eAAO;IACzD,YAAY,KAAc,EAAE,KAA0C;QACpE,MAAM,cAAc,GAAG,IAAI,+BAAc,CAAC;YACxC,UAAU,EAAE,WAAW;YACvB,YAAY,EAAE;gBACZ,EAAE,EAAE,KAAK,CAAC,kBAAkB,CAAC,iBAAiB,EAAE;gBAChD,EAAE,EAAE,KAAK,CAAC,kBAAkB,CAAC,WAAW,EAAE;aAC3C;YACD,KAAK,EAAE,iCAAiC,KAAK,CAAC,GAAG,EAAE;YACnD,MAAM,EAAE,sBAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;SAC5B,CAAC,CAAC;QACH,MAAM,gBAAgB,GAAG,kCAAkC,KAAK,CAAC,GAAG,oBAAoB,KAAK,CAAC,KAAK,EAAE,CAAC;QACtG,MAAM,kBAAkB,GAAG,GAAG,KAAK,CAAC,GAAG,aAAa,KAAK,CAAC,sBAAsB,cAAc,CAAC;QAC/F,MAAM,UAAU,GAAG;YACjB,GAAG,KAAK;YACR,MAAM,EAAE,cAAc;YACtB,gBAAgB,EAAE,iCAAgB,CAAC,aAAa;YAChD,SAAS,EAAE,KAAK,CAAC,sBAAsB;YACvC,kBAAkB,EAAE,mCAAkB,CAAC,sBAAsB;YAC7D,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,gBAAgB;YAC9C,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,IAAI,kBAAkB;YAC9D,iBAAiB,EAAE,KAAK,CAAC,wCAAwC,IAAI,CAAC;SACvE,CAAC;QACF,KAAK,CAAC,KAAK,EAAE,kBAAW,CAAC,UAAU,CAAC,KAAK,EAAE,kCAAkC,CAAC,EAAE,UAAU,CAAC,CAAC;IAC9F,CAAC;CACF;AAzBD,wEAyBC","sourcesContent":["import { Duration } from \"aws-cdk-lib\";\nimport type { RestApi } from \"aws-cdk-lib/aws-apigateway\";\nimport { ComparisonOperator, MathExpression, TreatMissingData } from \"aws-cdk-lib/aws-cloudwatch\";\nimport type { GuStack } from \"../core\";\nimport { AppIdentity } from \"../core\";\nimport type { GuAlarmProps, Http5xxAlarmProps } from \"./alarm\";\nimport { GuAlarm } from \"./alarm\";\n\ninterface GuApiGateway5xxPercentageAlarmProps\n extends Pick<GuAlarmProps, \"snsTopicName\">, Http5xxAlarmProps, AppIdentity {\n apiGatewayInstance: RestApi;\n}\n\n/**\n * Creates an alarm which is triggered whenever the percentage of requests with a 5xx response code exceeds\n * the specified threshold.\n */\nexport class GuApiGateway5xxPercentageAlarm extends GuAlarm {\n constructor(scope: GuStack, props: GuApiGateway5xxPercentageAlarmProps) {\n const mathExpression = new MathExpression({\n expression: \"100*m1/m2\",\n usingMetrics: {\n m1: props.apiGatewayInstance.metricServerError(),\n m2: props.apiGatewayInstance.metricCount(),\n },\n label: `% of 5XX responses served for ${props.app}`,\n period: Duration.minutes(1),\n });\n const defaultAlarmName = `High 5XX error percentage from ${props.app} (ApiGateway) in ${scope.stage}`;\n const defaultDescription = `${props.app} exceeded ${props.tolerated5xxPercentage}% error rate`;\n const alarmProps = {\n ...props,\n metric: mathExpression,\n treatMissingData: TreatMissingData.NOT_BREACHING,\n threshold: props.tolerated5xxPercentage,\n comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD,\n alarmName: props.alarmName ?? defaultAlarmName,\n alarmDescription: props.alarmDescription ?? defaultDescription,\n evaluationPeriods: props.numberOfMinutesAboveThresholdBeforeAlarm ?? 1,\n };\n super(scope, AppIdentity.suffixText(props, \"ApiGatewayHigh5xxPercentageAlarm\"), alarmProps);\n }\n}\n"]}
@@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,EAAE,mCAAkB,CAAC,sBAAsB;YAC7D,iBAAiB,EAAE,KAAK,CAAC,kDAAkD,IAAI,CAAC;YAChF,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,gBAAgB;YAC9C,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,IAAI,kBAAkB;SAC/D,CAAC;QACF,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC/B,CAAC;CACF;AAvBD,oEAuBC;AA4BD,MAAa,uBAAwB,SAAQ,eAAO;IAClD,YAAY,KAAc,EAAE,EAAU,EAAE,KAAmC;QACzE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE;YACf,GAAG,KAAK;YACR,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;YACrB,SAAS,EACP,KAAK,CAAC,SAAS,IAAI,+BAA+B,KAAK,CAAC,MAAM,CAAC,YAAY,cAAc,KAAK,CAAC,KAAK,GAAG;YACzG,gBAAgB,EACd,KAAK,CAAC,gBAAgB,IAAI,4EAA4E;YACxG,SAAS,EAAE,KAAK,CAAC,wBAAwB,IAAI,CAAC;YAC9C,iBAAiB,EAAE,KAAK,CAAC,wCAAwC,IAAI,CAAC;YACtE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC;gBACnC,MAAM,EAAE,sBAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5B,SAAS,EAAE,KAAK;aACjB,CAAC;YACF,gBAAgB,EAAE,iCAAgB,CAAC,aAAa;YAChD,kBAAkB,EAAE,mCAAkB,CAAC,sBAAsB;SAC9D,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,0DAmBC","sourcesContent":["import { Duration } from \"aws-cdk-lib\";\nimport { ComparisonOperator, MathExpression, TreatMissingData } from \"aws-cdk-lib/aws-cloudwatch\";\nimport type { GuStack } from \"../core\";\nimport type { GuLambdaFunction } from \"../lambda\";\nimport { GuAlarm } from \"./alarm\";\nimport type { GuAlarmProps } from \"./alarm\";\n\nexport interface GuLambdaErrorPercentageMonitoringProps\n extends Omit<\n GuAlarmProps,\n \"metric\" | \"threshold\" | \"comparisonOperator\" | \"evaluationPeriods\" | \"treatMissingData\" | \"app\"\n > {\n toleratedErrorPercentage: number;\n lengthOfEvaluationPeriod?: Duration;\n numberOfEvaluationPeriodsAboveThresholdBeforeAlarm?: number;\n noMonitoring?: false;\n}\n\ninterface GuLambdaAlarmProps extends GuLambdaErrorPercentageMonitoringProps {\n lambda: GuLambdaFunction;\n}\n\n/**\n * Creates an alarm which is triggered whenever the error percentage specified is exceeded.\n */\nexport class GuLambdaErrorPercentageAlarm extends GuAlarm {\n constructor(scope: GuStack, id: string, props: GuLambdaAlarmProps) {\n const mathExpression = new MathExpression({\n expression: \"100*m1/m2\",\n usingMetrics: { m1: props.lambda.metricErrors(), m2: props.lambda.metricInvocations() },\n label: `Error % of ${props.lambda.functionName}`,\n period: props.lengthOfEvaluationPeriod ?? Duration.minutes(1),\n });\n const defaultAlarmName = `High error percentage from ${props.lambda.functionName} lambda in ${scope.stage}`;\n const defaultDescription = `${props.lambda.functionName} exceeded ${props.toleratedErrorPercentage}% error rate`;\n const alarmProps: GuAlarmProps = {\n ...props,\n app: props.lambda.app,\n metric: mathExpression,\n treatMissingData: TreatMissingData.NOT_BREACHING,\n threshold: props.toleratedErrorPercentage,\n comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD,\n evaluationPeriods: props.numberOfEvaluationPeriodsAboveThresholdBeforeAlarm ?? 1,\n alarmName: props.alarmName ?? defaultAlarmName,\n alarmDescription: props.alarmDescription ?? defaultDescription,\n };\n super(scope, id, alarmProps);\n }\n}\n\nexport interface GuLambdaThrottlingMonitoringProps\n extends Omit<\n GuAlarmProps,\n \"metric\" | \"threshold\" | \"comparisonOperator\" | \"evaluationPeriods\" | \"treatMissingData\" | \"app\"\n > {\n /**\n * Sum of thottled invocations above which to alarm.\n *\n * @defaultValue 0\n */\n toleratedThrottlingCount?: number;\n\n /**\n * Evaluation period in minutes for alarm.\n *\n * @defaultValue 1\n */\n numberOfMinutesAboveThresholdBeforeAlarm?: number;\n\n noMonitoring?: false;\n}\n\ninterface GuLambdaThrottlingAlarmProps extends GuLambdaThrottlingMonitoringProps {\n lambda: GuLambdaFunction;\n}\n\nexport class GuLambdaThrottlingAlarm extends GuAlarm {\n constructor(scope: GuStack, id: string, props: GuLambdaThrottlingAlarmProps) {\n super(scope, id, {\n ...props,\n app: props.lambda.app,\n alarmName:\n props.alarmName ?? `Lambda throttling alarm for ${props.lambda.functionName} lambda in ${scope.stage}.`,\n alarmDescription:\n props.alarmDescription ?? \"Alarm when lambda is throttled (which causes requests to fail with a 429).\",\n threshold: props.toleratedThrottlingCount ?? 0,\n evaluationPeriods: props.numberOfMinutesAboveThresholdBeforeAlarm ?? 1,\n metric: props.lambda.metricThrottles({\n period: Duration.seconds(60),\n statistic: \"sum\",\n }),\n treatMissingData: TreatMissingData.NOT_BREACHING,\n comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"lambda-alarms.js","sourceRoot":"","sources":["../../../src/constructs/cloudwatch/lambda-alarms.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AACvC,+DAAkG;AAGlG,mCAAkC;AAiBlC;;GAEG;AACH,MAAa,4BAA6B,SAAQ,eAAO;IACvD,YAAY,KAAc,EAAE,EAAU,EAAE,KAAyB;QAC/D,MAAM,cAAc,GAAG,IAAI,+BAAc,CAAC;YACxC,UAAU,EAAE,WAAW;YACvB,YAAY,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE,EAAE;YACvF,KAAK,EAAE,cAAc,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE;YAChD,MAAM,EAAE,KAAK,CAAC,wBAAwB,IAAI,sBAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;SAC9D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C,MAAM,EAAE,sBAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5B,SAAS,EAAE,KAAK;aACjB,CAAC;YACF,gBAAgB,EAAE,iCAAgB,CAAC,aAAa;YAChD,kBAAkB,EAAE,mCAAkB,CAAC,sBAAsB;SAC9D,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,0DAmBC","sourcesContent":["import { Duration } from \"aws-cdk-lib\";\nimport { ComparisonOperator, MathExpression, TreatMissingData } from \"aws-cdk-lib/aws-cloudwatch\";\nimport type { GuStack } from \"../core\";\nimport type { GuLambdaFunction } from \"../lambda\";\nimport { GuAlarm } from \"./alarm\";\nimport type { GuAlarmProps } from \"./alarm\";\n\nexport interface GuLambdaErrorPercentageMonitoringProps extends Omit<\n GuAlarmProps,\n \"metric\" | \"threshold\" | \"comparisonOperator\" | \"evaluationPeriods\" | \"treatMissingData\" | \"app\"\n> {\n toleratedErrorPercentage: number;\n lengthOfEvaluationPeriod?: Duration;\n numberOfEvaluationPeriodsAboveThresholdBeforeAlarm?: number;\n noMonitoring?: false;\n}\n\ninterface GuLambdaAlarmProps extends GuLambdaErrorPercentageMonitoringProps {\n lambda: GuLambdaFunction;\n}\n\n/**\n * Creates an alarm which is triggered whenever the error percentage specified is exceeded.\n */\nexport class GuLambdaErrorPercentageAlarm extends GuAlarm {\n constructor(scope: GuStack, id: string, props: GuLambdaAlarmProps) {\n const mathExpression = new MathExpression({\n expression: \"100*m1/m2\",\n usingMetrics: { m1: props.lambda.metricErrors(), m2: props.lambda.metricInvocations() },\n label: `Error % of ${props.lambda.functionName}`,\n period: props.lengthOfEvaluationPeriod ?? Duration.minutes(1),\n });\n const defaultAlarmName = `High error percentage from ${props.lambda.functionName} lambda in ${scope.stage}`;\n const defaultDescription = `${props.lambda.functionName} exceeded ${props.toleratedErrorPercentage}% error rate`;\n const alarmProps: GuAlarmProps = {\n ...props,\n app: props.lambda.app,\n metric: mathExpression,\n treatMissingData: TreatMissingData.NOT_BREACHING,\n threshold: props.toleratedErrorPercentage,\n comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD,\n evaluationPeriods: props.numberOfEvaluationPeriodsAboveThresholdBeforeAlarm ?? 1,\n alarmName: props.alarmName ?? defaultAlarmName,\n alarmDescription: props.alarmDescription ?? defaultDescription,\n };\n super(scope, id, alarmProps);\n }\n}\n\nexport interface GuLambdaThrottlingMonitoringProps extends Omit<\n GuAlarmProps,\n \"metric\" | \"threshold\" | \"comparisonOperator\" | \"evaluationPeriods\" | \"treatMissingData\" | \"app\"\n> {\n /**\n * Sum of thottled invocations above which to alarm.\n *\n * @defaultValue 0\n */\n toleratedThrottlingCount?: number;\n\n /**\n * Evaluation period in minutes for alarm.\n *\n * @defaultValue 1\n */\n numberOfMinutesAboveThresholdBeforeAlarm?: number;\n\n noMonitoring?: false;\n}\n\ninterface GuLambdaThrottlingAlarmProps extends GuLambdaThrottlingMonitoringProps {\n lambda: GuLambdaFunction;\n}\n\nexport class GuLambdaThrottlingAlarm extends GuAlarm {\n constructor(scope: GuStack, id: string, props: GuLambdaThrottlingAlarmProps) {\n super(scope, id, {\n ...props,\n app: props.lambda.app,\n alarmName:\n props.alarmName ?? `Lambda throttling alarm for ${props.lambda.functionName} lambda in ${scope.stage}.`,\n alarmDescription:\n props.alarmDescription ?? \"Alarm when lambda is throttled (which causes requests to fail with a 429).\",\n threshold: props.toleratedThrottlingCount ?? 0,\n evaluationPeriods: props.numberOfMinutesAboveThresholdBeforeAlarm ?? 1,\n metric: props.lambda.metricThrottles({\n period: Duration.seconds(60),\n statistic: \"sum\",\n }),\n treatMissingData: TreatMissingData.NOT_BREACHING,\n comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"application-listener.d.ts","sourceRoot":"","sources":["../../../../src/constructs/loadbalancing/alb/application-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAIpB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAEvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE3E,MAAM,WAAW,0BAA2B,SAAQ,wBAAwB,EAAE,WAAW;CAAG;;;;;;AAE5F;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,SAAQ,0BAAwC;gBACrE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,0BAA0B;CAG1E;AAED,MAAM,WAAW,+BACf,SAAQ,IAAI,CAAC,0BAA0B,EAAE,eAAe,GAAG,cAAc,CAAC,EACxE,WAAW;IACb,WAAW,EAAE,wBAAwB,CAAC;IACtC,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;;;;;;AAED;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,+BAAwC;gBAC1E,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,+BAA+B;CAoB/E"}
1
+ {"version":3,"file":"application-listener.d.ts","sourceRoot":"","sources":["../../../../src/constructs/loadbalancing/alb/application-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAIpB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAEvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE3E,MAAM,WAAW,0BAA2B,SAAQ,wBAAwB,EAAE,WAAW;CAAG;;;;;;AAE5F;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,SAAQ,0BAAwC;gBACrE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,0BAA0B;CAG1E;AAED,MAAM,WAAW,+BACf,SAAQ,IAAI,CAAC,0BAA0B,EAAE,eAAe,GAAG,cAAc,CAAC,EAAE,WAAW;IACvF,WAAW,EAAE,wBAAwB,CAAC;IACtC,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;;;;;;AAED;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,+BAAwC;gBAC1E,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,+BAA+B;CAoB/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"application-listener.js","sourceRoot":"","sources":["../../../../src/constructs/loadbalancing/alb/application-listener.ts"],"names":[],"mappings":";;;AAAA,uFAKgD;AAEhD,kFAA+E;AAO/E;;;;;;;;;;;;GAYG;AACH,MAAa,qBAAsB,SAAQ,IAAA,yCAAmB,EAAC,gDAAmB,CAAC;IACjF,YAAY,KAAc,EAAE,EAAU,EAAE,KAAiC;QACvE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,gDAAmB,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IACjF,CAAC;CACF;AAJD,sDAIC;AASD;;;;;;GAMG;AACH,MAAa,0BAA2B,SAAQ,IAAA,yCAAmB,EAAC,gDAAmB,CAAC;IACtF,YAAY,KAAc,EAAE,EAAU,EAAE,KAAsC;QAC5E,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;QAE3C,MAAM,WAAW,GAA+B;YAC9C,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;YAC9B,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,gDAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,gDAAmB,CAAC,IAAI;YAC5E,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,sCAAS,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS;YAC9D,GAAG,KAAK;YACR,YAAY,EAAE,WAAW;gBACvB,CAAC,CAAC;oBACE;wBACE,cAAc,EAAE,WAAW,CAAC,cAAc;qBAC3C;iBACF;gBACH,CAAC,CAAC,EAAE;YACN,aAAa,EAAE,2CAAc,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;SACrD,CAAC;QAEF,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;IAChC,CAAC;CACF;AArBD,gEAqBC","sourcesContent":["import {\n ApplicationListener,\n ApplicationProtocol,\n ListenerAction,\n SslPolicy,\n} from \"aws-cdk-lib/aws-elasticloadbalancingv2\";\nimport type { ApplicationListenerProps } from \"aws-cdk-lib/aws-elasticloadbalancingv2\";\nimport { GuAppAwareConstruct } from \"../../../utils/mixin/app-aware-construct\";\nimport type { GuCertificate } from \"../../acm\";\nimport type { AppIdentity, GuStack } from \"../../core\";\nimport type { GuApplicationTargetGroup } from \"./application-target-group\";\n\nexport interface GuApplicationListenerProps extends ApplicationListenerProps, AppIdentity {}\n\n/**\n * Construct which creates a Listener.\n *\n * This construct should be used in conjunction with [[`GuApplicationLoadBalancer`]] and [[`GuApplicationTargetGroup`]]\n * to route traffic to your application. For more details on these three components, see the\n * [AWS documentation](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html#application-load-balancer-components).\n *\n * If you are running an application which only accepts traffic over HTTPS, consider using [[`GuHttpsApplicationListener`]]\n * to reduce the amount of boilerplate needed when configuring your Listener.\n *\n * This resource is stateful.\n * @see https://github.com/guardian/cdk/blob/main/docs/stateful-resources.md\n */\nexport class GuApplicationListener extends GuAppAwareConstruct(ApplicationListener) {\n constructor(scope: GuStack, id: string, props: GuApplicationListenerProps) {\n super(scope, id, { port: 443, protocol: ApplicationProtocol.HTTPS, ...props });\n }\n}\n\nexport interface GuHttpsApplicationListenerProps\n extends Omit<GuApplicationListenerProps, \"defaultAction\" | \"certificates\">,\n AppIdentity {\n targetGroup: GuApplicationTargetGroup;\n certificate?: GuCertificate;\n}\n\n/**\n * Construct which creates a Listener which accepts HTTPS traffic.\n *\n * You must pass a [[`GuCertificate`]] to this Listener via the `certificate` prop.\n *\n * For general details about Listeners, see [[`GuApplicationListener`]].\n */\nexport class GuHttpsApplicationListener extends GuAppAwareConstruct(ApplicationListener) {\n constructor(scope: GuStack, id: string, props: GuHttpsApplicationListenerProps) {\n const { certificate, targetGroup } = props;\n\n const mergedProps: GuApplicationListenerProps = {\n port: certificate ? 443 : 8080,\n protocol: certificate ? ApplicationProtocol.HTTPS : ApplicationProtocol.HTTP,\n sslPolicy: certificate ? SslPolicy.RECOMMENDED_TLS : undefined,\n ...props,\n certificates: certificate\n ? [\n {\n certificateArn: certificate.certificateArn,\n },\n ]\n : [],\n defaultAction: ListenerAction.forward([targetGroup]),\n };\n\n super(scope, id, mergedProps);\n }\n}\n"]}
1
+ {"version":3,"file":"application-listener.js","sourceRoot":"","sources":["../../../../src/constructs/loadbalancing/alb/application-listener.ts"],"names":[],"mappings":";;;AAAA,uFAKgD;AAEhD,kFAA+E;AAO/E;;;;;;;;;;;;GAYG;AACH,MAAa,qBAAsB,SAAQ,IAAA,yCAAmB,EAAC,gDAAmB,CAAC;IACjF,YAAY,KAAc,EAAE,EAAU,EAAE,KAAiC;QACvE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,gDAAmB,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IACjF,CAAC;CACF;AAJD,sDAIC;AAQD;;;;;;GAMG;AACH,MAAa,0BAA2B,SAAQ,IAAA,yCAAmB,EAAC,gDAAmB,CAAC;IACtF,YAAY,KAAc,EAAE,EAAU,EAAE,KAAsC;QAC5E,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;QAE3C,MAAM,WAAW,GAA+B;YAC9C,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;YAC9B,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,gDAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,gDAAmB,CAAC,IAAI;YAC5E,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,sCAAS,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS;YAC9D,GAAG,KAAK;YACR,YAAY,EAAE,WAAW;gBACvB,CAAC,CAAC;oBACE;wBACE,cAAc,EAAE,WAAW,CAAC,cAAc;qBAC3C;iBACF;gBACH,CAAC,CAAC,EAAE;YACN,aAAa,EAAE,2CAAc,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;SACrD,CAAC;QAEF,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;IAChC,CAAC;CACF;AArBD,gEAqBC","sourcesContent":["import {\n ApplicationListener,\n ApplicationProtocol,\n ListenerAction,\n SslPolicy,\n} from \"aws-cdk-lib/aws-elasticloadbalancingv2\";\nimport type { ApplicationListenerProps } from \"aws-cdk-lib/aws-elasticloadbalancingv2\";\nimport { GuAppAwareConstruct } from \"../../../utils/mixin/app-aware-construct\";\nimport type { GuCertificate } from \"../../acm\";\nimport type { AppIdentity, GuStack } from \"../../core\";\nimport type { GuApplicationTargetGroup } from \"./application-target-group\";\n\nexport interface GuApplicationListenerProps extends ApplicationListenerProps, AppIdentity {}\n\n/**\n * Construct which creates a Listener.\n *\n * This construct should be used in conjunction with [[`GuApplicationLoadBalancer`]] and [[`GuApplicationTargetGroup`]]\n * to route traffic to your application. For more details on these three components, see the\n * [AWS documentation](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html#application-load-balancer-components).\n *\n * If you are running an application which only accepts traffic over HTTPS, consider using [[`GuHttpsApplicationListener`]]\n * to reduce the amount of boilerplate needed when configuring your Listener.\n *\n * This resource is stateful.\n * @see https://github.com/guardian/cdk/blob/main/docs/stateful-resources.md\n */\nexport class GuApplicationListener extends GuAppAwareConstruct(ApplicationListener) {\n constructor(scope: GuStack, id: string, props: GuApplicationListenerProps) {\n super(scope, id, { port: 443, protocol: ApplicationProtocol.HTTPS, ...props });\n }\n}\n\nexport interface GuHttpsApplicationListenerProps\n extends Omit<GuApplicationListenerProps, \"defaultAction\" | \"certificates\">, AppIdentity {\n targetGroup: GuApplicationTargetGroup;\n certificate?: GuCertificate;\n}\n\n/**\n * Construct which creates a Listener which accepts HTTPS traffic.\n *\n * You must pass a [[`GuCertificate`]] to this Listener via the `certificate` prop.\n *\n * For general details about Listeners, see [[`GuApplicationListener`]].\n */\nexport class GuHttpsApplicationListener extends GuAppAwareConstruct(ApplicationListener) {\n constructor(scope: GuStack, id: string, props: GuHttpsApplicationListenerProps) {\n const { certificate, targetGroup } = props;\n\n const mergedProps: GuApplicationListenerProps = {\n port: certificate ? 443 : 8080,\n protocol: certificate ? ApplicationProtocol.HTTPS : ApplicationProtocol.HTTP,\n sslPolicy: certificate ? SslPolicy.RECOMMENDED_TLS : undefined,\n ...props,\n certificates: certificate\n ? [\n {\n certificateArn: certificate.certificateArn,\n },\n ]\n : [],\n defaultAction: ListenerAction.forward([targetGroup]),\n };\n\n super(scope, id, mergedProps);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../../src/constructs/rds/instance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAe,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEpD,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,IAAI,CAAC;CACf;AAGD,MAAM,WAAW,MAAO,SAA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EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB;CAiBvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"instance.js","sourceRoot":"","sources":["../../../src/constructs/rds/instance.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AACvC,iDAAmD;AACnD,iDAAoE;AAEpE,+EAA4E;AA6B5E,MAAa,kBAAmB,SAAQ,IAAA,yCAAmB,EAAC,0BAAgB,CAAC;IAC3E,YAAY,KAAc,EAAE,EAAU,EAAE,KAA8B;QACpE,4CAA4C;QAC5C,yEAAyE;QACzE,yEAAyE;QACzE,MAAM,YAAY,GAAG,IAAI,sBAAY,CAAC,gBAAE,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAExF,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE;YACf,WAAW,EAAE,qBAAW,CAAC,GAAG;YAC5B,kBAAkB,EAAE,IAAI;YACxB,sBAAsB,EAAE,KAAK;YAC7B,eAAe,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe;YAC1F,qBAAqB,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,qBAAqB;YACtG,GAAG,KAAK;YACR,YAAY;SACb,CAAC,CAAC;QACH,kBAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9E,CAAC;CACF;AAlBD,gDAkBC","sourcesContent":["import { Fn, Tags } from \"aws-cdk-lib\";\nimport { InstanceType } from \"aws-cdk-lib/aws-ec2\";\nimport { DatabaseInstance, StorageType } from \"aws-cdk-lib/aws-rds\";\nimport type { DatabaseInstanceProps } from \"aws-cdk-lib/aws-rds\";\nimport { GuAppAwareConstruct } from \"../../utils/mixin/app-aware-construct\";\nimport type { AppIdentity, GuStack } from \"../core\";\n\nexport interface OptIn {\n enabled: true;\n}\n\n// Using Pick here means that we get the AWS documentation for these properties rather than needing to define it ourselves\nexport interface OptOut extends Pick<DatabaseInstanceProps, \"backupRetention\" | \"preferredBackupWindow\"> {\n enabled: false;\n /**\n * We recommend using DevX Backups where possible. If it is not suitable for your use-case please document\n * this here so that we can understand why this is switched off when performing security audits.\n */\n optOutReason: string;\n}\n\nexport interface GuDatabaseInstanceProps\n extends Omit<DatabaseInstanceProps, \"instanceType\" | \"backupRetention\" | \"preferredBackupWindow\">,\n AppIdentity {\n instanceType: string;\n /**\n * We recommend using DevX Backups to protect your RDS instance's backups.\n * For more details on this feature, see the\n * [documentation](https://docs.google.com/document/d/1VDCSxYFlWs4R6g0Waa6OmmfytV60AROyHxfIGho7cLA/edit#heading=h.vwt7syo8ng40).\n */\n devXBackups: OptIn | OptOut;\n}\n\nexport class GuDatabaseInstance extends GuAppAwareConstruct(DatabaseInstance) {\n constructor(scope: GuStack, id: string, props: GuDatabaseInstanceProps) {\n // CDK just wants \"t3.micro\" format, whereas\n // some CFN yaml might have the older \"db.t3.micro\" with the \"db.\" prefix\n // This logic ensures the \"db.\" prefix is removed before applying the CFN\n const instanceType = new InstanceType(Fn.join(\"\", Fn.split(\"db.\", props.instanceType)));\n\n super(scope, id, {\n storageType: StorageType.GP3,\n deletionProtection: true,\n deleteAutomatedBackups: false,\n backupRetention: props.devXBackups.enabled ? undefined : props.devXBackups.backupRetention,\n preferredBackupWindow: props.devXBackups.enabled ? undefined : props.devXBackups.preferredBackupWindow,\n ...props,\n instanceType,\n });\n Tags.of(this).add(\"devx-backup-enabled\", String(props.devXBackups.enabled));\n }\n}\n"]}
1
+ {"version":3,"file":"instance.js","sourceRoot":"","sources":["../../../src/constructs/rds/instance.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AACvC,iDAAmD;AACnD,iDAAoE;AAEpE,+EAA4E;AA4B5E,MAAa,kBAAmB,SAAQ,IAAA,yCAAmB,EAAC,0BAAgB,CAAC;IAC3E,YAAY,KAAc,EAAE,EAAU,EAAE,KAA8B;QACpE,4CAA4C;QAC5C,yEAAyE;QACzE,yEAAyE;QACzE,MAAM,YAAY,GAAG,IAAI,sBAAY,CAAC,gBAAE,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAExF,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE;YACf,WAAW,EAAE,qBAAW,CAAC,GAAG;YAC5B,kBAAkB,EAAE,IAAI;YACxB,sBAAsB,EAAE,KAAK;YAC7B,eAAe,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe;YAC1F,qBAAqB,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,qBAAqB;YACtG,GAAG,KAAK;YACR,YAAY;SACb,CAAC,CAAC;QACH,kBAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9E,CAAC;CACF;AAlBD,gDAkBC","sourcesContent":["import { Fn, Tags } from \"aws-cdk-lib\";\nimport { InstanceType } from \"aws-cdk-lib/aws-ec2\";\nimport { DatabaseInstance, StorageType } from \"aws-cdk-lib/aws-rds\";\nimport type { DatabaseInstanceProps } from \"aws-cdk-lib/aws-rds\";\nimport { GuAppAwareConstruct } from \"../../utils/mixin/app-aware-construct\";\nimport type { AppIdentity, GuStack } from \"../core\";\n\nexport interface OptIn {\n enabled: true;\n}\n\n// Using Pick here means that we get the AWS documentation for these properties rather than needing to define it ourselves\nexport interface OptOut extends Pick<DatabaseInstanceProps, \"backupRetention\" | \"preferredBackupWindow\"> {\n enabled: false;\n /**\n * We recommend using DevX Backups where possible. If it is not suitable for your use-case please document\n * this here so that we can understand why this is switched off when performing security audits.\n */\n optOutReason: string;\n}\n\nexport interface GuDatabaseInstanceProps\n extends Omit<DatabaseInstanceProps, \"instanceType\" | \"backupRetention\" | \"preferredBackupWindow\">, AppIdentity {\n instanceType: string;\n /**\n * We recommend using DevX Backups to protect your RDS instance's backups.\n * For more details on this feature, see the\n * [documentation](https://docs.google.com/document/d/1VDCSxYFlWs4R6g0Waa6OmmfytV60AROyHxfIGho7cLA/edit#heading=h.vwt7syo8ng40).\n */\n devXBackups: OptIn | OptOut;\n}\n\nexport class GuDatabaseInstance extends GuAppAwareConstruct(DatabaseInstance) {\n constructor(scope: GuStack, id: string, props: GuDatabaseInstanceProps) {\n // CDK just wants \"t3.micro\" format, whereas\n // some CFN yaml might have the older \"db.t3.micro\" with the \"db.\" prefix\n // This logic ensures the \"db.\" prefix is removed before applying the CFN\n const instanceType = new InstanceType(Fn.join(\"\", Fn.split(\"db.\", props.instanceType)));\n\n super(scope, id, {\n storageType: StorageType.GP3,\n deletionProtection: true,\n deleteAutomatedBackups: false,\n backupRetention: props.devXBackups.enabled ? undefined : props.devXBackups.backupRetention,\n preferredBackupWindow: props.devXBackups.enabled ? undefined : props.devXBackups.preferredBackupWindow,\n ...props,\n instanceType,\n });\n Tags.of(this).add(\"devx-backup-enabled\", String(props.devXBackups.enabled));\n }\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guardian/cdk",
3
3
  "description": "Generic Guardian flavoured AWS CDK components",
4
- "version": "62.3.0",
4
+ "version": "62.3.1",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "files": [
@@ -31,8 +31,8 @@
31
31
  "cli:dev": "ts-node src/bin/index.ts"
32
32
  },
33
33
  "devDependencies": {
34
- "@changesets/cli": "2.29.7",
35
- "@guardian/eslint-config": "13.0.0",
34
+ "@changesets/cli": "2.29.8",
35
+ "@guardian/eslint-config": "13.0.2",
36
36
  "@guardian/eslint-plugin-tsdoc-required": "^0.1.3",
37
37
  "@guardian/tsconfig": "^1.0.1",
38
38
  "@types/git-url-parse": "^9.0.3",
@@ -40,35 +40,35 @@
40
40
  "@types/js-yaml": "^4.0.9",
41
41
  "@types/node": "22.15.30",
42
42
  "@types/yargs": "^17.0.33",
43
- "aws-cdk": "2.1033.0",
44
- "aws-cdk-lib": "2.232.1",
45
- "constructs": "10.4.3",
46
- "eslint": "^9.34.0",
43
+ "aws-cdk": "2.1100.3",
44
+ "aws-cdk-lib": "2.234.1",
45
+ "constructs": "10.4.4",
46
+ "eslint": "^9.39.2",
47
47
  "eslint-plugin-custom-rules": "file:tools/eslint",
48
48
  "gh-pages": "^6.3.0",
49
49
  "jest": "^29.7.0",
50
- "prettier": "^3.6.2",
50
+ "prettier": "^3.8.1",
51
51
  "serve": "^14.2.5",
52
- "ts-jest": "^29.4.2",
52
+ "ts-jest": "^29.4.6",
53
53
  "ts-node": "^10.9.2",
54
- "typedoc": "^0.28.8",
54
+ "typedoc": "^0.28.16",
55
55
  "typescript": "5.1.6"
56
56
  },
57
57
  "dependencies": {
58
- "@aws-sdk/client-ec2": "^3.930.0",
59
- "@aws-sdk/client-ssm": "^3.925.0",
60
- "@aws-sdk/credential-providers": "^3.925.0",
58
+ "@aws-sdk/client-ec2": "^3.974.0",
59
+ "@aws-sdk/client-ssm": "^3.974.0",
60
+ "@aws-sdk/credential-providers": "^3.974.0",
61
61
  "@oclif/core": "3.26.6",
62
62
  "chalk": "^4.1.2",
63
- "codemaker": "^1.114.1",
63
+ "codemaker": "^1.125.0",
64
64
  "git-url-parse": "^16.0.1",
65
65
  "js-yaml": "^4.1.1",
66
66
  "read-pkg-up": "7.0.1",
67
67
  "yargs": "^17.7.2"
68
68
  },
69
69
  "peerDependencies": {
70
- "aws-cdk": "^2.1033.0",
71
- "aws-cdk-lib": "^2.232.1",
72
- "constructs": "^10.4.3"
70
+ "aws-cdk": "^2.1100.3",
71
+ "aws-cdk-lib": "^2.234.1",
72
+ "constructs": "^10.4.4"
73
73
  }
74
74
  }