@jaypie/constructs 1.2.20 → 1.2.22

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.
@@ -109,7 +109,7 @@ export declare class JaypieWebSocket extends Construct {
109
109
  get callbackUrl(): string;
110
110
  /**
111
111
  * Grant a Lambda function permission to manage WebSocket connections
112
- * (post to connections, delete connections).
112
+ * (post messages to connections, get connection info, delete connections).
113
113
  */
114
114
  grantManageConnections(grantee: lambda.IFunction): iam.Grant;
115
115
  }
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as cdk from 'aws-cdk-lib';
2
- import { Tags, Stack, Fn, CfnOutput, SecretValue, Duration, RemovalPolicy, CfnStack, ArnFormat } from 'aws-cdk-lib';
2
+ import { Tags, Stack, Fn, CfnOutput, SecretValue, Duration, RemovalPolicy, CfnStack } from 'aws-cdk-lib';
3
3
  import * as s3 from 'aws-cdk-lib/aws-s3';
4
4
  import { Bucket, StorageClass, BucketAccessControl, EventType } from 'aws-cdk-lib/aws-s3';
5
5
  import { Construct } from 'constructs';
@@ -10,7 +10,6 @@ import * as route53Targets from 'aws-cdk-lib/aws-route53-targets';
10
10
  import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
11
11
  import { DatadogLambda } from 'datadog-cdk-constructs-v2';
12
12
  import { ConfigurationError } from '@jaypie/errors';
13
- import * as iam from 'aws-cdk-lib/aws-iam';
14
13
  import { Role, PolicyStatement, Policy, FederatedPrincipal, Effect, ServicePrincipal, ManagedPolicy } from 'aws-cdk-lib/aws-iam';
15
14
  import * as acm from 'aws-cdk-lib/aws-certificatemanager';
16
15
  import * as lambda from 'aws-cdk-lib/aws-lambda';
@@ -3634,6 +3633,7 @@ class JaypieSsoPermissions extends Construct {
3634
3633
  "cloudformation:*",
3635
3634
  "cloudwatch:*",
3636
3635
  "cost-optimization-hub:*",
3636
+ "dynamodb:*",
3637
3637
  "ec2:*",
3638
3638
  "iam:Get*",
3639
3639
  "iam:List*",
@@ -4305,21 +4305,12 @@ class JaypieWebSocket extends Construct {
4305
4305
  //
4306
4306
  /**
4307
4307
  * Grant a Lambda function permission to manage WebSocket connections
4308
- * (post to connections, delete connections).
4308
+ * (post messages to connections, get connection info, delete connections).
4309
4309
  */
4310
4310
  grantManageConnections(grantee) {
4311
- return iam.Grant.addToPrincipal({
4312
- actions: ["execute-api:ManageConnections"],
4313
- grantee: grantee.grantPrincipal,
4314
- resourceArns: [
4315
- Stack.of(this).formatArn({
4316
- arnFormat: ArnFormat.SLASH_RESOURCE_SLASH_RESOURCE_NAME,
4317
- resource: this._api.apiId,
4318
- resourceName: `${this._stage.stageName}/POST/@connections/*`,
4319
- service: "execute-api",
4320
- }),
4321
- ],
4322
- });
4311
+ // Use the CDK's built-in grantManageConnections which properly grants
4312
+ // permissions for all @connections methods (POST, GET, DELETE) across all stages
4313
+ return this._api.grantManageConnections(grantee);
4323
4314
  }
4324
4315
  }
4325
4316