@fy-stack/app-construct 0.0.147-alpha.3061 → 0.0.147-alpha.30611

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.
Files changed (78) hide show
  1. package/dist/index.d.ts +5 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +11 -5
  4. package/dist/lib/ecs/apps/image-app-construct.js +1 -1
  5. package/dist/lib/ecs/apps/next-app-router-construct.d.ts.map +1 -1
  6. package/dist/lib/ecs/apps/next-app-router-construct.js +13 -16
  7. package/dist/lib/ecs/apps/task-construct.js +1 -1
  8. package/dist/lib/ecs/shared/taskDefinitionImage.d.ts.map +1 -1
  9. package/dist/lib/ecs/shared/taskDefinitionImage.js +2 -3
  10. package/dist/lib/ecs/types.d.ts +1 -0
  11. package/dist/lib/ecs/types.d.ts.map +1 -1
  12. package/dist/lib/lambda/apps/image-app-construct.d.ts +9 -43
  13. package/dist/lib/lambda/apps/image-app-construct.d.ts.map +1 -1
  14. package/dist/lib/lambda/apps/image-app-construct.js +9 -17
  15. package/dist/lib/lambda/apps/next-app-router-construct.d.ts +6 -9
  16. package/dist/lib/lambda/apps/next-app-router-construct.d.ts.map +1 -1
  17. package/dist/lib/lambda/apps/next-app-router-construct.js +33 -13
  18. package/dist/lib/lambda/apps/node-api-construct.d.ts +2 -13
  19. package/dist/lib/lambda/apps/node-api-construct.d.ts.map +1 -1
  20. package/dist/lib/lambda/apps/node-api-construct.js +19 -10
  21. package/dist/lib/lambda/apps/node-app-construct.d.ts +2 -13
  22. package/dist/lib/lambda/apps/node-app-construct.d.ts.map +1 -1
  23. package/dist/lib/lambda/apps/node-app-construct.js +16 -9
  24. package/dist/lib/lambda/types.d.ts +3 -1
  25. package/dist/lib/lambda/types.d.ts.map +1 -1
  26. package/dist/lib/lambda/utils/lambda-attach.js +1 -1
  27. package/dist/lib/shared/code-deployment.d.ts +4 -0
  28. package/dist/lib/shared/code-deployment.d.ts.map +1 -0
  29. package/dist/lib/shared/code-deployment.js +21 -0
  30. package/dist/lib/shared/code-from-param.d.ts +7 -0
  31. package/dist/lib/shared/code-from-param.d.ts.map +1 -0
  32. package/dist/lib/shared/code-from-param.js +12 -0
  33. package/dist/lib/shared/container-from-param.d.ts +7 -0
  34. package/dist/lib/shared/container-from-param.d.ts.map +1 -0
  35. package/dist/lib/shared/container-from-param.js +12 -0
  36. package/dist/lib/shared/container.d.ts +6 -0
  37. package/dist/lib/shared/container.d.ts.map +1 -0
  38. package/dist/lib/shared/container.js +11 -0
  39. package/dist/lib/shared/next-app-router.d.ts +12 -3
  40. package/dist/lib/shared/next-app-router.d.ts.map +1 -1
  41. package/dist/lib/shared/next-app-router.js +41 -46
  42. package/dist/lib/shared/params-from-attachable.d.ts +5 -0
  43. package/dist/lib/shared/params-from-attachable.d.ts.map +1 -0
  44. package/dist/lib/shared/params-from-attachable.js +11 -0
  45. package/dist/lib/shared/public-bucket.d.ts +4 -0
  46. package/dist/lib/shared/public-bucket.d.ts.map +1 -0
  47. package/dist/lib/shared/public-bucket.js +23 -0
  48. package/dist/lib/standalone/image-app-container.d.ts +6 -2
  49. package/dist/lib/standalone/image-app-container.d.ts.map +1 -1
  50. package/dist/lib/standalone/image-app-container.js +17 -7
  51. package/dist/lib/standalone/next-app-router-code.d.ts +9 -0
  52. package/dist/lib/standalone/next-app-router-code.d.ts.map +1 -0
  53. package/dist/lib/standalone/next-app-router-code.js +53 -0
  54. package/dist/lib/standalone/next-app-router-container.d.ts +5 -2
  55. package/dist/lib/standalone/next-app-router-container.d.ts.map +1 -1
  56. package/dist/lib/standalone/next-app-router-container.js +29 -16
  57. package/dist/lib/standalone/node-api-code.d.ts +10 -0
  58. package/dist/lib/standalone/node-api-code.d.ts.map +1 -0
  59. package/dist/lib/standalone/node-api-code.js +14 -0
  60. package/dist/lib/standalone/node-app-code.d.ts +9 -0
  61. package/dist/lib/standalone/node-app-code.d.ts.map +1 -0
  62. package/dist/lib/standalone/node-app-code.js +41 -0
  63. package/dist/lib/standalone/types.d.ts +1 -3
  64. package/dist/lib/standalone/types.d.ts.map +1 -1
  65. package/dist/lib/static/apps/next-pages-export-construct.d.ts +2 -5
  66. package/dist/lib/static/apps/next-pages-export-construct.d.ts.map +1 -1
  67. package/dist/lib/static/apps/next-pages-export-construct.js +1 -3
  68. package/dist/lib/static/apps/static-website-construct.d.ts +3 -7
  69. package/dist/lib/static/apps/static-website-construct.d.ts.map +1 -1
  70. package/dist/lib/static/apps/static-website-construct.js +2 -1
  71. package/dist/lib/static/types.d.ts +1 -1
  72. package/dist/lib/static/types.d.ts.map +1 -1
  73. package/dist/lib/util/constants.d.ts +3 -23
  74. package/dist/lib/util/constants.d.ts.map +1 -1
  75. package/dist/lib/util/public-bucket.d.ts +4 -0
  76. package/dist/lib/util/public-bucket.d.ts.map +1 -0
  77. package/dist/lib/util/public-bucket.js +23 -0
  78. package/package.json +4 -4
@@ -6,29 +6,36 @@ const aws_cdk_lib_1 = require("aws-cdk-lib");
6
6
  const aws_apigatewayv2_integrations_1 = require("aws-cdk-lib/aws-apigatewayv2-integrations");
7
7
  const lambda = tslib_1.__importStar(require("aws-cdk-lib/aws-lambda"));
8
8
  const aws_lambda_event_sources_1 = require("aws-cdk-lib/aws-lambda-event-sources");
9
+ const s3 = tslib_1.__importStar(require("aws-cdk-lib/aws-s3"));
9
10
  const snsSubscriptions = tslib_1.__importStar(require("aws-cdk-lib/aws-sns-subscriptions"));
10
11
  const aws_sqs_1 = require("aws-cdk-lib/aws-sqs");
11
12
  const constructs_1 = require("constructs");
12
- const zod_1 = require("zod");
13
+ const code_from_param_1 = require("../../shared/code-from-param");
13
14
  const getDefaultLambda_1 = require("../utils/getDefaultLambda");
14
15
  const lambda_attach_1 = require("../utils/lambda-attach");
15
16
  const lambda_grant_1 = require("../utils/lambda-grant");
16
- const BuildParamsSchema = zod_1.z
17
- .object({ handler: zod_1.z.string().optional() })
18
- .passthrough();
19
17
  class NodeAppConstruct extends constructs_1.Construct {
20
18
  function;
21
19
  queue;
22
20
  constructor(scope, id, props) {
23
21
  super(scope, id);
24
- if (!('output' in props)) {
25
- throw new Error('Output is required');
22
+ let code;
23
+ let handler;
24
+ if ('reference' in props) {
25
+ const params = (0, code_from_param_1.codeFromSSM)(this, props.reference, props.version);
26
+ const artifactBucket = s3.Bucket.fromBucketName(this, 'ArtifactBucket', params.artifact);
27
+ code = lambda.Code.fromBucketV2(artifactBucket, params.code);
28
+ handler = params.cmd;
29
+ }
30
+ else {
31
+ code = lambda.Code.fromAsset(props.output);
32
+ handler = props.buildParams.handler ?? 'index.handler';
26
33
  }
27
34
  this.function = new lambda.Function(this, `AppFunction`, {
28
35
  ...(0, getDefaultLambda_1.getDefaultLambda)(props),
29
36
  runtime: lambda.Runtime.NODEJS_20_X,
30
- handler: props.buildParams.handler ?? 'index.handler',
31
- code: lambda.Code.fromAsset(props.output),
37
+ handler,
38
+ code,
32
39
  });
33
40
  if (props.queue) {
34
41
  const { batchSize, ...queueProps } = props.queue;
@@ -71,7 +78,7 @@ class NodeAppConstruct extends constructs_1.Construct {
71
78
  };
72
79
  }
73
80
  static parse(params) {
74
- return BuildParamsSchema.parse(params);
81
+ return params;
75
82
  }
76
83
  }
77
84
  exports.NodeAppConstruct = NodeAppConstruct;
@@ -14,11 +14,13 @@ export interface AppConstruct extends Attach, Grant, CDNResource, EventResource,
14
14
  }
15
15
  export type App = {
16
16
  type: typeof AppType.IMAGE_APP | typeof AppType.NEXT_APP_ROUTER | typeof AppType.NODE_APP | typeof AppType.NODE_API;
17
- } & Omit<AppProperties, 'vpc' | 'logGroup'>;
17
+ } & Omit<AppProperties, 'vpc' | 'logGroup'> & AppResource;
18
18
  export type AppResource = {
19
19
  output: string;
20
+ cmd: string;
20
21
  } | {
21
22
  reference: string;
23
+ version?: string;
22
24
  };
23
25
  export type AppProperties<BuildParams = Record<string, unknown>> = {
24
26
  logGroup: ILogGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/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,EACA,OAAO,OAAO,CAAC,SAAS,GACxB,OAAO,OAAO,CAAC,eAAe,GAC9B,OAAO,OAAO,CAAC,QAAQ,GACvB,OAAO,OAAO,CAAC,QAAQ,CAAC;CAC7B,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,UAAU,CAAC,GACzC,WAAW,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C,MAAM,MAAM,aAAa,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACjE,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAClD,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;CAC3B,GAAG,WAAW,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lambdaAttach = lambdaAttach;
4
- const params_from_attachable_1 = require("../../util/params-from-attachable");
4
+ const params_from_attachable_1 = require("../../shared/params-from-attachable");
5
5
  function lambdaAttach(func, attachable) {
6
6
  const params = {};
7
7
  Object.assign(params, ...(0, params_from_attachable_1.paramsFromAttachable)(attachable));
@@ -0,0 +1,4 @@
1
+ import * as s3 from 'aws-cdk-lib/aws-s3';
2
+ import { Construct } from 'constructs';
3
+ export declare function codeDeployment(scope: Construct, bucket: s3.IBucket, output: string, version: string): string;
4
+ //# sourceMappingURL=code-deployment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-deployment.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/code-deployment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,EAAE,CAAC,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,UAqBhB"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.codeDeployment = codeDeployment;
4
+ const tslib_1 = require("tslib");
5
+ const cdk = tslib_1.__importStar(require("aws-cdk-lib"));
6
+ const s3Deploy = tslib_1.__importStar(require("aws-cdk-lib/aws-s3-deployment"));
7
+ function codeDeployment(scope, bucket, output, version) {
8
+ const codeFiles = s3Deploy.Source.asset(output);
9
+ const codePrefix = `${version}/assets/code`;
10
+ const codeDeployment = new s3Deploy.BucketDeployment(scope, `CodeDeployment`, {
11
+ destinationBucket: bucket,
12
+ sources: [codeFiles],
13
+ destinationKeyPrefix: codePrefix,
14
+ retainOnDelete: true,
15
+ extract: false,
16
+ });
17
+ return cdk.Fn.join('/', [
18
+ codePrefix,
19
+ cdk.Fn.select(0, codeDeployment.objectKeys),
20
+ ]);
21
+ }
@@ -0,0 +1,7 @@
1
+ import { Construct } from 'constructs';
2
+ export declare function codeFromSSM(scope: Construct, reference: string, version?: string): {
3
+ artifact: string;
4
+ code: string;
5
+ cmd: string;
6
+ };
7
+ //# sourceMappingURL=code-from-param.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-from-param.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/code-from-param.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,SAAW;;;;EAmBnB"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.codeFromSSM = codeFromSSM;
4
+ const tslib_1 = require("tslib");
5
+ const ssm = tslib_1.__importStar(require("aws-cdk-lib/aws-ssm"));
6
+ function codeFromSSM(scope, reference, version = 'latest') {
7
+ return {
8
+ artifact: ssm.StringParameter.fromStringParameterName(scope, `CodeArtifactStorageParamV${version}`, `/${reference}/${version}/artifacts`).stringValue,
9
+ code: ssm.StringParameter.fromStringParameterName(scope, `CodeFilesKeyParamV${version}`, `/${reference}/${version}/code`).stringValue,
10
+ cmd: ssm.StringParameter.fromStringParameterName(scope, `CodeCMDParamV${version}`, `/${reference}/${version}/code/handler`).stringValue,
11
+ };
12
+ }
@@ -0,0 +1,7 @@
1
+ import { Construct } from 'constructs';
2
+ export declare function containerParamsFromSSM(scope: Construct, reference: string, version?: string): {
3
+ repository: string;
4
+ tag: string;
5
+ cmd: string;
6
+ };
7
+ //# sourceMappingURL=container-from-param.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-from-param.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/container-from-param.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,SAAW;;;;EAmBnB"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.containerParamsFromSSM = containerParamsFromSSM;
4
+ const tslib_1 = require("tslib");
5
+ const ssm = tslib_1.__importStar(require("aws-cdk-lib/aws-ssm"));
6
+ function containerParamsFromSSM(scope, reference, version = 'latest') {
7
+ return {
8
+ repository: ssm.StringParameter.fromStringParameterName(scope, `RepositoryNameV${version}`, `/${reference}/${version}/repository`).stringValue,
9
+ tag: ssm.StringParameter.fromStringParameterName(scope, `VersionNumberV${version}`, `/${reference}/${version}/tag`).stringValue,
10
+ cmd: ssm.StringParameter.fromStringParameterName(scope, `ImageCMDV${version}`, `/${reference}/${version}/cmd`).stringValue,
11
+ };
12
+ }
@@ -0,0 +1,6 @@
1
+ import { Construct } from 'constructs';
2
+ export declare function containerParamsFromSSM(scope: Construct, reference: string): {
3
+ repository: string;
4
+ tag: string;
5
+ };
6
+ //# sourceMappingURL=container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/container.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM;;;EAazE"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.containerParamsFromSSM = containerParamsFromSSM;
4
+ const tslib_1 = require("tslib");
5
+ const ssm = tslib_1.__importStar(require("aws-cdk-lib/aws-ssm"));
6
+ function containerParamsFromSSM(scope, reference) {
7
+ return {
8
+ repository: ssm.StringParameter.fromStringParameterName(scope, 'RepositoryName', `/${reference}/repository`).stringValue,
9
+ tag: ssm.StringParameter.fromStringParameterName(scope, 'VersionNumber', `/${reference}/tag`).stringValue,
10
+ };
11
+ }
@@ -4,6 +4,7 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
4
4
  import * as s3Deploy from 'aws-cdk-lib/aws-s3-deployment';
5
5
  import { Construct } from 'constructs';
6
6
  export type AppFile = {
7
+ artifactBucket: s3.IBucket;
7
8
  staticFiles?: {
8
9
  deployment?: s3Deploy.BucketDeployment;
9
10
  key: string;
@@ -13,8 +14,16 @@ export type AppFile = {
13
14
  key: string;
14
15
  };
15
16
  };
16
- export declare function staticDeployment(app: Construct, output: string): {
17
- staticBucket: cdk.aws_s3.Bucket;
17
+ export declare function filesFromSSM(scope: Construct, reference: string, version?: string): {
18
+ artifact: string;
19
+ publicFiles: {
20
+ key: string;
21
+ };
22
+ staticFiles: {
23
+ key: string;
24
+ };
25
+ };
26
+ export declare function staticDeployment(app: Construct, bucket: s3.IBucket, output: string, version?: string): {
18
27
  files: {
19
28
  staticFiles: {
20
29
  deployment: cdk.aws_s3_deployment.BucketDeployment;
@@ -26,7 +35,7 @@ export declare function staticDeployment(app: Construct, output: string): {
26
35
  };
27
36
  };
28
37
  };
29
- export declare function cloudfrontBehaviours(app: Construct, staticBucket: s3.IBucket, serverOrigin: cloudfront.IOrigin, basePath: string, files: AppFile, isLambda?: boolean): {
38
+ export declare function cloudfrontBehaviours(scope: Construct, staticBucket: s3.IBucket, serverOrigin: cloudfront.IOrigin, basePath: string, files: AppFile, isLambda?: boolean): {
30
39
  [x: string]: cdk.aws_cloudfront.BehaviorOptions;
31
40
  };
32
41
  //# sourceMappingURL=next-app-router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"next-app-router.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/next-app-router.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,OAAO,GAAG;IACpB,WAAW,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE,WAAW,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;QAAC,G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AED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,EAAE,CAAC,OAAO,EACxB,YAAY,EAAE,UAAU,CAAC,OAAO,EAChC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,QAAQ,UAAQ;;EAkGjB"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filesFromSSM = filesFromSSM;
3
4
  exports.staticDeployment = staticDeployment;
4
5
  exports.cloudfrontBehaviours = cloudfrontBehaviours;
5
6
  const tslib_1 = require("tslib");
@@ -7,39 +8,35 @@ const node_path_1 = tslib_1.__importDefault(require("node:path"));
7
8
  const cdk = tslib_1.__importStar(require("aws-cdk-lib"));
8
9
  const cloudfront = tslib_1.__importStar(require("aws-cdk-lib/aws-cloudfront"));
9
10
  const cloudfrontOrigin = tslib_1.__importStar(require("aws-cdk-lib/aws-cloudfront-origins"));
10
- const s3 = tslib_1.__importStar(require("aws-cdk-lib/aws-s3"));
11
11
  const s3Deploy = tslib_1.__importStar(require("aws-cdk-lib/aws-s3-deployment"));
12
12
  const ssm = tslib_1.__importStar(require("aws-cdk-lib/aws-ssm"));
13
- function staticDeployment(app, output) {
14
- const staticBucket = new s3.Bucket(app, `StaticBucket`, {
15
- removalPolicy: cdk.RemovalPolicy.DESTROY,
16
- autoDeleteObjects: true,
17
- blockPublicAccess: s3.BlockPublicAccess.BLOCK_ACLS_ONLY,
18
- publicReadAccess: true,
19
- websiteIndexDocument: 'index.html',
20
- websiteErrorDocument: 'index.html',
21
- cors: [
22
- {
23
- allowedHeaders: ['*'],
24
- allowedOrigins: ['*'],
25
- allowedMethods: [s3.HttpMethods.GET, s3.HttpMethods.HEAD],
26
- },
27
- ],
28
- });
13
+ function filesFromSSM(scope, reference, version = 'latest') {
14
+ return {
15
+ artifact: ssm.StringParameter.fromStringParameterName(scope, `ArtifactStorageParamV${version}`, `/${reference}/${version}/artifacts`).stringValue,
16
+ publicFiles: {
17
+ key: ssm.StringParameter.fromStringParameterName(scope, `PublicFilesParamV${version}`, `/${reference}/${version}/files/publicFiles/key`).stringValue,
18
+ },
19
+ staticFiles: {
20
+ key: ssm.StringParameter.fromStringParameterName(scope, `StaticFilesParamV${version}`, `/${reference}/${version}/files/staticFiles/key`).stringValue,
21
+ },
22
+ };
23
+ }
24
+ function staticDeployment(app, bucket, output, version) {
29
25
  const staticFiles = s3Deploy.Source.asset(node_path_1.default.join(output, '/.next/static'));
30
26
  const publicFiles = s3Deploy.Source.asset(node_path_1.default.join(output, '/public'));
27
+ const staticPrefix = version ? `${version}/assets/static` : 'assets/static';
28
+ const publicPrefix = version ? `${version}/assets/public` : 'assets/public';
31
29
  const staticDeployment = new s3Deploy.BucketDeployment(app, `StaticAssetDeployment`, {
32
- destinationBucket: staticBucket,
30
+ destinationBucket: bucket,
33
31
  sources: [staticFiles],
34
- destinationKeyPrefix: 'assets/static',
32
+ destinationKeyPrefix: staticPrefix,
35
33
  retainOnDelete: false,
36
34
  extract: false,
37
35
  });
38
36
  const publicDeployment = new s3Deploy.BucketDeployment(app, `PublicAssetDeployment`, {
39
- destinationBucket: staticBucket,
37
+ destinationBucket: bucket,
40
38
  sources: [publicFiles],
41
- destinationKeyPrefix: 'assets/public',
42
- prune: false,
39
+ destinationKeyPrefix: publicPrefix,
43
40
  retainOnDelete: false,
44
41
  extract: false,
45
42
  });
@@ -47,14 +44,14 @@ function staticDeployment(app, output) {
47
44
  staticFiles: {
48
45
  deployment: staticDeployment,
49
46
  key: cdk.Fn.join('/', [
50
- 'assets/static',
47
+ staticPrefix,
51
48
  cdk.Fn.select(0, staticDeployment.objectKeys),
52
49
  ]),
53
50
  },
54
51
  publicFiles: {
55
52
  deployment: publicDeployment,
56
53
  key: cdk.Fn.join('/', [
57
- 'assets/public',
54
+ publicPrefix,
58
55
  cdk.Fn.select(0, publicDeployment.objectKeys),
59
56
  ]),
60
57
  },
@@ -62,29 +59,13 @@ function staticDeployment(app, output) {
62
59
  if (!files.publicFiles || !files.staticFiles) {
63
60
  throw new Error('Failed to deploy static and public files');
64
61
  }
65
- return { staticBucket, files };
62
+ return { files };
66
63
  }
67
- function cloudfrontBehaviours(app, staticBucket, serverOrigin, basePath, files, isLambda = false) {
64
+ function cloudfrontBehaviours(scope, staticBucket, serverOrigin, basePath, files, isLambda = false) {
68
65
  const strippedBasePath = basePath.replace(/^\/+|\/+$/g, '');
69
- if (files.staticFiles) {
70
- const staticFiles = s3Deploy.Source.bucket(staticBucket, files.staticFiles.key);
71
- const deployment = new s3Deploy.BucketDeployment(app, `${strippedBasePath}StaticDeployment`, {
72
- prune: false,
73
- destinationBucket: staticBucket,
74
- sources: [staticFiles],
75
- destinationKeyPrefix: strippedBasePath
76
- ? `${strippedBasePath}/_next/static/`
77
- : '_next/static/',
78
- retainOnDelete: false,
79
- });
80
- if (files.staticFiles.deployment) {
81
- deployment.node.addDependency(files.staticFiles.deployment);
82
- }
83
- }
84
66
  if (files.publicFiles) {
85
- const publicFiles = s3Deploy.Source.bucket(staticBucket, files.publicFiles.key);
86
- const deployment = new s3Deploy.BucketDeployment(app, `${strippedBasePath}PublicDeployment`, {
87
- prune: false,
67
+ const publicFiles = s3Deploy.Source.bucket(files.artifactBucket, files.publicFiles.key);
68
+ const deployment = new s3Deploy.BucketDeployment(scope, `${strippedBasePath}PublicDeployment`, {
88
69
  destinationBucket: staticBucket,
89
70
  sources: [publicFiles],
90
71
  destinationKeyPrefix: strippedBasePath
@@ -96,6 +77,20 @@ function cloudfrontBehaviours(app, staticBucket, serverOrigin, basePath, files,
96
77
  deployment.node.addDependency(files.publicFiles.deployment);
97
78
  }
98
79
  }
80
+ if (files.staticFiles) {
81
+ const staticFiles = s3Deploy.Source.bucket(files.artifactBucket, files.staticFiles.key);
82
+ const deployment = new s3Deploy.BucketDeployment(scope, `${strippedBasePath}StaticDeployment`, {
83
+ destinationBucket: staticBucket,
84
+ sources: [staticFiles],
85
+ destinationKeyPrefix: strippedBasePath
86
+ ? `${strippedBasePath}/_next/static/`
87
+ : '_next/static/',
88
+ retainOnDelete: false,
89
+ });
90
+ if (files.staticFiles.deployment) {
91
+ deployment.node.addDependency(files.staticFiles.deployment);
92
+ }
93
+ }
99
94
  const staticOrigin = new cloudfrontOrigin.S3StaticWebsiteOrigin(staticBucket);
100
95
  const staticBehavior = {
101
96
  origin: staticOrigin,
@@ -105,8 +100,8 @@ function cloudfrontBehaviours(app, staticBucket, serverOrigin, basePath, files,
105
100
  compress: true,
106
101
  viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
107
102
  };
108
- const imageCachePolicyID = ssm.StringParameter.fromStringParameterName(app, 'NextAppRouterImagePolicyArn', '/fy-stack/ImagePolicyID');
109
- const imageCachePolicy = cloudfront.CachePolicy.fromCachePolicyId(app, 'ImagePolicy', imageCachePolicyID.stringValue);
103
+ const imageCachePolicyID = ssm.StringParameter.fromStringParameterName(scope, 'NextAppRouterImagePolicyArn', '/fy-stack/ImagePolicyID');
104
+ const imageCachePolicy = cloudfront.CachePolicy.fromCachePolicyId(scope, 'ImagePolicy', imageCachePolicyID.stringValue);
110
105
  const appBehaviour = {
111
106
  origin: serverOrigin,
112
107
  cachePolicy: cloudfront.CachePolicy.CACHING_DISABLED,
@@ -0,0 +1,5 @@
1
+ import { Attachable } from '@fy-stack/types';
2
+ export declare function paramsFromAttachable(attachable: Record<string, Attachable>): {
3
+ [k: string]: string;
4
+ }[];
5
+ //# sourceMappingURL=params-from-attachable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params-from-attachable.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/params-from-attachable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;;IAS1E"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paramsFromAttachable = paramsFromAttachable;
4
+ function paramsFromAttachable(attachable) {
5
+ return Object.entries(attachable).map(([key, val]) => {
6
+ return Object.fromEntries(Object.entries(val?.attachable() ?? {}).map(([subKey, subVal]) => [
7
+ `${key}_${subKey}`.toUpperCase(),
8
+ subVal,
9
+ ]));
10
+ });
11
+ }
@@ -0,0 +1,4 @@
1
+ import * as cdk from 'aws-cdk-lib';
2
+ import type { Construct } from 'constructs';
3
+ export declare function publicBucket(scope: Construct, id: string): cdk.aws_s3.Bucket;
4
+ //# sourceMappingURL=public-bucket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-bucket.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/public-bucket.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,qBAgBxD"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.publicBucket = publicBucket;
4
+ const tslib_1 = require("tslib");
5
+ const cdk = tslib_1.__importStar(require("aws-cdk-lib"));
6
+ const s3 = tslib_1.__importStar(require("aws-cdk-lib/aws-s3"));
7
+ function publicBucket(scope, id) {
8
+ return new s3.Bucket(scope, id, {
9
+ removalPolicy: cdk.RemovalPolicy.DESTROY,
10
+ autoDeleteObjects: true,
11
+ blockPublicAccess: s3.BlockPublicAccess.BLOCK_ACLS_ONLY,
12
+ publicReadAccess: true,
13
+ websiteIndexDocument: 'index.html',
14
+ websiteErrorDocument: 'index.html',
15
+ cors: [
16
+ {
17
+ allowedHeaders: ['*'],
18
+ allowedOrigins: ['*'],
19
+ allowedMethods: [s3.HttpMethods.GET, s3.HttpMethods.HEAD],
20
+ },
21
+ ],
22
+ });
23
+ }
@@ -1,6 +1,10 @@
1
+ import type { DockerImageAssetOptions } from 'aws-cdk-lib/aws-ecr-assets';
1
2
  import { Construct } from 'constructs';
2
- import type { StandaloneContainer } from './types';
3
- export type ImageAppProps = StandaloneContainer;
3
+ import type { StandaloneApp } from './types';
4
+ export type ImageAppProps = StandaloneApp & {
5
+ container?: DockerImageAssetOptions;
6
+ cmd: string[];
7
+ };
4
8
  export declare class ImageAppContainer extends Construct {
5
9
  constructor(scope: Construct, id: string, props: ImageAppProps);
6
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"image-app-container.d.ts","sourceRoot":"","sources":["../../../src/lib/standalone/image-app-container.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAEhD,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa;CA+B/D"}
1
+ {"version":3,"file":"image-app-container.d.ts","sourceRoot":"","sources":["../../../src/lib/standalone/image-app-container.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAI1E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG;IAC1C,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,GAAG,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa;CA+C/D"}
@@ -25,13 +25,23 @@ class ImageAppContainer extends constructs_1.Construct {
25
25
  src: new ecrDeployment.DockerImageName(container.imageUri),
26
26
  dest: new ecrDeployment.DockerImageName(cdk.Fn.join(':', [repo.repositoryUri, props.version])),
27
27
  });
28
- new ssm.StringParameter(this, 'OutputParams', {
29
- parameterName: stackName,
30
- stringValue: JSON.stringify({
31
- repository: repo.repositoryName,
32
- tag: props.version,
33
- }),
34
- });
28
+ const versions = [props.version, 'latest'];
29
+ const parameters = [];
30
+ for (const v of versions) {
31
+ parameters.push(new ssm.StringParameter(this, `RepositoryParamV${v}`, {
32
+ parameterName: `/${stackName}/${v}/repository`,
33
+ stringValue: repo.repositoryName,
34
+ }), new ssm.StringParameter(this, `TagParamV${v}`, {
35
+ parameterName: `/${stackName}/${v}/tag`,
36
+ stringValue: props.version,
37
+ }), new ssm.StringParameter(this, `ImageCMDV${v}`, {
38
+ parameterName: `/${stackName}/${v}/cmd`,
39
+ stringValue: props.cmd.map((i) => i.trim()).join(','),
40
+ }));
41
+ }
42
+ for (const p of parameters) {
43
+ p.applyRemovalPolicy(cdk.RemovalPolicy.RETAIN);
44
+ }
35
45
  }
36
46
  }
37
47
  exports.ImageAppContainer = ImageAppContainer;
@@ -0,0 +1,9 @@
1
+ import { Construct } from 'constructs';
2
+ import type { StandaloneApp } from './types';
3
+ export type NextAppRouterProps = StandaloneApp & {
4
+ cmd: string;
5
+ };
6
+ export declare class NextAppRouterCode extends Construct {
7
+ constructor(scope: Construct, id: string, props: NextAppRouterProps);
8
+ }
9
+ //# sourceMappingURL=next-app-router-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-app-router-code.d.ts","sourceRoot":"","sources":["../../../src/lib/standalone/next-app-router-code.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;CA0DpE"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NextAppRouterCode = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
6
+ const node_path_1 = tslib_1.__importDefault(require("node:path"));
7
+ const cdk = tslib_1.__importStar(require("aws-cdk-lib"));
8
+ const s3 = tslib_1.__importStar(require("aws-cdk-lib/aws-s3"));
9
+ const ssm = tslib_1.__importStar(require("aws-cdk-lib/aws-ssm"));
10
+ const constructs_1 = require("constructs");
11
+ const code_deployment_1 = require("../shared/code-deployment");
12
+ const next_app_router_1 = require("../shared/next-app-router");
13
+ class NextAppRouterCode extends constructs_1.Construct {
14
+ constructor(scope, id, props) {
15
+ super(scope, id);
16
+ const stackName = cdk.Stack.of(this).stackName;
17
+ const artifactBucket = new s3.Bucket(this, 'ArtifactStorage', {
18
+ removalPolicy: cdk.RemovalPolicy.DESTROY,
19
+ autoDeleteObjects: true,
20
+ });
21
+ const deployment = (0, next_app_router_1.staticDeployment)(this, artifactBucket, props.output, props.version);
22
+ const serverOutput = node_path_1.default.join(props.output, '/.next/standalone');
23
+ node_fs_1.default.writeFileSync(node_path_1.default.join(serverOutput, 'run.sh'), props.cmd);
24
+ const code = (0, code_deployment_1.codeDeployment)(this, artifactBucket, serverOutput, props.version);
25
+ const versions = [props.version, 'latest'];
26
+ const parameters = [];
27
+ for (const v of versions) {
28
+ parameters.push(new ssm.StringParameter(this, `ArtifactsParamV${v}`, {
29
+ parameterName: `/${stackName}/${v}/artifacts`,
30
+ stringValue: artifactBucket.bucketName,
31
+ }), new ssm.StringParameter(this, `CodeFilesKeyParamV${v}`, {
32
+ parameterName: `/${stackName}/${v}/code`,
33
+ stringValue: code,
34
+ }), new ssm.StringParameter(this, `CodeCMDParamV${v}`, {
35
+ parameterName: `/${stackName}/${v}/code/handler`,
36
+ stringValue: 'run.sh',
37
+ }), new ssm.StringParameter(this, `StaticFilesKeyParamV${v}`, {
38
+ parameterName: `/${stackName}/${v}/files/staticFiles/key`,
39
+ stringValue: deployment.files.staticFiles.key,
40
+ }), new ssm.StringParameter(this, `PublicFilesKeyParamV${v}`, {
41
+ parameterName: `/${stackName}/${v}/files/publicFiles/key`,
42
+ stringValue: deployment.files.publicFiles.key,
43
+ }), new ssm.StringParameter(this, `TagParamV${v}`, {
44
+ parameterName: `/${stackName}/${v}/tag`,
45
+ stringValue: props.version,
46
+ }));
47
+ }
48
+ for (const p of parameters) {
49
+ p.applyRemovalPolicy(cdk.RemovalPolicy.RETAIN);
50
+ }
51
+ }
52
+ }
53
+ exports.NextAppRouterCode = NextAppRouterCode;
@@ -1,6 +1,9 @@
1
+ import type { DockerImageAssetOptions } from 'aws-cdk-lib/aws-ecr-assets';
1
2
  import { Construct } from 'constructs';
2
- import type { StandaloneContainer } from './types';
3
- export type NextAppRouterProps = StandaloneContainer;
3
+ import type { StandaloneApp } from './types';
4
+ export type NextAppRouterProps = StandaloneApp & {
5
+ container?: DockerImageAssetOptions;
6
+ };
4
7
  export declare class NextAppRouterContainer extends Construct {
5
8
  constructor(scope: Construct, id: string, props: NextAppRouterProps);
6
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"next-app-router-container.d.ts","sourceRoot":"","sources":["../../../src/lib/standalone/next-app-router-container.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAErD,qBAAa,sBAAuB,SAAQ,SAAS;gBACvC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;CAyCpE"}
1
+ {"version":3,"file":"next-app-router-container.d.ts","sourceRoot":"","sources":["../../../src/lib/standalone/next-app-router-container.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAK1E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACrC,CAAC;AAEF,qBAAa,sBAAuB,SAAQ,SAAS;gBACvC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;CA8DpE"}