@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
|
@@ -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
package/package.json
CHANGED
package/src/stacks/api-stack.ts
CHANGED
|
@@ -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,
|