open-index/open-npm huggingface dataset:
npm package: @nona-creative/aws-cdk-s3-cloudfront
Description: AWS CDK Construct for a static site. Provides S3, CloudFront, ACM, Route53, and subdomain redirects
Author: Nona Creative
Latest version: 2.12.0

# AWS CDK S3 Cloudfront Construct

This package provides a CDK construct that creates a Cloudfront distribution which serves content from S3 and is integrated with Route 53 and ACM. Specifically, it:

- Creates a private S3 bucket
- Creates a CloudFront distribution for that bucket
- Optionally creates a Route53 record pointing to that bucket
- Optionally creates a certificate for the distribution if a domain name is used (can use existing)
- Optionally adds subsomain redirects, .e.g. www.nona.digital redirects to the main nona.digital
- Optionally uploads content file to the S3 bucket and invalidates the distribution if it is already existing

## Versioning

The minor version of the package is synchronized to the CDK version used.

## Prerequisites

- An aws account and relevant profile configured

## Example usage

```js
new S3CloudFront(this, 'S3CloudFront', {
  domain: {
    domainName: 'example.nona.digital', // The domain name's TLD must be an existing hosted zone in Route53
    tld: 'nona.digital',
  },
  subdomainRedirects: ['www'],
  bucketName: 'examplenonadigital',
  error404Document: '404.html',
})
```

## Notes:

- You need to have the correct AWS_PROFILE environment variable set as the `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` are picked up from the `AWS_PROFILE` environment variable

- As the bucket is private and does not use S3 hosting, you need to add an edge lambda to serve index documents. The [aws-cdk-standard-cloudfront-lambdas](https://www.npmjs.com/package/@nona-creative/aws-cdk-standard-cloudfront-lambdas) package provides these.

See [example app](packages/aws-cdk-s3-cloudfront/src/example/app.ts) for a complete example
npm package: @nona-creative/aws-cdk-vpc
Description: AWS VPC package with CDK
Author: NoNa Creative
Latest version: 1.0.2

AWS VPC (CDK)
===

Installation
---

```bash
npm i -S @nona-creative/aws-cdk-vpc
```


Usage
---

 1. Create the VPC Stack
    ```typescript
    this.vpcStack = new VPCStack(this.scope, `${this.id}-vpc-${this.stage}`, { stage: this.stage })
    ```
    This will also create a private and public Subnet and NAT Gateway, but no security groups.

 2. Create Security Groups as needed eg.
    ```typescript
    this.vpcStack.createSecurityGroup({
      name: LAMBDA_VPC_SECURITY_GROUP_NAME,
      description: 'Lambda Security Group for app VPC',
    })
    this.vpcStack.createSecurityGroup({
      name: RDS_VPC_SECURITY_GROUP_NAME,
      description: 'RDS Security Group for app VPC',
      allowAllOutbound: false,
    })
    ```
    
 3. Create Ingress Rules as needed, eg.
    ```typescript
    this.vpcStack.addSecurityGroupIngressRule({
      targetSecurityGroupName: RDS_VPC_SECURITY_GROUP_NAME,
      sourceSecurityGroupName: LAMBDA_VPC_SECURITY_GROUP_NAME,
      port: RDS_PORT,
    })
    ```