@gradientedge/cdk-utils 9.27.0 → 9.29.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.
@@ -303,10 +303,10 @@ class CloudFrontManager {
303
303
  if (!props.functionName)
304
304
  throw `CloudFront Function functionName undefined for ${id}`;
305
305
  const cloudfrontFunction = new aws_cloudfront_1.Function(scope, `${id}`, {
306
+ ...props,
306
307
  code: aws_cloudfront_1.FunctionCode.fromFile({
307
308
  filePath: props.functionFilePath,
308
309
  }),
309
- comment: props.comment,
310
310
  functionName: scope.resourceNameFormatter.format(props.functionName, scope.props.resourceNameOptions?.cloudfront),
311
311
  });
312
312
  (0, utils_1.createCfnOutput)(`${id}-functionArn`, scope, cloudfrontFunction.functionArn);
@@ -39,6 +39,7 @@ export declare class CloudflarePagesStaticSite extends CommonCloudflareConstruct
39
39
  sitePagesPreviewSecrets: {
40
40
  [key: string]: string;
41
41
  };
42
+ siteDeploymentDependsOn: any;
42
43
  constructor(parent: Construct, id: string, props: CloudflarePagesStaticSiteProps);
43
44
  /**
44
45
  * @summary Initialise and provision resources
@@ -30,6 +30,7 @@ class CloudflarePagesStaticSite extends common_1.CommonCloudflareConstruct {
30
30
  sitePagesPreviewEnvironmentVariables;
31
31
  sitePagesSecrets;
32
32
  sitePagesPreviewSecrets;
33
+ siteDeploymentDependsOn;
33
34
  constructor(parent, id, props) {
34
35
  super(parent, id, props);
35
36
  this.props = props;
@@ -143,6 +144,7 @@ class CloudflarePagesStaticSite extends common_1.CommonCloudflareConstruct {
143
144
  directory: this.props.siteAssetDir,
144
145
  message: this.props.siteDeployMessage,
145
146
  projectName: this.sitePagesProject.name,
147
+ dependsOn: this.siteDeploymentDependsOn,
146
148
  });
147
149
  }
148
150
  }
@@ -91,6 +91,7 @@ class CloudflarePageManager {
91
91
  const deployment = new cdktf_local_exec_1.LocalExec(scope, `${id}-deploy-${new Date().toISOString()}`, {
92
92
  command: `CLOUDFLARE_ACCOUNT_ID=${scope.props.accountId} CLOUDFLARE_API_TOKEN=${scope.props.apiToken} npx wrangler pages deploy ${props.directory} --project-name=${props.projectName} --branch=${props.branch} --commit-message=${message}`,
93
93
  cwd: '',
94
+ dependsOn: props.dependsOn,
94
95
  });
95
96
  return deployment;
96
97
  }
@@ -12,4 +12,5 @@ export interface PagesProjectDeployProps {
12
12
  directory: string;
13
13
  message: string;
14
14
  projectName: string;
15
+ dependsOn?: any;
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "9.27.0",
3
+ "version": "9.29.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -356,10 +356,10 @@ export class CloudFrontManager {
356
356
  if (!props.functionName) throw `CloudFront Function functionName undefined for ${id}`
357
357
 
358
358
  const cloudfrontFunction = new Function(scope, `${id}`, {
359
+ ...props,
359
360
  code: FunctionCode.fromFile({
360
361
  filePath: props.functionFilePath,
361
362
  }),
362
- comment: props.comment,
363
363
  functionName: scope.resourceNameFormatter.format(props.functionName, scope.props.resourceNameOptions?.cloudfront),
364
364
  })
365
365
 
@@ -37,6 +37,7 @@ export class CloudflarePagesStaticSite extends CommonCloudflareConstruct {
37
37
  sitePagesPreviewEnvironmentVariables: { [key: string]: string }
38
38
  sitePagesSecrets: { [key: string]: string }
39
39
  sitePagesPreviewSecrets: { [key: string]: string }
40
+ siteDeploymentDependsOn: any
40
41
 
41
42
  constructor(parent: Construct, id: string, props: CloudflarePagesStaticSiteProps) {
42
43
  super(parent, id, props)
@@ -161,6 +162,7 @@ export class CloudflarePagesStaticSite extends CommonCloudflareConstruct {
161
162
  directory: this.props.siteAssetDir,
162
163
  message: this.props.siteDeployMessage,
163
164
  projectName: this.sitePagesProject.name,
165
+ dependsOn: this.siteDeploymentDependsOn,
164
166
  })
165
167
  }
166
168
  }
@@ -101,6 +101,7 @@ export class CloudflarePageManager {
101
101
  const deployment = new LocalExec(scope, `${id}-deploy-${new Date().toISOString()}`, {
102
102
  command: `CLOUDFLARE_ACCOUNT_ID=${scope.props.accountId} CLOUDFLARE_API_TOKEN=${scope.props.apiToken} npx wrangler pages deploy ${props.directory} --project-name=${props.projectName} --branch=${props.branch} --commit-message=${message}`,
103
103
  cwd: '',
104
+ dependsOn: props.dependsOn,
104
105
  })
105
106
 
106
107
  return deployment
@@ -10,4 +10,5 @@ export interface PagesProjectDeployProps {
10
10
  directory: string
11
11
  message: string
12
12
  projectName: string
13
+ dependsOn?: any
13
14
  }