New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cdk-internal-gateway

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdk-internal-gateway

CDK construct to create an internal aws api-gateway to ease the creation of internal websites, apis or applications

  • 0.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
79
increased by46.3%
Maintainers
1
Weekly downloads
 
Created
Source

CDK Internal Gateway

This CDK construct provides an internal api-gateway endpoint and restricts access to the internal network of your company.

By default the aws api gateway endpoints are public and accessible from the internet.
AWS changed this by having the option to set an api gateway to PRIVATE mode.
But it is still a lot of effort to configure and implement all aws components in a secure manner.

Features

  • no traffic will be routed over the internet
  • access your serverless solution directly from the internal network
  • create internal websites and backends using api gateway integrations (see samples folder)
  • create and attach custom domains and certificates

Requirements

  • CDK V2
  • VPC
  • VPC Endpoint for execute-api

Installation

npm i

Architecture

cdk internal gateway

How to use it ?

Using a new generated project "my-project"

Go to bin/my-project.ts

#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { MyProjectStack } from '../lib/my-project-stack';
import { InternalServiceStack } from 'cdk-internal-gateway';

const app = new cdk.App();
const serviceStack = new InternalServiceStack(app, 'InternalServiceStack', {
  env: {
    account: process.env.CDK_DEFAULT_ACCOUNT,
    region: process.env.CDK_DEFAULT_REGION,
  },
  hostedZoneName: "mydomain.com",
  internalSubnetIds: ["subnet-1234567890", "subnet-0987654321"],
  vpcEndpointId: "vpce-1234567890",
  vpcEndpointIPAddresses: ["192.168.2.1", "192.168.2.2"],
  vpcId: "vpc-1234567890",
  subjectAlternativeNames: ["internal-service.mydomain.net", "int-service.mydomain.com"],
  subDomain: "internal-service"
})

new MyProjectStack(app, 'MyProjectStack', {
  env: {
    account: process.env.CDK_DEFAULT_ACCOUNT,
    region: process.env.CDK_DEFAULT_REGION,
  },
  domains: serviceStack.domains,
  stage: "dev",
  vpcEndpointId: serviceStack.vpcEndpointId,
})

Cost

You have to expect basic infra costs for 2 components in this setup:

CountTypeEstimated Costs
1 xapplication load balancer20 $
2 xnetwork interfaces for the vpc endpoint16 $

A shared vpc can lower the costs as vpc endpoint and their network interfaces can be used together...

Keywords

FAQs

Package last updated on 01 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc