@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.
@@ -3695,6 +3695,7 @@ class JaypieSsoPermissions extends constructs.Construct {
3695
3695
  "servicecatalog:*",
3696
3696
  "sns:*",
3697
3697
  "sqs:*",
3698
+ "ssm:*",
3698
3699
  "states:*",
3699
3700
  "tag:*",
3700
3701
  "uxc:*",
@@ -3922,8 +3923,9 @@ class JaypieWebDeploymentBucket extends constructs.Construct {
3922
3923
  if (process.env.CDK_ENV_REPO) {
3923
3924
  repo = `repo:${process.env.CDK_ENV_REPO}:*`;
3924
3925
  }
3926
+ let bucketDeployRole;
3925
3927
  if (repo) {
3926
- const bucketDeployRole = new awsIam.Role(this, "DestinationBucketDeployRole", {
3928
+ bucketDeployRole = new awsIam.Role(this, "DestinationBucketDeployRole", {
3927
3929
  assumedBy: new awsIam.FederatedPrincipal(cdk.Fn.importValue(CDK$2.IMPORT.OIDC_PROVIDER), {
3928
3930
  StringLike: {
3929
3931
  "token.actions.githubusercontent.com:sub": repo,
@@ -4023,6 +4025,16 @@ class JaypieWebDeploymentBucket extends constructs.Construct {
4023
4025
  new cdk.CfnOutput(this, "DistributionId", {
4024
4026
  value: this.distribution.distributionId,
4025
4027
  });
4028
+ // Add CloudFront invalidation permission to deploy role if it exists
4029
+ if (bucketDeployRole) {
4030
+ bucketDeployRole.addToPolicy(new awsIam.PolicyStatement({
4031
+ effect: awsIam.Effect.ALLOW,
4032
+ actions: ["cloudfront:CreateInvalidation"],
4033
+ resources: [
4034
+ `arn:aws:cloudfront::${cdk.Stack.of(this).account}:distribution/${this.distribution.distributionId}`,
4035
+ ],
4036
+ }));
4037
+ }
4026
4038
  }
4027
4039
  }
4028
4040
  // Implement remaining IBucket methods by delegating to the bucket