2.0.96 • Published 8 months ago

cdk-simplewebsite-deploy v2.0.96

Weekly downloads
153
License
Apache-2.0
Repository
github
Last release
8 months ago

License Build Release

cdk-simplewebsite-deploy

This is an AWS CDK Construct to simplify deploying a single-page website using either S3 buckets or CloudFront distributions.

Installation and Usage

CreateBasicSite

Creates a simple website using S3 buckets with a domain hosted in Route 53.

Typescript
npm install cdk-simplewebsite-deploy
import * as cdk from '@aws-cdk/core';
import { CreateBasicSite } from 'cdk-simplewebsite-deploy';

export class PipelineStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new CreateBasicSite(stack, 'test-website', {
      websiteFolder: './src/build',
      indexDoc: 'index.html',
      hostedZone: 'example.com',
    });
  }
}
C
dotnet add package ThonBecker.CDK.SimpleWebsiteDeploy
using Amazon.CDK;
using ThonBecker.CDK.SimpleWebsiteDeploy;

namespace SimpleWebsiteDeploy
{
    public class PipelineStack : Stack
    {
        internal PipelineStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props)
        {
            new CreateBasicSite(scope, "test-website", new BasicSiteConfiguration()
            {
                WebsiteFolder = "./src/build",
                IndexDoc = "index.html",
                HostedZone = "example.com",
            });
        }
    }
}
Java
<dependency>
	<groupId>com.thonbecker.simplewebsitedeploy</groupId>
	<artifactId>cdk-simplewebsite-deploy</artifactId>
	<version>0.4.2</version>
</dependency>
package com.myorg;

import software.amazon.awscdk.core.Construct;
import software.amazon.awscdk.core.Stack;
import software.amazon.awscdk.core.StackProps;
import com.thonbecker.simplewebsitedeploy.CreateBasicSite;

public class MyProjectStack extends Stack {
    public MyProjectStack(final Construct scope, final String id) {
        this(scope, id, null);
    }

    public MyProjectStack(final Construct scope, final String id, final StackProps props) {
        super(scope, id, props);
        
        CreateBasicSite.Builder.create(this, "test-website")
        		.websiteFolder("./src/build")
        		.indexDoc("index.html")
        		.hostedZone("example.com");
    }
}
Python
pip install cdk-simplewebsite-deploy
from aws_cdk import Stack
from cdk_simplewebsite_deploy import CreateBasicSite
from constructs import Construct

class MyProjectStack(Stack):

    def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
        super().__init__(scope, construct_id, **kwargs)
        
        CreateBasicSite(self, 'test-website', website_folder='./src/build',
                        index_doc='index.html',
                        hosted_zone='example.com')

CreateCloudfrontSite

Creates a simple website using a CloudFront distribution with a domain hosted in Route 53.

Typescript
npm install cdk-simplewebsite-deploy
import * as cdk from '@aws-cdk/core';
import { CreateCloudfrontSite } from 'cdk-simplewebsite-deploy';

export class PipelineStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new CreateCloudfrontSite(stack, 'test-website', {
      websiteFolder: './src/dist',
      indexDoc: 'index.html',
      hostedZone: 'example.com',
      subDomain: 'www.example.com',
    });
  }
}
C
dotnet add package ThonBecker.CDK.SimpleWebsiteDeploy
using Amazon.CDK;
using ThonBecker.CDK.SimpleWebsiteDeploy;

namespace SimpleWebsiteDeploy
{
    public class PipelineStack : Stack
    {
        internal PipelineStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props)
        {
            new CreateCloudfrontSite(scope, "test-website", new CloudfrontSiteConfiguration()
            {
                WebsiteFolder = "./src/build",
                IndexDoc = "index.html",
                HostedZone = "example.com",
                SubDomain = "www.example.com",
            });
        }
    }
}
Java
<dependency>
	<groupId>com.thonbecker.simplewebsitedeploy</groupId>
	<artifactId>cdk-simplewebsite-deploy</artifactId>
	<version>0.4.2</version>
</dependency>
package com.myorg;

import software.amazon.awscdk.core.Construct;
import software.amazon.awscdk.core.Stack;
import software.amazon.awscdk.core.StackProps;
import com.thonbecker.simplewebsitedeploy.CreateCloudfrontSite;

public class MyProjectStack extends Stack {
    public MyProjectStack(final Construct scope, final String id) {
        this(scope, id, null);
    }

    public MyProjectStack(final Construct scope, final String id, final StackProps props) {
        super(scope, id, props);
        
        CreateCloudfrontSite.Builder.create(this, "test-website")
        		.websiteFolder("./src/build")
        		.indexDoc("index.html")
        		.hostedZone("example.com")
        		.subDomain("www.example.com");
    }
}
Python
pip install cdk-simplewebsite-deploy
from aws_cdk import core
from cdk_simplewebsite_deploy import CreateCloudfrontSite


class MyProjectStack(core.Stack):

    def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None:
        super().__init__(scope, construct_id, **kwargs)

        CreateCloudfrontSite(self, 'test-website', website_folder='./src/build',
                             index_doc='index.html',
                             hosted_zone='example.com',
                             sub_domain='www.example.com')

License

Distributed under the Apache-2.0 license.

2.0.96

8 months ago

2.0.95

9 months ago

2.0.94

9 months ago

2.0.93

10 months ago

2.0.91

10 months ago

2.0.92

10 months ago

2.0.88

10 months ago

2.0.89

10 months ago

2.0.90

10 months ago

2.0.87

11 months ago

2.0.86

12 months ago

2.0.85

12 months ago

2.0.84

1 year ago

2.0.83

1 year ago

2.0.82

1 year ago

2.0.81

2 years ago

2.0.80

2 years ago

2.0.79

2 years ago

2.0.78

2 years ago

2.0.77

2 years ago

2.0.76

2 years ago

2.0.75

2 years ago

2.0.74

2 years ago

2.0.68

2 years ago

2.0.69

2 years ago

2.0.66

2 years ago

2.0.67

2 years ago

2.0.64

2 years ago

2.0.65

2 years ago

2.0.63

2 years ago

2.0.73

2 years ago

2.0.71

2 years ago

2.0.72

2 years ago

2.0.70

2 years ago

2.0.62

2 years ago

2.0.60

2 years ago

2.0.61

2 years ago

2.0.59

3 years ago

2.0.58

3 years ago

2.0.57

3 years ago

2.0.48

3 years ago

2.0.49

3 years ago

2.0.46

3 years ago

2.0.47

3 years ago

2.0.44

3 years ago

2.0.45

3 years ago

2.0.42

3 years ago

2.0.43

3 years ago

2.0.55

3 years ago

2.0.56

3 years ago

2.0.53

3 years ago

2.0.54

3 years ago

2.0.51

3 years ago

2.0.52

3 years ago

2.0.50

3 years ago

2.0.38

3 years ago

2.0.39

3 years ago

2.0.40

3 years ago

2.0.41

3 years ago

2.0.37

3 years ago

2.0.35

3 years ago

2.0.36

3 years ago

2.0.33

3 years ago

2.0.34

3 years ago

2.0.31

3 years ago

2.0.32

3 years ago

2.0.28

3 years ago

2.0.29

3 years ago

2.0.30

3 years ago

2.0.26

3 years ago

2.0.27

3 years ago

2.0.24

3 years ago

2.0.25

3 years ago

2.0.22

3 years ago

2.0.23

3 years ago

2.0.20

4 years ago

2.0.21

4 years ago

2.0.15

4 years ago

2.0.16

4 years ago

2.0.13

4 years ago

2.0.14

4 years ago

2.0.11

4 years ago

2.0.12

4 years ago

2.0.19

4 years ago

2.0.17

4 years ago

2.0.18

4 years ago

2.0.10

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago

0.4.75

4 years ago

0.4.76

4 years ago

0.4.73

4 years ago

0.4.74

4 years ago

0.4.71

4 years ago

0.4.72

4 years ago

0.4.70

4 years ago

0.4.69

4 years ago

0.4.68

4 years ago

0.4.66

4 years ago

0.4.67

4 years ago

0.4.65

4 years ago

0.4.64

4 years ago

0.4.62

4 years ago

0.4.63

4 years ago

0.4.61

4 years ago

0.4.60

4 years ago

0.4.59

4 years ago

0.4.58

4 years ago

0.4.57

4 years ago

0.4.56

4 years ago

0.4.55

4 years ago

0.4.54

4 years ago

0.4.53

4 years ago

0.4.52

4 years ago

0.4.51

4 years ago

0.4.50

4 years ago

0.4.48

4 years ago

0.4.49

4 years ago

0.4.47

4 years ago

0.4.46

4 years ago

0.4.45

4 years ago

0.4.44

4 years ago

0.4.43

4 years ago

0.4.42

4 years ago

0.4.41

4 years ago

0.4.40

4 years ago

0.4.39

4 years ago

0.4.38

4 years ago

0.4.37

4 years ago

0.4.35

4 years ago

0.4.36

4 years ago

0.4.33

4 years ago

0.4.34

4 years ago

0.4.29

4 years ago

0.4.26

4 years ago

0.4.27

4 years ago

0.4.24

4 years ago

0.4.25

4 years ago

0.4.22

4 years ago

0.4.23

4 years ago

0.4.31

4 years ago

0.4.32

4 years ago

0.4.30

4 years ago

0.4.20

5 years ago

0.4.21

4 years ago

0.4.19

5 years ago

0.4.18

5 years ago

0.4.17

5 years ago

0.4.16

5 years ago

0.4.15

5 years ago

0.4.14

5 years ago

0.4.13

5 years ago

0.4.12

5 years ago

0.4.11

5 years ago

0.4.10

5 years ago

0.4.9

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.1.2

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.24

5 years ago

0.0.25

5 years ago

0.0.22

5 years ago

0.0.23

5 years ago

0.0.21

5 years ago