Skip to content

Commit

Permalink
Merge pull request #32 from pharindoko/feat/31-internal-web-hosting
Browse files Browse the repository at this point in the history
feat: add construct for simple internal serverless website hosting
  • Loading branch information
pharindoko authored Mar 12, 2023
2 parents 081e375 + c1b1676 commit fb8a194
Show file tree
Hide file tree
Showing 7 changed files with 1,528 additions and 7 deletions.
238 changes: 238 additions & 0 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 24 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,34 @@ pip install pharindoko.cdk-internal-gateway

### Technical Details

Modularized approach with separate constructs

- attach multiple InternalApiGateway and InternalWebsite constructs to the same Internal Service to save costs and keep flexibility

**Internal Service Construct (mandatory construct):**

- creates an internal application loadbalancer
- forwards traffic to VPC endpoint for execute-api
- redirect http to https
- generates custom domains for the API Gateway
- generates certificates for the loadbalancer listener

**Internal Api Gateway Construct:**

- provides a securely configured apigateway resource out of the box
- attach your aws components to the internal apigateway resource
- sets api gateway to PRIVATE mode
- sets resource policies to only allow traffic from vpc endpoint
- generates and attaches custom domains to the API Gateway
- generates and attaches certificates to the the API Gateway and the loadbalancer
- modularized approach with separate constructs
- add multiple internal api gateways to the same internal service to save costs and keep flexibility
- attaches custom domains to the API Gateway
- attaches certificates to the the API Gateway and the loadbalancer

**Internal Website Construct:**

- makes your website internally accessible
- redeploys your website with a single cdk deploy
- provides a securely configured private s3 bucket out of box
- works with SPA applications (written with Vue, Angular) and static websites
- is an extension of the InternalApiGateway Construct

## Requirements

Expand Down Expand Up @@ -133,7 +150,7 @@ pip install pharindoko.cdk-internal-gateway
})

// create another stack that inherits from the InternalApiGateway
...
...
...
}
}
Expand All @@ -152,11 +169,11 @@ pip install pharindoko.cdk-internal-gateway

## Costs

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

| Count | Type | Estimated Costs |
|---|---|---|
|1 x| application load balancer | 20 $ |
|2 x| network interfaces for the vpc endpoint | 16 $ |

A shared vpc can lower the costs as vpc endpoint and their network interfaces can be used together...
A shared vpc can lower the costs as vpc endpoint and their network interfaces can be used together...
Binary file modified cdk-internal-gateway.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./internal-apigateway";
export * from "./internal-service";
export * from "./internal-website";
Loading

0 comments on commit fb8a194

Please sign in to comment.