Socket
Socket
Sign inDemoInstall

@scaleleap/cdk-shared-static-website-hosting

Package Overview
Dependencies
41
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @scaleleap/cdk-shared-static-website-hosting

> Creates a shared static website hosting on CloudFront.


Version published
Maintainers
2
Install size
125 kB
Created

Readme

Source

Shared Static Website Hosting via AWS CDK

Creates a shared static website hosting on CloudFront.

Install

npm i @scaleleap/cdk-shared-static-website-hosting

Usage

import { HostedZone } from 'aws-cdk-lib/aws-route53';
import { SharedStaticWebsiteHosting } from '@scaleleap/cdk-shared-static-website-hosting';

const rootZone = HostedZone.fromLookup(scope, 'RootZone', {
  domainName: 'static.example.com',
});

const swp = new SharedStaticWebsiteHosting(scope, 'SharedStaticWebsiteHosting', {
  hostedZone: rootZone,
});

Explanation

The following will be created for you:

  • An S3 bucket to store static website files
  • A CloudFront distribution to serve the website
  • A wilcard A DNS record to map sub-domain to the S3 prefix
  • An SSL/TLS certificate for the wildcard sub-domain

And the sub-domain will map to the S3 key prefix.

For example:

If you place your static website into:

s3://my-bucket/foo1/index.html
s3://my-bucket/foo1/image.png

The website will be served at:

https://foo1.static.example.com/

Keywords

FAQs

Last updated on 16 Sep 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc