Package: cdk-simplewebsite-deploy
cdk-simplewebsite-deployThis is an AWS CDK Construct to simplify deploying a single-page website using either S3 buckets or CloudFront distributions.Installation and UsageCreateBasicSiteCreates a simple website using S3 buckets with a domain hosted in Route 53.Typescriptnpm install cdk-simplewebsite-deployimport*ascdkfrom'@aws-cdk/core';import{CreateBasicSite}from'cdk-simplewebsite-deploy';exportclassPipelineStackextendscdk.Stack{constructor(scope:cdk.Construct,id:string,props?:cdk.StackProps){super(scope,id,props);newCreateBasicSite(stack,'test-website',{websiteFolder:'./src/build',indexDoc:'index.html',hostedZone:'example.com',});}}C#dotnet add package ThonBecker.CDK.SimpleWebsiteDeployusingAmazon.CDK;usingThonBecker.CDK.SimpleWebsiteDeploy;namespaceSimpleWebsiteDeploy{publicclassPipelineStack:Stack{internalPipelineStack(Constructscope,stringid,IStackPropsprops=null):base(scope,id,props){newCreateBasicSite(scope,"test-website",newBasicSiteConfiguration(){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>packagecom.myorg;importsoftware.amazon.awscdk.core.Construct;importsoftware.amazon.awscdk.core.Stack;importsoftware.amazon.awscdk.core.StackProps;importcom.thonbecker.simplewebsitedeploy.CreateBasicSite;publicclassMyProjectStackextendsStack{publicMyProjectStack(finalConstructscope,finalStringid){this(scope,id,null);}publicMyProjectStack(finalConstructscope,finalStringid,finalStackPropsprops){super(scope,id,props);CreateBasicSite.Builder.create(this,"test-website").websiteFolder("./src/build").indexDoc("index.html").hostedZone("example.com");}}Pythonpip install cdk-simplewebsite-deployfromaws_cdkimportStackfromcdk_simplewebsite_deployimportCreateBasicSitefromconstructsimportConstructclassMyProjectStack(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')CreateCloudfrontSiteCreates a simple website using a CloudFront distribution with a domain hosted in Route 53.Typescriptnpm install cdk-simplewebsite-deployimport*ascdkfrom'@aws-cdk/core';import{CreateCloudfrontSite}from'cdk-simplewebsite-deploy';exportclassPipelineStackextendscdk.Stack{constructor(scope:cdk.Construct,id:string,props?:cdk.StackProps){super(scope,id,props);newCreateCloudfrontSite(stack,'test-website',{websiteFolder:'./src/dist',indexDoc:'index.html',hostedZone:'example.com',subDomain:'www.example.com',});}}C#dotnet add package ThonBecker.CDK.SimpleWebsiteDeployusingAmazon.CDK;usingThonBecker.CDK.SimpleWebsiteDeploy;namespaceSimpleWebsiteDeploy{publicclassPipelineStack:Stack{internalPipelineStack(Constructscope,stringid,IStackPropsprops=null):base(scope,id,props){newCreateCloudfrontSite(scope,"test-website",newCloudfrontSiteConfiguration(){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>packagecom.myorg;importsoftware.amazon.awscdk.core.Construct;importsoftware.amazon.awscdk.core.Stack;importsoftware.amazon.awscdk.core.StackProps;importcom.thonbecker.simplewebsitedeploy.CreateCloudfrontSite;publicclassMyProjectStackextendsStack{publicMyProjectStack(finalConstructscope,finalStringid){this(scope,id,null);}publicMyProjectStack(finalConstructscope,finalStringid,finalStackPropsprops){super(scope,id,props);CreateCloudfrontSite.Builder.create(this,"test-website").websiteFolder("./src/build").indexDoc("index.html").hostedZone("example.com").subDomain("www.example.com");}}Pythonpip install cdk-simplewebsite-deployfromaws_cdkimportcorefromcdk_simplewebsite_deployimportCreateCloudfrontSiteclassMyProjectStack(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')LicenseDistributed under theApache-2.0license.