@deployfoundation/foundation-deploy 0.2.1 → 0.2.2

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/dist/bin/app.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  FoundationNetwork,
8
8
  FoundationPipeline,
9
9
  NewsletterStack
10
- } from "../chunk-paf33z2h.js";
10
+ } from "../chunk-q9sxg76n.js";
11
11
  import {
12
12
  adminsFor,
13
13
  instanceNames,
@@ -1138,6 +1138,11 @@ class FoundationApi extends cdk2.Stack {
1138
1138
  actions: ["dynamodb:Query"],
1139
1139
  resources: [crmTable.tableArn, `${crmTable.tableArn}/index/RecordsIndex`]
1140
1140
  }));
1141
+ crmProxyRole.addToPolicy(new iam2.PolicyStatement({
1142
+ sid: "CrmTableKey",
1143
+ actions: ["kms:Decrypt", "kms:Encrypt", "kms:GenerateDataKey", "kms:DescribeKey"],
1144
+ resources: [(crmTable.encryptionKey ?? props.dataKey).keyArn]
1145
+ }));
1141
1146
  this.crmProxyFunction = new lambda.Function(this, "CrmProxyFunction", {
1142
1147
  functionName: names.crmProxyFunctionName,
1143
1148
  runtime: lambda.Runtime.NODEJS_22_X,
package/dist/src/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  FoundationPipeline,
10
10
  NewsletterStack,
11
11
  deployStatements
12
- } from "../chunk-paf33z2h.js";
12
+ } from "../chunk-q9sxg76n.js";
13
13
  import {
14
14
  BUN_VERSION,
15
15
  LAMBDA_ENTRY_POINTS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deployfoundation/foundation-deploy",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Deploys one Foundation instance from a published, signed release: the CDK app and the deploy tool.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -852,6 +852,16 @@ export class FoundationApi extends cdk.Stack {
852
852
  resources: [crmTable.tableArn, `${crmTable.tableArn}/index/RecordsIndex`],
853
853
  }),
854
854
  );
855
+ // The table is encrypted with the instance's data key, so every read and
856
+ // write needs it. Without this grant each call failed as `proxy_error`
857
+ // (KMS AccessDenied) the first time a deployment actually used its CRM.
858
+ crmProxyRole.addToPolicy(
859
+ new iam.PolicyStatement({
860
+ sid: "CrmTableKey",
861
+ actions: ["kms:Decrypt", "kms:Encrypt", "kms:GenerateDataKey", "kms:DescribeKey"],
862
+ resources: [(crmTable.encryptionKey ?? props.dataKey).keyArn],
863
+ }),
864
+ );
855
865
  this.crmProxyFunction = new lambda.Function(this, "CrmProxyFunction", {
856
866
  functionName: names.crmProxyFunctionName,
857
867
  runtime: lambda.Runtime.NODEJS_22_X,