@jaypie/constructs 1.2.28 → 1.2.29

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/esm/index.js CHANGED
@@ -3661,6 +3661,7 @@ class JaypieSsoPermissions extends Construct {
3661
3661
  "servicecatalog:*",
3662
3662
  "sns:*",
3663
3663
  "sqs:*",
3664
+ "ssm:*",
3664
3665
  "states:*",
3665
3666
  "tag:*",
3666
3667
  "uxc:*",
@@ -3888,8 +3889,9 @@ class JaypieWebDeploymentBucket extends Construct {
3888
3889
  if (process.env.CDK_ENV_REPO) {
3889
3890
  repo = `repo:${process.env.CDK_ENV_REPO}:*`;
3890
3891
  }
3892
+ let bucketDeployRole;
3891
3893
  if (repo) {
3892
- const bucketDeployRole = new Role(this, "DestinationBucketDeployRole", {
3894
+ bucketDeployRole = new Role(this, "DestinationBucketDeployRole", {
3893
3895
  assumedBy: new FederatedPrincipal(Fn.importValue(CDK$2.IMPORT.OIDC_PROVIDER), {
3894
3896
  StringLike: {
3895
3897
  "token.actions.githubusercontent.com:sub": repo,
@@ -3989,6 +3991,16 @@ class JaypieWebDeploymentBucket extends Construct {
3989
3991
  new CfnOutput(this, "DistributionId", {
3990
3992
  value: this.distribution.distributionId,
3991
3993
  });
3994
+ // Add CloudFront invalidation permission to deploy role if it exists
3995
+ if (bucketDeployRole) {
3996
+ bucketDeployRole.addToPolicy(new PolicyStatement({
3997
+ effect: Effect.ALLOW,
3998
+ actions: ["cloudfront:CreateInvalidation"],
3999
+ resources: [
4000
+ `arn:aws:cloudfront::${Stack.of(this).account}:distribution/${this.distribution.distributionId}`,
4001
+ ],
4002
+ }));
4003
+ }
3992
4004
  }
3993
4005
  }
3994
4006
  // Implement remaining IBucket methods by delegating to the bucket