open-constructs / aws-cdk-library

Community-Driven CDK Construct Library
Apache License 2.0
44 stars 6 forks source link

feat(aws-ec2): construct for EC2 Instance Connect Endpoint #22

Closed badmintoncryer closed 1 week ago

badmintoncryer commented 2 weeks ago

This PR introduces the Construct for the EC2 Instance Connect Endpoint, allowing users to easily generate an endpoint and connect to an EC2 instance.

Users only need to specify the vpc property and can configure additional properties as needed.

    const instanceConnectEndpoint = new aws_ec2.InstanceConnectEndpoint(
      this,
      'InstanceConnectEndpoint',
      {
        vpc,
        clientToken: 'my-client-token', // optional
        securityGroups: [securityGroup], // optional
        preserveClientIp: true, // optional
      },
    );

    instanceConnectEndpoint.connections.allowTo(instance, cdk.aws_ec2.Port.tcp(22));

This PR includes both unit and integ tests.

hoegertn commented 2 weeks ago

Please also run a full build to regenerate the API.md file

badmintoncryer commented 1 week ago

@go-to-k I've updated README.md after your approving. Could you please approve this again?