@guardian/cdk 49.1.0-beta.1 → 49.2.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 +3 -2
- package/lib/constructs/autoscaling/asg.d.ts.map +1 -1
- package/lib/constructs/autoscaling/asg.js.map +1 -1
- package/lib/constructs/autoscaling/user-data.js +1 -1
- package/lib/constructs/autoscaling/user-data.js.map +1 -1
- package/lib/constructs/iam/policies/index.d.ts +0 -1
- package/lib/constructs/iam/policies/index.d.ts.map +1 -1
- package/lib/constructs/iam/policies/index.js +0 -1
- package/lib/constructs/iam/policies/index.js.map +1 -1
- package/lib/constructs/iam/roles/instance-role.d.ts.map +1 -1
- package/lib/constructs/iam/roles/instance-role.js +2 -1
- package/lib/constructs/iam/roles/instance-role.js.map +1 -1
- package/lib/constructs/s3/index.d.ts +0 -90
- package/lib/constructs/s3/index.d.ts.map +1 -1
- package/lib/constructs/s3/index.js +1 -33
- package/lib/constructs/s3/index.js.map +1 -1
- package/lib/experimental/riff-raff-yaml-file/deployments/cloudformation.d.ts +1 -1
- package/lib/experimental/riff-raff-yaml-file/deployments/cloudformation.d.ts.map +1 -1
- package/lib/experimental/riff-raff-yaml-file/deployments/cloudformation.js +19 -11
- package/lib/experimental/riff-raff-yaml-file/deployments/cloudformation.js.map +1 -1
- package/lib/experimental/riff-raff-yaml-file/index.d.ts +10 -22
- package/lib/experimental/riff-raff-yaml-file/index.d.ts.map +1 -1
- package/lib/experimental/riff-raff-yaml-file/index.js +22 -62
- package/lib/experimental/riff-raff-yaml-file/index.js.map +1 -1
- package/lib/experimental/riff-raff-yaml-file/types.d.ts +1 -1
- package/lib/experimental/riff-raff-yaml-file/types.d.ts.map +1 -1
- package/lib/experimental/riff-raff-yaml-file/types.js.map +1 -1
- package/lib/patterns/ec2-app/base.d.ts +2 -1
- package/lib/patterns/ec2-app/base.d.ts.map +1 -1
- package/lib/patterns/ec2-app/base.js.map +1 -1
- package/lib/types/amigo.d.ts +5 -0
- package/lib/types/amigo.d.ts.map +1 -0
- package/lib/types/amigo.js +3 -0
- package/lib/types/amigo.js.map +1 -0
- package/package.json +21 -21
- package/lib/constructs/iam/policies/ssm.d.ts +0 -8
- package/lib/constructs/iam/policies/ssm.d.ts.map +0 -1
- package/lib/constructs/iam/policies/ssm.js +0 -37
- package/lib/constructs/iam/policies/ssm.js.map +0 -1
- package/lib/experimental/riff-raff-yaml-file/deployments/s3.d.ts +0 -4
- package/lib/experimental/riff-raff-yaml-file/deployments/s3.d.ts.map +0 -1
- package/lib/experimental/riff-raff-yaml-file/deployments/s3.js +0 -48
- package/lib/experimental/riff-raff-yaml-file/deployments/s3.js.map +0 -1
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uploadStaticFilesDeployment = void 0;
|
|
4
|
-
function uploadStaticFilesDeployment(stages, originBucket, { name: cfnDeployName }) {
|
|
5
|
-
const { app, _deploymentProps } = originBucket;
|
|
6
|
-
const { withoutStageAwareness, baseParameterName, cacheControl, surrogateControl, mimeTypes } = _deploymentProps;
|
|
7
|
-
const { stack, region } = originBucket.stack;
|
|
8
|
-
const cacheControlValue = Object.entries(cacheControl).map(([pattern, duration]) => {
|
|
9
|
-
return {
|
|
10
|
-
pattern,
|
|
11
|
-
value: `public, max-age=${duration.toSeconds()}`,
|
|
12
|
-
};
|
|
13
|
-
});
|
|
14
|
-
const surrogateControlValue = Object.entries(surrogateControl).map(([pattern, duration]) => {
|
|
15
|
-
return {
|
|
16
|
-
pattern,
|
|
17
|
-
value: `public, max-age=${duration.toSeconds()}`,
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
name: ["upload-static-files", region, stack, app].join("-"),
|
|
22
|
-
props: {
|
|
23
|
-
type: "aws-s3",
|
|
24
|
-
actions: ["uploadStaticFiles"],
|
|
25
|
-
dependencies: [cfnDeployName],
|
|
26
|
-
stacks: new Set([stack]),
|
|
27
|
-
regions: new Set([region]),
|
|
28
|
-
app,
|
|
29
|
-
contentDirectory: app,
|
|
30
|
-
parameters: {
|
|
31
|
-
bucketSsmKeyStageParam: stages.reduce((acc, stage) => ({
|
|
32
|
-
...acc,
|
|
33
|
-
[stage]: withoutStageAwareness ? baseParameterName : `/${stage}${baseParameterName}`,
|
|
34
|
-
}), {}),
|
|
35
|
-
// Never create per object ACLs.
|
|
36
|
-
// If the bucket content needs to be public, it’s better to control this via the bucket policy.
|
|
37
|
-
publicReadAcl: false,
|
|
38
|
-
cacheControl: cacheControlValue.length > 0 ? cacheControlValue : "private",
|
|
39
|
-
// only add the `surrogateControl` property if there are some
|
|
40
|
-
...(surrogateControlValue.length > 0 && { surrogateControl: surrogateControlValue }),
|
|
41
|
-
// only add the `mimeTypes` property if there are some
|
|
42
|
-
...(Object.keys(mimeTypes).length > 0 && { mimeTypes }),
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
exports.uploadStaticFilesDeployment = uploadStaticFilesDeployment;
|
|
48
|
-
//# sourceMappingURL=s3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../../src/experimental/riff-raff-yaml-file/deployments/s3.ts"],"names":[],"mappings":";;;AAIA,SAAgB,2BAA2B,CACzC,MAAgB,EAChB,YAA8B,EAC9B,EAAE,IAAI,EAAE,aAAa,EAAsB;IAE3C,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,YAAY,CAAC;IAC/C,MAAM,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAAG,gBAAgB,CAAC;IACjH,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,KAAgB,CAAC;IAExD,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAA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,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS;gBAE1E,6DAA6D;gBAC7D,GAAG,CAAC,qBAAqB,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;gBAEpF,sDAAsD;gBACtD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;aACxD;SACF;KACF,CAAC;AACJ,CAAC;AAxDD,kEAwDC","sourcesContent":["import type { GuStack } from \"../../../constructs/core\";\nimport type { GuS3OriginBucket } from \"../../../constructs/s3\";\nimport type { RiffRaffDeployment } from \"../types\";\n\nexport function uploadStaticFilesDeployment(\n stages: string[],\n originBucket: GuS3OriginBucket,\n { name: cfnDeployName }: RiffRaffDeployment\n): RiffRaffDeployment {\n const { app, _deploymentProps } = originBucket;\n const { withoutStageAwareness, baseParameterName, cacheControl, surrogateControl, mimeTypes } = _deploymentProps;\n const { stack, region } = originBucket.stack as GuStack;\n\n const cacheControlValue = Object.entries(cacheControl).map(([pattern, duration]) => {\n return {\n pattern,\n value: `public, max-age=${duration.toSeconds()}`,\n };\n });\n\n const surrogateControlValue = Object.entries(surrogateControl).map(([pattern, duration]) => {\n return {\n pattern,\n value: `public, max-age=${duration.toSeconds()}`,\n };\n });\n\n return {\n name: [\"upload-static-files\", region, stack, app].join(\"-\"),\n props: {\n type: \"aws-s3\",\n actions: [\"uploadStaticFiles\"],\n dependencies: [cfnDeployName],\n stacks: new Set([stack]),\n regions: new Set([region]),\n app,\n contentDirectory: app,\n parameters: {\n bucketSsmKeyStageParam: stages.reduce(\n (acc, stage) => ({\n ...acc,\n [stage]: withoutStageAwareness ? baseParameterName : `/${stage}${baseParameterName}`,\n }),\n {}\n ),\n\n // Never create per object ACLs.\n // If the bucket content needs to be public, it’s better to control this via the bucket policy.\n publicReadAcl: false,\n\n cacheControl: cacheControlValue.length > 0 ? cacheControlValue : \"private\",\n\n // only add the `surrogateControl` property if there are some\n ...(surrogateControlValue.length > 0 && { surrogateControl: surrogateControlValue }),\n\n // only add the `mimeTypes` property if there are some\n ...(Object.keys(mimeTypes).length > 0 && { mimeTypes }),\n },\n },\n };\n}\n"]}
|