@guardian/cdk 55.0.0 → 56.0.0
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.
- package/lib/constructs/autoscaling/asg.d.ts.map +1 -1
- package/lib/constructs/autoscaling/asg.js +1 -0
- package/lib/constructs/autoscaling/asg.js.map +1 -1
- package/lib/constructs/core/stack.d.ts +8 -8
- package/lib/constructs/core/stack.d.ts.map +1 -1
- package/lib/constructs/core/stack.js +5 -20
- package/lib/constructs/core/stack.js.map +1 -1
- package/lib/constructs/loadbalancing/alb/application-load-balancer.d.ts +13 -0
- package/lib/constructs/loadbalancing/alb/application-load-balancer.d.ts.map +1 -1
- package/lib/constructs/loadbalancing/alb/application-load-balancer.js +16 -1
- package/lib/constructs/loadbalancing/alb/application-load-balancer.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asg.d.ts","sourceRoot":"","sources":["../../../src/constructs/autoscaling/asg.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAuB,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAuC,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAsB,MAAM,qBAAqB,CAAC;AAC5F,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;AAQpD,MAAM,WAAW,uBACf,SAAQ,IAAI,CACR,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O,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;AAQpD,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,GAAG,MAAM,CAAC;IAC5B,wBAAwB,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5C,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;;;;;;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,kBAAmB,SAAQ,uBAAqC;IAC3E,SAAgB,GAAG,EAAE,MAAM,CAAC;IAC5B,SAAgB,YAAY,EAAE,cAAc,CAAC;IAC7C,SAAgB,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;gBAEtC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB;CAwFvE"}
|
|
@@ -84,6 +84,7 @@ class GuAutoScalingGroup extends (0, app_aware_construct_1.GuAppAwareConstruct)(
|
|
|
84
84
|
// leaves it to the default value, which is actually false.
|
|
85
85
|
// { UpdatePolicy: { autoScalingScheduledAction: { IgnoreUnmodifiedGroupSizeProperties: true }}
|
|
86
86
|
cfnAsg.addDeletionOverride("UpdatePolicy");
|
|
87
|
+
aws_cdk_lib_1.Tags.of(launchTemplate).add("App", app);
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
exports.GuAutoScalingGroup = GuAutoScalingGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asg.js","sourceRoot":"","sources":["../../../src/constructs/autoscaling/asg.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"asg.js","sourceRoot":"","sources":["../../../src/constructs/autoscaling/asg.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,iEAA+D;AAE/D,iDAAoF;AAKpF,+EAA4E;AAC5E,kCAAyC;AAEzC,gCAAmE;AACnE,gCAAwC;AA0CxC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,kBAAmB,SAAQ,IAAA,yCAAmB,EAAC,kCAAgB,CAAC;IAK3E,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,gBAAgB,EAChB,gBAAgB,EAChB,IAAI,GAAG,IAAI,oBAAc,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EACzC,WAAW,EACX,QAAQ,EAAE,YAAY,EACtB,GAAG,EACH,aAAa,GAAG,KAAK,EACrB,uBAAuB,GACxB,GAAG,KAAK,CAAC;QAEV,qJAAqJ;QACrJ,IAAI,mBAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,mBAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE;YACjF,MAAM,IAAI,KAAK,CACb,oHAAoH,CACrH,CAAC;SACH;QAED,MAAM,QAAQ,GAAG,YAAY,YAAY,kBAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,kBAAQ,CAAC,MAAM,CA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,GAAG,CAAC;QACf,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,WAAW,IAAI,IAAI,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC;QAEhE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,YAAmC,CAAC;QAE7D,yFAAyF;QACzF,2DAA2D;QAC3D,+FAA+F;QAC/F,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAE3C,kBAAI,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;CACF;AA7FD,gDA6FC","sourcesContent":["import { Tags, Token } from \"aws-cdk-lib\";\nimport { AutoScalingGroup } from \"aws-cdk-lib/aws-autoscaling\";\nimport type { AutoScalingGroupProps, CfnAutoScalingGroup } from \"aws-cdk-lib/aws-autoscaling\";\nimport { LaunchTemplate, OperatingSystemType, UserData } from \"aws-cdk-lib/aws-ec2\";\nimport type { InstanceType, ISecurityGroup, MachineImageConfig } 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, GuWazuhAccess } from \"../ec2\";\nimport { GuInstanceRole } from \"../iam\";\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 | string;\n additionalSecurityGroups?: ISecurityGroup[];\n targetGroup?: ApplicationTargetGroup;\n withoutImdsv2?: boolean;\n httpPutResponseHopLimit?: number;\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 two security groups:\n * 1. [[`GuHttpsEgressSecurityGroup`]], which allows outbound traffic over HTTPS.\n * 2. [[`GuWazuhAccess`]], which allows instances to communicate with Wazuh (for security monitoring).\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 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 minimumInstances,\n maximumInstances,\n role = new GuInstanceRole(scope, { app }),\n targetGroup,\n userData: userDataLike,\n vpc,\n withoutImdsv2 = false,\n httpPutResponseHopLimit,\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 userData = userDataLike instanceof UserData ? userDataLike : UserData.custom(userDataLike);\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 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 requireImdsv2: !withoutImdsv2,\n userData,\n role,\n httpPutResponseHopLimit,\n });\n\n // Add Wazuh & 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 [GuWazuhAccess.getInstance(scope, vpc), ...additionalSecurityGroups].forEach((sg) =>\n launchTemplate.connections.addSecurityGroup(sg),\n );\n\n const asgProps = {\n ...props,\n launchTemplate,\n maxCapacity: maximumInstances ?? minimumInstances * 2,\n minCapacity: minimumInstances,\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 };\n\n super(scope, id, asgProps);\n\n this.app = app;\n this.amiParameter = imageId;\n this.imageRecipe = imageRecipe;\n\n targetGroup && this.attachToApplicationTargetGroup(targetGroup);\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 cfnAsg.addDeletionOverride(\"UpdatePolicy\");\n\n Tags.of(launchTemplate).add(\"App\", app);\n }\n}\n"]}
|
|
@@ -9,6 +9,10 @@ export interface GuStackProps extends Omit<StackProps, "stackName"> {
|
|
|
9
9
|
* This will be applied as a tag to all of your resources.
|
|
10
10
|
*/
|
|
11
11
|
stack: string;
|
|
12
|
+
/**
|
|
13
|
+
* The stage being used (as defined in your riff-raff.yaml).
|
|
14
|
+
* This will be applied as a tag to all of your resources.
|
|
15
|
+
*/
|
|
12
16
|
stage: string;
|
|
13
17
|
/**
|
|
14
18
|
* Optional name of the app. If defined, all resources will have an App tag.
|
|
@@ -67,18 +71,14 @@ export interface GuStackProps extends Omit<StackProps, "stackName"> {
|
|
|
67
71
|
* ```
|
|
68
72
|
*/
|
|
69
73
|
export declare class GuStack extends Stack implements StackStageIdentity {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
private readonly _repositoryName?;
|
|
74
|
-
get stage(): string;
|
|
75
|
-
get stack(): string;
|
|
76
|
-
get app(): string | undefined;
|
|
74
|
+
readonly stack: string;
|
|
75
|
+
readonly stage: string;
|
|
76
|
+
readonly app: string | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* The repository name, if it can be determined from the context or the git remote origin url.
|
|
79
79
|
* If it cannot be determined from either of these sources, it will be `undefined`.
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
readonly repositoryName: string | undefined;
|
|
82
82
|
/**
|
|
83
83
|
* A helper function to add a tag to all resources in a stack.
|
|
84
84
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/constructs/core/stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAc,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAwB,YAAY,EAA0B,KAAK,EAAQ,MAAM,aAAa,CAAC;AACtG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQ7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC;IACjE;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,OAAQ,SAAQ,KAAM,YAAW,kBAAkB;IAC9D,
|
|
1
|
+
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/constructs/core/stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAc,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAwB,YAAY,EAA0B,KAAK,EAAQ,MAAM,aAAa,CAAC;AACtG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQ7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAA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G,IAAI;CAQhG"}
|
|
@@ -40,22 +40,6 @@ const git_1 = require("../../utils/git");
|
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
42
|
class GuStack extends aws_cdk_lib_1.Stack {
|
|
43
|
-
get stage() {
|
|
44
|
-
return this._stage;
|
|
45
|
-
}
|
|
46
|
-
get stack() {
|
|
47
|
-
return this._stack;
|
|
48
|
-
}
|
|
49
|
-
get app() {
|
|
50
|
-
return this._app;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The repository name, if it can be determined from the context or the git remote origin url.
|
|
54
|
-
* If it cannot be determined from either of these sources, it will be `undefined`.
|
|
55
|
-
*/
|
|
56
|
-
get repositoryName() {
|
|
57
|
-
return this._repositoryName;
|
|
58
|
-
}
|
|
59
43
|
/**
|
|
60
44
|
* A helper function to add a tag to all resources in a stack.
|
|
61
45
|
*
|
|
@@ -84,7 +68,7 @@ class GuStack extends aws_cdk_lib_1.Stack {
|
|
|
84
68
|
}
|
|
85
69
|
// eslint-disable-next-line custom-rules/valid-constructors -- GuStack is the exception as it must take an App
|
|
86
70
|
constructor(scope, id, props) {
|
|
87
|
-
const { cloudFormationStackName = process.env.GU_CFN_STACK_NAME, stack, stage, withoutTags, withBackup = false, } = props;
|
|
71
|
+
const { cloudFormationStackName = process.env.GU_CFN_STACK_NAME, stack, stage, app, withoutTags, withBackup = false, } = props;
|
|
88
72
|
super(scope, id, {
|
|
89
73
|
...props,
|
|
90
74
|
stackName: cloudFormationStackName,
|
|
@@ -92,9 +76,10 @@ class GuStack extends aws_cdk_lib_1.Stack {
|
|
|
92
76
|
// see https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html#bootstrapping-custom-synth
|
|
93
77
|
synthesizer: new aws_cdk_lib_1.LegacyStackSynthesizer(),
|
|
94
78
|
});
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
79
|
+
this.stack = stack;
|
|
80
|
+
this.stage = stage.toUpperCase();
|
|
81
|
+
this.app = app;
|
|
82
|
+
this.repositoryName = this.tryGetRepositoryTag();
|
|
98
83
|
if (!withoutTags) {
|
|
99
84
|
this.addTag(constants_1.TrackingTag.Key, constants_1.TrackingTag.Value);
|
|
100
85
|
this.addTag("Stack", this.stack);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../src/constructs/core/stack.ts"],"names":[],"mappings":";;;;;;AACA,6CAAsG;AAEtG,kEAAwC;AACxC,yDAAwD;AACxD,6EAAwE;AACxE,iFAA4E;AAC5E,qDAAkD;AAClD,+CAAyE;AACzE,yCAAqD;AA8CrD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,OAAQ,SAAQ,mBAAK;IAMhC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;;;;;;;;OASG;IACO,MAAM,CAAC,GAAW,EAAE,KAAa,EAAE,2BAAoC,IAAI;QACnF,4CAA4C;QAC5C,wGAAwG;QACxG,kBAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACH,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI;aACb,OAAO,EAAE;aACT,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,YAAY,0BAAY,CAAC;aACxD,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC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} from \"aws-cdk-lib\";\nimport { Annotations, Aspects, CfnParameter, LegacyStackSynthesizer, Stack, Tags } from \"aws-cdk-lib\";\nimport type { IConstruct } from \"constructs\";\nimport gitUrlParse from \"git-url-parse\";\nimport { AwsBackupTag } from \"../../aspects/aws-backup\";\nimport { CfnIncludeReporter } from \"../../aspects/cfn-include-reporter\";\nimport { CfnParameterReporter } from \"../../aspects/cfn-parameter-reporter\";\nimport { Metadata } from \"../../aspects/metadata\";\nimport { ContextKeys, MetadataKeys, TrackingTag } from \"../../constants\";\nimport { gitRemoteOriginUrl } from \"../../utils/git\";\nimport type { StackStageIdentity } from \"./identity\";\nimport type { GuStaticLogicalId } from \"./migrating\";\n\nexport interface GuStackProps extends Omit<StackProps, \"stackName\"> {\n /**\n * The Guardian stack being used (as defined in your riff-raff.yaml).\n * This will be applied as a tag to all of your resources.\n */\n stack: string;\n\n stage: string;\n\n /**\n * Optional name of the app. If defined, all resources will have an App tag.\n */\n app?: string;\n\n /**\n * The AWS CloudFormation stack name (as shown in the AWS CloudFormation UI).\n * @defaultValue the `GU_CFN_STACK_NAME` environment variable\n */\n cloudFormationStackName?: string;\n /**\n * Set this to true to stop the GuStack from tagging all of your AWS resources.\n * This should only be turned on as part of an initial migration from CloudFormation.\n */\n withoutTags?: boolean;\n\n /**\n * Set to disable CDK metadata. Only for internal use (for disabling for some\n * snapshot tests). We rely on tracking data to prioritise future work so\n * please do not override this.\n */\n withoutMetadata?: boolean;\n\n /**\n * Set to enable all resources in the stack for backup provided by https://github.com/guardian/aws-backup.\n *\n * @default false - backups are not enabled\n *\n * @see https://github.com/guardian/aws-backup\n */\n withBackup?: boolean;\n}\n\n/**\n * GuStack provides the `stack` and `stage` parameters to a template.\n * It also takes the `app` in the constructor.\n *\n * GuStack will add the Stack, Stage and App tags to all resources.\n *\n * GuStack also adds the tag `X-Gu-CDK-Version`.\n * This tag allows us to measure adoption of this library.\n * It's value is the version of guardian/cdk being used, as defined in `package.json`.\n * As a result, the change sets between version numbers will be fairly noisy,\n * as all resources receive a tag update.\n * It is recommended to upgrade the version of @guardian/cdk being used in two steps:\n * 1. Bump the library, apply the tag updates\n * 2. Make any other stack changes\n *\n * Typical usage is to extend GuStack:\n *\n * ```typescript\n * class MyStack extends GuStack {\n * constructor(scope: App, id: string, props: GuStackProps) {\n * super(scope, id, props)\n * }\n *\n * // add resources here\n * }\n * ```\n */\nexport class GuStack extends Stack implements StackStageIdentity {\n private readonly _stack: string;\n private readonly _stage: string;\n private readonly _app?: string;\n private readonly _repositoryName?: string;\n\n get stage(): string {\n return this._stage;\n }\n\n get stack(): string {\n return this._stack;\n }\n\n get app(): string | undefined {\n return this._app;\n }\n\n /**\n * The repository name, if it can be determined from the context or the git remote origin url.\n * If it cannot be determined from either of these sources, it will be `undefined`.\n */\n get repositoryName(): string | undefined {\n return this._repositoryName;\n }\n\n /**\n * A helper function to add a tag to all resources in a stack.\n *\n * Note: tags will be listed in alphabetical order during synthesis.\n *\n * @param key the tag name\n * @param value the value of the tag\n * @param applyToLaunchedInstances whether or not to apply the tag to instances launched in an ASG.\n * @protected\n */\n protected addTag(key: string, value: string, applyToLaunchedInstances: boolean = true): void {\n // TODO add validation for `key` and `value`\n // see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html\n Tags.of(this).add(key, value, { applyToLaunchedInstances });\n }\n\n /**\n * Returns all the parameters on this stack.\n *\n * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html\n */\n get parameters(): Record<string, CfnParameter> {\n return this.node\n .findAll()\n .filter((construct) => construct instanceof CfnParameter)\n .reduce((acc, param) => ({ ...acc, [param.node.id]: param as CfnParameter }), {});\n }\n\n // eslint-disable-next-line custom-rules/valid-constructors -- GuStack is the exception as it must take an App\n constructor(scope: App, id: string, props: GuStackProps) {\n const {\n cloudFormationStackName = process.env.GU_CFN_STACK_NAME,\n stack,\n stage,\n withoutTags,\n withBackup = false,\n } = props;\n\n super(scope, id, {\n ...props,\n stackName: cloudFormationStackName,\n\n // TODO Use `DefaultStackSynthesizer` or create own synthesizer?\n // see https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html#bootstrapping-custom-synth\n synthesizer: new LegacyStackSynthesizer(),\n });\n\n this._stack = stack;\n this._stage = stage.toUpperCase();\n this._repositoryName = this.tryGetRepositoryTag();\n\n if (!withoutTags) {\n this.addTag(TrackingTag.Key, TrackingTag.Value);\n\n this.addTag(\"Stack\", this.stack);\n this.addTag(\"Stage\", this.stage);\n if (this.app) {\n this.addTag(\"App\", this.app);\n }\n\n if (this.repositoryName) {\n this.addTag(MetadataKeys.REPOSITORY_NAME, this.repositoryName);\n }\n }\n\n if (!props.withoutMetadata) {\n Aspects.of(this).add(new Metadata(this));\n }\n\n Aspects.of(this).add(new CfnIncludeReporter());\n Aspects.of(this).add(new CfnParameterReporter());\n\n if (withBackup) {\n Aspects.of(this).add(new AwsBackupTag());\n }\n }\n\n /**\n * Returns the repository name.\n * The value is retrieved in the following order:\n * 1. From the context\n * 2. From git config\n *\n * @private\n */\n private tryGetRepositoryTag(): string | undefined {\n try {\n const urlFromContext = this.node.tryGetContext(ContextKeys.REPOSITORY_URL) as string | undefined;\n const repositoryUrl: string = urlFromContext ?? gitRemoteOriginUrl();\n return gitUrlParse(repositoryUrl).full_name;\n } catch {\n console.info(\n `Unable to find git repository name. Set the ${ContextKeys.REPOSITORY_URL} context value or configure a git remote`,\n );\n return undefined;\n }\n }\n\n /**\n * Override the auto-generated logical ID for a resource, in the generated CloudFormation template, with a static one.\n *\n * Of particular use when migrating a JSON/YAML CloudFormation template into GuCDK.\n * It's generally advised to retain the logical ID for stateful resources, such as databases or buckets.\n *\n * Let's say we have a YAML template:\n *\n * ```yaml\n * AWSTemplateFormatVersion: '2010-09-09'\n * Resources:\n * UsesTable:\n * Type: AWS::DynamoDB::Table\n * Properties:\n * TableName: !Sub 'users-${stage}'\n * ```\n *\n * When moving to GuCDK we'll have this:\n *\n * class MyStack extends GuStack {\n * constructor(app: App, id: string, props: GuStackProps) {\n * super(app, id, props);\n *\n * const { stage } = this;\n *\n * new Table(this, \"UsersTable\", {\n * name: `users-${stage}`\n * });\n * }\n * }\n *\n * During synthesis, CDK auto-generates logical IDs, so we'll have a stack with a DynamoDB table named 'UsersTable<SOME GUID>', NOT `UsersTable`.\n * That is, the `UsersTable` table will be deleted.\n *\n * In order to retain the original ID from the YAML template, we will do:\n *\n * class MyStack extends GuStack {\n * constructor(app: App, id: string, props: GuStackProps) {\n * super(app, id, props);\n *\n * const { stage } = this;\n *\n * const table = new Table(this, \"UsersTable\", {\n * name: `users-${stage}`\n * });\n *\n * this.overrideLogicalId(table, { logicalId: \"UsersTable\", reason: \"Retaining a stateful resource from the YAML template\" });\n * }\n * }\n *\n * @param construct The (stateful) resource to retain the logical ID of.\n * @param logicalId The logical ID of the resource (as defined in the JSON/YAML template.\n * @param reason A small explanation to keep the logical ID. Mainly used to help future developers.\n */\n public overrideLogicalId(construct: IConstruct, { logicalId, reason }: GuStaticLogicalId): void {\n const {\n node: { id, defaultChild },\n } = construct;\n\n (defaultChild as CfnElement).overrideLogicalId(logicalId);\n Annotations.of(construct).addInfo(`Setting logical ID for ${id} to ${logicalId}. Reason: ${reason}`);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../src/constructs/core/stack.ts"],"names":[],"mappings":";;;;;;AACA,6CAAsG;AAEtG,kEAAwC;AACxC,yDAAwD;AACxD,6EAAwE;AACxE,iFAA4E;AAC5E,qDAAkD;AAClD,+CAAyE;AACzE,yCAAqD;AAkDrD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,OAAQ,SAAQ,mBAAK;IAWhC;;;;;;;;;OASG;IACO,MAAM,CAAC,GAAW,EAAE,KAAa,EAAE,2BAAoC,IAAI;QACnF,4CAA4C;QAC5C,wGAAwG;QACxG,kBAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GA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I,iBAAiB,CAAC,SAAqB,EAAE,EAAE,SAAS,EAAE,MAAM,EAAqB;QACtF,MAAM,EACJ,IAAI,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,GAC3B,GAAG,SAAS,CAAC;QAEb,YAA2B,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC1D,yBAAW,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,OAAO,SAAS,aAAa,MAAM,EAAE,CAAC,CAAC;IACvG,CAAC;CACF;AA7KD,0BA6KC","sourcesContent":["import type { App, CfnElement, StackProps } from \"aws-cdk-lib\";\nimport { Annotations, Aspects, CfnParameter, LegacyStackSynthesizer, Stack, Tags } from \"aws-cdk-lib\";\nimport type { IConstruct } from \"constructs\";\nimport gitUrlParse from \"git-url-parse\";\nimport { AwsBackupTag } from \"../../aspects/aws-backup\";\nimport { CfnIncludeReporter } from \"../../aspects/cfn-include-reporter\";\nimport { CfnParameterReporter } from \"../../aspects/cfn-parameter-reporter\";\nimport { Metadata } from \"../../aspects/metadata\";\nimport { ContextKeys, MetadataKeys, TrackingTag } from \"../../constants\";\nimport { gitRemoteOriginUrl } from \"../../utils/git\";\nimport type { StackStageIdentity } from \"./identity\";\nimport type { GuStaticLogicalId } from \"./migrating\";\n\nexport interface GuStackProps extends Omit<StackProps, \"stackName\"> {\n /**\n * The Guardian stack being used (as defined in your riff-raff.yaml).\n * This will be applied as a tag to all of your resources.\n */\n stack: string;\n\n /**\n * The stage being used (as defined in your riff-raff.yaml).\n * This will be applied as a tag to all of your resources.\n */\n stage: string;\n\n /**\n * Optional name of the app. If defined, all resources will have an App tag.\n */\n app?: string;\n\n /**\n * The AWS CloudFormation stack name (as shown in the AWS CloudFormation UI).\n * @defaultValue the `GU_CFN_STACK_NAME` environment variable\n */\n cloudFormationStackName?: string;\n /**\n * Set this to true to stop the GuStack from tagging all of your AWS resources.\n * This should only be turned on as part of an initial migration from CloudFormation.\n */\n withoutTags?: boolean;\n\n /**\n * Set to disable CDK metadata. Only for internal use (for disabling for some\n * snapshot tests). We rely on tracking data to prioritise future work so\n * please do not override this.\n */\n withoutMetadata?: boolean;\n\n /**\n * Set to enable all resources in the stack for backup provided by https://github.com/guardian/aws-backup.\n *\n * @default false - backups are not enabled\n *\n * @see https://github.com/guardian/aws-backup\n */\n withBackup?: boolean;\n}\n\n/**\n * GuStack provides the `stack` and `stage` parameters to a template.\n * It also takes the `app` in the constructor.\n *\n * GuStack will add the Stack, Stage and App tags to all resources.\n *\n * GuStack also adds the tag `X-Gu-CDK-Version`.\n * This tag allows us to measure adoption of this library.\n * It's value is the version of guardian/cdk being used, as defined in `package.json`.\n * As a result, the change sets between version numbers will be fairly noisy,\n * as all resources receive a tag update.\n * It is recommended to upgrade the version of @guardian/cdk being used in two steps:\n * 1. Bump the library, apply the tag updates\n * 2. Make any other stack changes\n *\n * Typical usage is to extend GuStack:\n *\n * ```typescript\n * class MyStack extends GuStack {\n * constructor(scope: App, id: string, props: GuStackProps) {\n * super(scope, id, props)\n * }\n *\n * // add resources here\n * }\n * ```\n */\nexport class GuStack extends Stack implements StackStageIdentity {\n public readonly stack: string;\n public readonly stage: string;\n public readonly app: string | undefined;\n\n /**\n * The repository name, if it can be determined from the context or the git remote origin url.\n * If it cannot be determined from either of these sources, it will be `undefined`.\n */\n public readonly repositoryName: string | undefined;\n\n /**\n * A helper function to add a tag to all resources in a stack.\n *\n * Note: tags will be listed in alphabetical order during synthesis.\n *\n * @param key the tag name\n * @param value the value of the tag\n * @param applyToLaunchedInstances whether or not to apply the tag to instances launched in an ASG.\n * @protected\n */\n protected addTag(key: string, value: string, applyToLaunchedInstances: boolean = true): void {\n // TODO add validation for `key` and `value`\n // see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html\n Tags.of(this).add(key, value, { applyToLaunchedInstances });\n }\n\n /**\n * Returns all the parameters on this stack.\n *\n * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html\n */\n get parameters(): Record<string, CfnParameter> {\n return this.node\n .findAll()\n .filter((construct) => construct instanceof CfnParameter)\n .reduce((acc, param) => ({ ...acc, [param.node.id]: param as CfnParameter }), {});\n }\n\n // eslint-disable-next-line custom-rules/valid-constructors -- GuStack is the exception as it must take an App\n constructor(scope: App, id: string, props: GuStackProps) {\n const {\n cloudFormationStackName = process.env.GU_CFN_STACK_NAME,\n stack,\n stage,\n app,\n withoutTags,\n withBackup = false,\n } = props;\n\n super(scope, id, {\n ...props,\n stackName: cloudFormationStackName,\n\n // TODO Use `DefaultStackSynthesizer` or create own synthesizer?\n // see https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html#bootstrapping-custom-synth\n synthesizer: new LegacyStackSynthesizer(),\n });\n\n this.stack = stack;\n this.stage = stage.toUpperCase();\n this.app = app;\n this.repositoryName = this.tryGetRepositoryTag();\n\n if (!withoutTags) {\n this.addTag(TrackingTag.Key, TrackingTag.Value);\n\n this.addTag(\"Stack\", this.stack);\n this.addTag(\"Stage\", this.stage);\n if (this.app) {\n this.addTag(\"App\", this.app);\n }\n\n if (this.repositoryName) {\n this.addTag(MetadataKeys.REPOSITORY_NAME, this.repositoryName);\n }\n }\n\n if (!props.withoutMetadata) {\n Aspects.of(this).add(new Metadata(this));\n }\n\n Aspects.of(this).add(new CfnIncludeReporter());\n Aspects.of(this).add(new CfnParameterReporter());\n\n if (withBackup) {\n Aspects.of(this).add(new AwsBackupTag());\n }\n }\n\n /**\n * Returns the repository name.\n * The value is retrieved in the following order:\n * 1. From the context\n * 2. From git config\n *\n * @private\n */\n private tryGetRepositoryTag(): string | undefined {\n try {\n const urlFromContext = this.node.tryGetContext(ContextKeys.REPOSITORY_URL) as string | undefined;\n const repositoryUrl: string = urlFromContext ?? gitRemoteOriginUrl();\n return gitUrlParse(repositoryUrl).full_name;\n } catch {\n console.info(\n `Unable to find git repository name. Set the ${ContextKeys.REPOSITORY_URL} context value or configure a git remote`,\n );\n return undefined;\n }\n }\n\n /**\n * Override the auto-generated logical ID for a resource, in the generated CloudFormation template, with a static one.\n *\n * Of particular use when migrating a JSON/YAML CloudFormation template into GuCDK.\n * It's generally advised to retain the logical ID for stateful resources, such as databases or buckets.\n *\n * Let's say we have a YAML template:\n *\n * ```yaml\n * AWSTemplateFormatVersion: '2010-09-09'\n * Resources:\n * UsesTable:\n * Type: AWS::DynamoDB::Table\n * Properties:\n * TableName: !Sub 'users-${stage}'\n * ```\n *\n * When moving to GuCDK we'll have this:\n *\n * class MyStack extends GuStack {\n * constructor(app: App, id: string, props: GuStackProps) {\n * super(app, id, props);\n *\n * const { stage } = this;\n *\n * new Table(this, \"UsersTable\", {\n * name: `users-${stage}`\n * });\n * }\n * }\n *\n * During synthesis, CDK auto-generates logical IDs, so we'll have a stack with a DynamoDB table named 'UsersTable<SOME GUID>', NOT `UsersTable`.\n * That is, the `UsersTable` table will be deleted.\n *\n * In order to retain the original ID from the YAML template, we will do:\n *\n * class MyStack extends GuStack {\n * constructor(app: App, id: string, props: GuStackProps) {\n * super(app, id, props);\n *\n * const { stage } = this;\n *\n * const table = new Table(this, \"UsersTable\", {\n * name: `users-${stage}`\n * });\n *\n * this.overrideLogicalId(table, { logicalId: \"UsersTable\", reason: \"Retaining a stateful resource from the YAML template\" });\n * }\n * }\n *\n * @param construct The (stateful) resource to retain the logical ID of.\n * @param logicalId The logical ID of the resource (as defined in the JSON/YAML template.\n * @param reason A small explanation to keep the logical ID. Mainly used to help future developers.\n */\n public overrideLogicalId(construct: IConstruct, { logicalId, reason }: GuStaticLogicalId): void {\n const {\n node: { id, defaultChild },\n } = construct;\n\n (defaultChild as CfnElement).overrideLogicalId(logicalId);\n Annotations.of(construct).addInfo(`Setting logical ID for ${id} to ${logicalId}. Reason: ${reason}`);\n }\n}\n"]}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { ApplicationLoadBalancer } from "aws-cdk-lib/aws-elasticloadbalancingv2";
|
|
2
2
|
import type { ApplicationLoadBalancerProps } from "aws-cdk-lib/aws-elasticloadbalancingv2";
|
|
3
3
|
import type { AppIdentity, GuStack } from "../../core";
|
|
4
|
+
/**
|
|
5
|
+
* Adds the following headers to each request before forwarding it to the target:
|
|
6
|
+
* - `x-amzn-tls-version`, which has information about the TLS protocol version negotiated with the client
|
|
7
|
+
* - `x-amzn-tls-cipher-suite`, which has information about the cipher suite negotiated with the client
|
|
8
|
+
*
|
|
9
|
+
* Both headers are in OpenSSL format.
|
|
10
|
+
*/
|
|
11
|
+
export declare const TLS_VERSION_AND_CIPHER_SUITE_HEADERS_ENABLED = "routing.http.x_amzn_tls_version_and_cipher_suite.enabled";
|
|
12
|
+
/**
|
|
13
|
+
* Indicates whether HTTP headers with invalid header fields are removed by the load balancer.
|
|
14
|
+
* Invalid headers are described as HTTP header names that do not conform to the regular expression [-A-Za-z0-9]+
|
|
15
|
+
*/
|
|
16
|
+
export declare const DROP_INVALID_HEADER_FIELDS_ENABLED = "routing.http.drop_invalid_header_fields.enabled";
|
|
4
17
|
interface GuApplicationLoadBalancerProps extends ApplicationLoadBalancerProps, AppIdentity {
|
|
5
18
|
/**
|
|
6
19
|
* If your CloudFormation does not define the Type of your Load Balancer, you must set this boolean to true to avoid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-load-balancer.d.ts","sourceRoot":"","sources":["../../../../src/constructs/loadbalancing/alb/application-load-balancer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAE,4BAA4B,EAAmB,MAAM,wCAAwC,CAAC;AAE5G,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvD,UAAU,8BAA+B,SAAQ,4BAA4B,EAAE,WAAW;IACxF;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;;;;;;AAED;;;;;;;;;GASG;AACH,qBAAa,yBAA0B,SAAQ,8BAA4C;gBAC7E,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"application-load-balancer.d.ts","sourceRoot":"","sources":["../../../../src/constructs/loadbalancing/alb/application-load-balancer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAE,4BAA4B,EAAmB,MAAM,wCAAwC,CAAC;AAE5G,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,4CAA4C,6DAA6D,CAAC;AAEvH;;;GAGG;AACH,eAAO,MAAM,kCAAkC,oDAAoD,CAAC;AAEpG,UAAU,8BAA+B,SAAQ,4BAA4B,EAAE,WAAW;IACxF;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;;;;;;AAED;;;;;;;;;GASG;AACH,qBAAa,yBAA0B,SAAQ,8BAA4C;gBAC7E,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;CAgB9E"}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GuApplicationLoadBalancer = void 0;
|
|
3
|
+
exports.GuApplicationLoadBalancer = exports.DROP_INVALID_HEADER_FIELDS_ENABLED = exports.TLS_VERSION_AND_CIPHER_SUITE_HEADERS_ENABLED = void 0;
|
|
4
4
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
5
|
const aws_elasticloadbalancingv2_1 = require("aws-cdk-lib/aws-elasticloadbalancingv2");
|
|
6
6
|
const app_aware_construct_1 = require("../../../utils/mixin/app-aware-construct");
|
|
7
|
+
/**
|
|
8
|
+
* Adds the following headers to each request before forwarding it to the target:
|
|
9
|
+
* - `x-amzn-tls-version`, which has information about the TLS protocol version negotiated with the client
|
|
10
|
+
* - `x-amzn-tls-cipher-suite`, which has information about the cipher suite negotiated with the client
|
|
11
|
+
*
|
|
12
|
+
* Both headers are in OpenSSL format.
|
|
13
|
+
*/
|
|
14
|
+
exports.TLS_VERSION_AND_CIPHER_SUITE_HEADERS_ENABLED = "routing.http.x_amzn_tls_version_and_cipher_suite.enabled";
|
|
15
|
+
/**
|
|
16
|
+
* Indicates whether HTTP headers with invalid header fields are removed by the load balancer.
|
|
17
|
+
* Invalid headers are described as HTTP header names that do not conform to the regular expression [-A-Za-z0-9]+
|
|
18
|
+
*/
|
|
19
|
+
exports.DROP_INVALID_HEADER_FIELDS_ENABLED = "routing.http.drop_invalid_header_fields.enabled";
|
|
7
20
|
/**
|
|
8
21
|
* Construct which creates an Application Load Balancer.
|
|
9
22
|
*
|
|
@@ -17,6 +30,8 @@ const app_aware_construct_1 = require("../../../utils/mixin/app-aware-construct"
|
|
|
17
30
|
class GuApplicationLoadBalancer extends (0, app_aware_construct_1.GuAppAwareConstruct)(aws_elasticloadbalancingv2_1.ApplicationLoadBalancer) {
|
|
18
31
|
constructor(scope, id, props) {
|
|
19
32
|
super(scope, id, { deletionProtection: true, ...props });
|
|
33
|
+
this.setAttribute(exports.TLS_VERSION_AND_CIPHER_SUITE_HEADERS_ENABLED, "true");
|
|
34
|
+
this.setAttribute(exports.DROP_INVALID_HEADER_FIELDS_ENABLED, "true");
|
|
20
35
|
if (props.removeType) {
|
|
21
36
|
const cfnLb = this.node.defaultChild;
|
|
22
37
|
cfnLb.addPropertyDeletionOverride("Type");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-load-balancer.js","sourceRoot":"","sources":["../../../../src/constructs/loadbalancing/alb/application-load-balancer.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AACxC,uFAAiF;AAEjF,kFAA+E;
|
|
1
|
+
{"version":3,"file":"application-load-balancer.js","sourceRoot":"","sources":["../../../../src/constructs/loadbalancing/alb/application-load-balancer.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AACxC,uFAAiF;AAEjF,kFAA+E;AAG/E;;;;;;GAMG;AACU,QAAA,4CAA4C,GAAG,0DAA0D,CAAC;AAEvH;;;GAGG;AACU,QAAA,kCAAkC,GAAG,iDAAiD,CAAC;AAWpG;;;;;;;;;GASG;AACH,MAAa,yBAA0B,SAAQ,IAAA,yCAAmB,EAAC,oDAAuB,CAAC;IACzF,YAAY,KAAc,EAAE,EAAU,EAAE,KAAqC;QAC3E,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;QAEzD,IAAI,CAAC,YAAY,CAAC,oDAA4C,EAAE,MAAM,CAAC,CAAC;QACxE,IAAI,CAAC,YAAY,CAAC,0CAAkC,EAAE,MAAM,CAAC,CAAC;QAE9D,IAAI,KAAK,CAAC,UAAU,EAAE;YACpB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,YAA+B,CAAC;YACxD,KAAK,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;SAC3C;QAED,IAAI,uBAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,UAAU,EAAE;YAC/C,WAAW,EAAE,iBAAiB,IAAI,CAAC,SAAS,EAAE;YAC9C,KAAK,EAAE,IAAI,CAAC,mBAAmB;SAChC,CAAC,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC,SAAS,SAAS,CAAC,CAAC;IACnD,CAAC;CACF;AAjBD,8DAiBC","sourcesContent":["import { CfnOutput } from \"aws-cdk-lib\";\nimport { ApplicationLoadBalancer } from \"aws-cdk-lib/aws-elasticloadbalancingv2\";\nimport type { ApplicationLoadBalancerProps, CfnLoadBalancer } from \"aws-cdk-lib/aws-elasticloadbalancingv2\";\nimport { GuAppAwareConstruct } from \"../../../utils/mixin/app-aware-construct\";\nimport type { AppIdentity, GuStack } from \"../../core\";\n\n/**\n * Adds the following headers to each request before forwarding it to the target:\n * - `x-amzn-tls-version`, which has information about the TLS protocol version negotiated with the client\n * - `x-amzn-tls-cipher-suite`, which has information about the cipher suite negotiated with the client\n *\n * Both headers are in OpenSSL format.\n */\nexport const TLS_VERSION_AND_CIPHER_SUITE_HEADERS_ENABLED = \"routing.http.x_amzn_tls_version_and_cipher_suite.enabled\";\n\n/**\n * Indicates whether HTTP headers with invalid header fields are removed by the load balancer.\n * Invalid headers are described as HTTP header names that do not conform to the regular expression [-A-Za-z0-9]+\n */\nexport const DROP_INVALID_HEADER_FIELDS_ENABLED = \"routing.http.drop_invalid_header_fields.enabled\";\n\ninterface GuApplicationLoadBalancerProps extends ApplicationLoadBalancerProps, AppIdentity {\n /**\n * If your CloudFormation does not define the Type of your Load Balancer, you must set this boolean to true to avoid\n * resource [replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.html#cfn-elasticloadbalancingv2-loadbalancer-type).\n * If a Load Balancer is replaced it is likely to lead to downtime.\n */\n removeType?: boolean;\n}\n\n/**\n * Construct which creates an Application Load Balancer.\n *\n * This construct should be used in conjunction with [[`GuApplicationListener`]] 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 * This resource is stateful.\n * @see https://github.com/guardian/cdk/blob/main/docs/stateful-resources.md\n */\nexport class GuApplicationLoadBalancer extends GuAppAwareConstruct(ApplicationLoadBalancer) {\n constructor(scope: GuStack, id: string, props: GuApplicationLoadBalancerProps) {\n super(scope, id, { deletionProtection: true, ...props });\n\n this.setAttribute(TLS_VERSION_AND_CIPHER_SUITE_HEADERS_ENABLED, \"true\");\n this.setAttribute(DROP_INVALID_HEADER_FIELDS_ENABLED, \"true\");\n\n if (props.removeType) {\n const cfnLb = this.node.defaultChild as CfnLoadBalancer;\n cfnLb.addPropertyDeletionOverride(\"Type\");\n }\n\n new CfnOutput(this, `${this.idWithApp}-DnsName`, {\n description: `DNS entry for ${this.idWithApp}`,\n value: this.loadBalancerDnsName,\n }).overrideLogicalId(`${this.idWithApp}DnsName`);\n }\n}\n"]}
|