2.0.81 • Published 1 month ago

cdk-simplewebsite-deploy v2.0.81

Weekly downloads
153
License
Apache-2.0
Repository
github
Last release
1 month 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.81

1 month ago

2.0.80

1 month ago

2.0.79

3 months ago

2.0.78

3 months ago

2.0.77

4 months ago

2.0.76

4 months ago

2.0.75

4 months ago

2.0.74

5 months ago

2.0.68

9 months ago

2.0.69

7 months ago

2.0.66

10 months ago

2.0.67

9 months ago

2.0.64

10 months ago

2.0.65

10 months ago

2.0.63

10 months ago

2.0.73

6 months ago

2.0.71

7 months ago

2.0.72

7 months ago

2.0.70

7 months ago

2.0.62

11 months ago

2.0.60

12 months ago

2.0.61

12 months ago

2.0.59

1 year ago

2.0.58

1 year ago

2.0.57

1 year ago

2.0.48

1 year ago

2.0.49

1 year ago

2.0.46

1 year ago

2.0.47

1 year ago

2.0.44

1 year ago

2.0.45

1 year ago

2.0.42

1 year ago

2.0.43

1 year ago

2.0.55

1 year ago

2.0.56

1 year ago

2.0.53

1 year ago

2.0.54

1 year ago

2.0.51

1 year ago

2.0.52

1 year ago

2.0.50

1 year ago

2.0.38

2 years ago

2.0.39

2 years ago

2.0.40

2 years ago

2.0.41

1 year ago

2.0.37

2 years ago

2.0.35

2 years ago

2.0.36

2 years ago

2.0.33

2 years ago

2.0.34

2 years ago

2.0.31

2 years ago

2.0.32

2 years ago

2.0.28

2 years ago

2.0.29

2 years ago

2.0.30

2 years ago

2.0.26

2 years ago

2.0.27

2 years ago

2.0.24

2 years ago

2.0.25

2 years ago

2.0.22

2 years ago

2.0.23

2 years ago

2.0.20

2 years ago

2.0.21

2 years ago

2.0.15

2 years ago

2.0.16

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.19

2 years ago

2.0.17

2 years ago

2.0.18

2 years ago

2.0.10

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago

0.4.75

2 years ago

0.4.76

2 years ago

0.4.73

2 years ago

0.4.74

2 years ago

0.4.71

2 years ago

0.4.72

2 years ago

0.4.70

2 years ago

0.4.69

2 years ago

0.4.68

2 years ago

0.4.66

3 years ago

0.4.67

3 years ago

0.4.65

3 years ago

0.4.64

3 years ago

0.4.62

3 years ago

0.4.63

3 years ago

0.4.61

3 years ago

0.4.60

3 years ago

0.4.59

3 years ago

0.4.58

3 years ago

0.4.57

3 years ago

0.4.56

3 years ago

0.4.55

3 years ago

0.4.54

3 years ago

0.4.53

3 years ago

0.4.52

3 years ago

0.4.51

3 years ago

0.4.50

3 years ago

0.4.48

3 years ago

0.4.49

3 years ago

0.4.47

3 years ago

0.4.46

3 years ago

0.4.45

3 years ago

0.4.44

3 years ago

0.4.43

3 years ago

0.4.42

3 years ago

0.4.41

3 years ago

0.4.40

3 years ago

0.4.39

3 years ago

0.4.38

3 years ago

0.4.37

3 years ago

0.4.35

3 years ago

0.4.36

3 years ago

0.4.33

3 years ago

0.4.34

3 years ago

0.4.29

3 years ago

0.4.26

3 years ago

0.4.27

3 years ago

0.4.24

3 years ago

0.4.25

3 years ago

0.4.22

3 years ago

0.4.23

3 years ago

0.4.31

3 years ago

0.4.32

3 years ago

0.4.30

3 years ago

0.4.20

3 years ago

0.4.21

3 years ago

0.4.19

3 years ago

0.4.18

3 years ago

0.4.17

3 years ago

0.4.16

3 years ago

0.4.15

3 years ago

0.4.14

3 years ago

0.4.13

3 years ago

0.4.12

3 years ago

0.4.11

3 years ago

0.4.10

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.1.2

3 years ago

0.0.30

3 years ago

0.0.29

3 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.21

3 years ago