@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.
@@ -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
- cfnRole.assumeRolePolicyDocument = cdk.Lazy.any({
457
- produce: () => ({
458
- Version: '2012-10-17',
459
- Statement: allDomainLambdas.map(fn => ({
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: fn.role.roleArn },
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mettlecast/domain-cdk-packer",
3
- "version": "0.2.50",
3
+ "version": "0.2.52",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",