@mettlecast/domain-cdk-packer 0.2.50 → 0.2.52
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/DomainStack.js +10 -8
- package/package.json +1 -1
package/dist/DomainStack.js
CHANGED
|
@@ -452,21 +452,23 @@ export class DomainStack extends cdk.Stack {
|
|
|
452
452
|
domainBucket.grantReadWrite(fn);
|
|
453
453
|
}
|
|
454
454
|
// Replace the tenant-scoped role trust policy — only domain Lambdas can assume with tenantId tag
|
|
455
|
+
// Use a single Statement with ArnLike wildcard to stay under the 2048-byte ACL size limit
|
|
455
456
|
const cfnRole = tenantScopedRole.node.defaultChild;
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
457
|
+
const accountId = cdk.Stack.of(this).account;
|
|
458
|
+
const stackPrefix = cdk.Stack.of(this).stackName;
|
|
459
|
+
cfnRole.assumeRolePolicyDocument = {
|
|
460
|
+
Version: '2012-10-17',
|
|
461
|
+
Statement: [{
|
|
460
462
|
Effect: 'Allow',
|
|
461
|
-
Principal: { AWS:
|
|
463
|
+
Principal: { AWS: accountId },
|
|
462
464
|
Action: ['sts:AssumeRole', 'sts:TagSession'],
|
|
463
465
|
Condition: {
|
|
464
466
|
StringLike: { 'aws:RequestTag/tenantId': '*' },
|
|
465
467
|
'ForAllValues:StringEquals': { 'sts:TransitiveTagKeys': ['tenantId'] },
|
|
468
|
+
ArnLike: { 'aws:PrincipalArn': `arn:aws:iam::${accountId}:role/${stackPrefix}*` },
|
|
466
469
|
},
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
});
|
|
470
|
+
}],
|
|
471
|
+
};
|
|
470
472
|
// Attach tenant-scoped storage policy to the tenant-scoped role
|
|
471
473
|
const tenantStoragePolicies = iamBuilder.forTenantScopedStorage({
|
|
472
474
|
tableArn: domainTable.tableArn,
|