cdk-simplewebsite-deploy 2.3.0__tar.gz → 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. {cdk_simplewebsite_deploy-2.3.0/src/cdk_simplewebsite_deploy.egg-info → cdk_simplewebsite_deploy-3.0.0}/PKG-INFO +16 -91
  2. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/README.md +13 -88
  3. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/pyproject.toml +1 -1
  4. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/setup.py +4 -4
  5. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/src/cdk_simplewebsite_deploy/__init__.py +13 -238
  6. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/src/cdk_simplewebsite_deploy/_jsii/__init__.py +2 -2
  7. cdk_simplewebsite_deploy-3.0.0/src/cdk_simplewebsite_deploy/_jsii/cdk-simplewebsite-deploy@3.0.0.jsii.tgz +0 -0
  8. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0/src/cdk_simplewebsite_deploy.egg-info}/PKG-INFO +16 -91
  9. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/src/cdk_simplewebsite_deploy.egg-info/SOURCES.txt +1 -1
  10. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/src/cdk_simplewebsite_deploy.egg-info/requires.txt +1 -1
  11. cdk_simplewebsite_deploy-2.3.0/src/cdk_simplewebsite_deploy/_jsii/cdk-simplewebsite-deploy@2.3.0.jsii.tgz +0 -0
  12. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/LICENSE +0 -0
  13. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/MANIFEST.in +0 -0
  14. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/setup.cfg +0 -0
  15. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/src/cdk_simplewebsite_deploy/py.typed +0 -0
  16. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/src/cdk_simplewebsite_deploy.egg-info/dependency_links.txt +0 -0
  17. {cdk_simplewebsite_deploy-2.3.0 → cdk_simplewebsite_deploy-3.0.0}/src/cdk_simplewebsite_deploy.egg-info/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cdk-simplewebsite-deploy
3
- Version: 2.3.0
4
- Summary: This is an AWS CDK v2 Construct to simplify deploying a single-page website use CloudFront distributions.
3
+ Version: 3.0.0
4
+ Summary: This is an AWS CDK v2 Construct to simplify deploying a single-page website using CloudFront distributions.
5
5
  Home-page: https://github.com/SnapPetal/cdk-simplewebsite-deploy
6
6
  Author: Thon Becker<thon.becker@gmail.com>
7
7
  License: Apache-2.0
@@ -23,16 +23,19 @@ Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: aws-cdk-lib<3.0.0,>=2.270.0
25
25
  Requires-Dist: constructs<11.0.0,>=10.8.1
26
- Requires-Dist: jsii<2.0.0,>=1.140.0
26
+ Requires-Dist: jsii<2.0.0,>=1.141.0
27
27
  Requires-Dist: publication>=0.0.3
28
28
 
29
29
  [![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://opensource.org/licenses/Apache-2.0)
30
30
  ![Build](https://github.com/SnapPetal/cdk-simplewebsite-deploy/workflows/build/badge.svg)
31
31
  ![Release](https://github.com/SnapPetal/cdk-simplewebsite-deploy/workflows/release/badge.svg?branch=main)
32
+ [![npm](https://img.shields.io/npm/v/cdk-simplewebsite-deploy.svg)](https://www.npmjs.com/package/cdk-simplewebsite-deploy)
33
+ [![PyPI](https://img.shields.io/pypi/v/cdk-simplewebsite-deploy.svg)](https://pypi.org/project/cdk-simplewebsite-deploy/)
34
+ [![Maven Central](https://img.shields.io/maven-central/v/com.thonbecker.simplewebsitedeploy/cdk-simplewebsite-deploy.svg)](https://central.sonatype.com/artifact/com.thonbecker.simplewebsitedeploy/cdk-simplewebsite-deploy)
32
35
 
33
36
  # cdk-simplewebsite-deploy
34
37
 
35
- This is an AWS CDK v2 construct library for deploying a single-page website with S3, CloudFront, Route 53, and ACM. `CreateCloudfrontSite` is the recommended construct because it uses a private S3 origin with CloudFront Origin Access Control (OAC), while `CreateBasicSite` is deprecated because it creates a public S3 website endpoint.
38
+ This is an AWS CDK v2 construct library for deploying a single-page website using CloudFront distributions, with S3, Route 53, and ACM. `CreateCloudfrontSite` uses a private S3 origin with CloudFront Origin Access Control (OAC).
36
39
 
37
40
  ## Installation and Usage
38
41
 
@@ -71,10 +74,12 @@ export class PipelineStack extends cdk.Stack {
71
74
  <dependency>
72
75
  <groupId>com.thonbecker.simplewebsitedeploy</groupId>
73
76
  <artifactId>cdk-simplewebsite-deploy</artifactId>
74
- <version>0.4.2</version>
77
+ <version>VERSION</version>
75
78
  </dependency>
76
79
  ```
77
80
 
81
+ Replace `VERSION` with the version shown on the Maven Central badge.
82
+
78
83
  ```java
79
84
  package com.myorg;
80
85
 
@@ -124,91 +129,11 @@ class MyProjectStack(Stack):
124
129
  sub_domain='www.example.com')
125
130
  ```
126
131
 
127
- ### [CreateBasicSite](https://github.com/snappetal/cdk-simplewebsite-deploy/blob/main/API.md#cdk-cloudfront-deploy-createbasicsite)
128
-
129
- #### Deprecated. Creates a website using public S3 website endpoints with a domain hosted in Route 53.
130
-
131
- Use `CreateCloudfrontSite` for new sites. `CreateBasicSite` configures public bucket access so Route 53 can alias directly to the S3 website endpoint.
132
-
133
- ##### Typescript
134
-
135
- ```console
136
- yarn add cdk-simplewebsite-deploy
137
- ```
138
-
139
- ```python
140
- import * as cdk from 'aws-cdk-lib';
141
- import { CreateBasicSite } from 'cdk-simplewebsite-deploy';
142
- import { Construct } from 'constructs';
143
-
144
- export class PipelineStack extends cdk.Stack {
145
- constructor(scope: Construct, id: string, props?: cdk.StackProps) {
146
- super(scope, id, props);
147
-
148
- new CreateBasicSite(this, 'test-website', {
149
- websiteFolder: './src/build',
150
- indexDoc: 'index.html',
151
- hostedZone: 'example.com',
152
- });
153
- }
154
- }
155
- ```
156
-
157
- ##### Java
158
-
159
- ```xml
160
- <dependency>
161
- <groupId>com.thonbecker.simplewebsitedeploy</groupId>
162
- <artifactId>cdk-simplewebsite-deploy</artifactId>
163
- <version>0.4.2</version>
164
- </dependency>
165
- ```
132
+ ## Upgrading to 3.0.0
166
133
 
167
- ```java
168
- package com.myorg;
134
+ `CreateBasicSite` is removed. Use `CreateCloudfrontSite`.
169
135
 
170
- import com.thonbecker.simplewebsitedeploy.CreateBasicSite;
171
- import software.amazon.awscdk.Stack;
172
- import software.amazon.awscdk.StackProps;
173
- import software.constructs.Construct;
174
-
175
- public class MyProjectStack extends Stack {
176
- public MyProjectStack(final Construct scope, final String id) {
177
- this(scope, id, null);
178
- }
179
-
180
- public MyProjectStack(final Construct scope, final String id, final StackProps props) {
181
- super(scope, id, props);
182
-
183
- CreateBasicSite.Builder.create(this, "test-website")
184
- .websiteFolder("./src/build")
185
- .indexDoc("index.html")
186
- .hostedZone("example.com")
187
- .build();
188
- }
189
- }
190
- ```
191
-
192
- ##### Python
193
-
194
- ```console
195
- pip install cdk-simplewebsite-deploy
196
- ```
197
-
198
- ```python
199
- from aws_cdk import Stack
200
- from cdk_simplewebsite_deploy import CreateBasicSite
201
- from constructs import Construct
202
-
203
- class MyProjectStack(Stack):
204
-
205
- def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
206
- super().__init__(scope, construct_id, **kwargs)
207
-
208
- CreateBasicSite(self, 'test-website', website_folder='./src/build',
209
- index_doc='index.html',
210
- hosted_zone='example.com')
211
- ```
136
+ `CreateCloudfrontSite` now creates the bucket, distribution, deployment, and DNS records on the construct instead of the parent stack. CloudFormation logical IDs change, so an upgrade replaces those resources. The website bucket is replaced: the previous bucket is deleted (`RemovalPolicy.DESTROY` with auto-delete) and a new bucket is created. Redeploy the site contents from `websiteFolder` after the replacement.
212
137
 
213
138
  ## 🚀 Enhanced Features
214
139
 
@@ -216,7 +141,7 @@ The `CreateCloudfrontSite` construct includes optional advanced features for sec
216
141
 
217
142
  ### Security Headers
218
143
 
219
- Enable comprehensive security headers including HSTS, X-Frame-Options, Content-Type-Options, and XSS protection:
144
+ Enable security headers including HSTS, X-Frame-Options, Content-Type-Options, and a referrer policy:
220
145
 
221
146
  ```python
222
147
  new CreateCloudfrontSite(this, 'secure-website', {
@@ -430,7 +355,7 @@ export class AdvancedWebsiteStack extends cdk.Stack {
430
355
 
431
356
  ### 🔒 **Enhanced Security**
432
357
 
433
- * **Security Headers**: Automatic HSTS, X-Frame-Options, Content-Type-Options, and XSS protection
358
+ * **Security Headers**: Automatic HSTS, X-Frame-Options, Content-Type-Options, and a referrer policy
434
359
  * **WAF Integration**: Support for AWS WAF Web ACLs for advanced threat protection
435
360
  * **Origin Access Control**: Modern S3 bucket protection (replaces deprecated OAI)
436
361
  * **Configurable OAC Permissions**: Optional origin access levels for the website bucket
@@ -451,7 +376,7 @@ export class AdvancedWebsiteStack extends cdk.Stack {
451
376
 
452
377
  ### 🚀 **Developer Experience**
453
378
 
454
- * **Backward Compatible**: All existing configurations continue to work
379
+ * **v3 migration**: See [Upgrading to 3.0.0](#upgrading-to-300) before upgrading an existing stack
455
380
  * **Type Safe**: Full TypeScript support with comprehensive interfaces
456
381
  * **CDK v2 Ready**: Built for the latest AWS CDK version
457
382
  * **Multi-Language**: Support for TypeScript, Python, and Java
@@ -1,10 +1,13 @@
1
1
  [![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://opensource.org/licenses/Apache-2.0)
2
2
  ![Build](https://github.com/SnapPetal/cdk-simplewebsite-deploy/workflows/build/badge.svg)
3
3
  ![Release](https://github.com/SnapPetal/cdk-simplewebsite-deploy/workflows/release/badge.svg?branch=main)
4
+ [![npm](https://img.shields.io/npm/v/cdk-simplewebsite-deploy.svg)](https://www.npmjs.com/package/cdk-simplewebsite-deploy)
5
+ [![PyPI](https://img.shields.io/pypi/v/cdk-simplewebsite-deploy.svg)](https://pypi.org/project/cdk-simplewebsite-deploy/)
6
+ [![Maven Central](https://img.shields.io/maven-central/v/com.thonbecker.simplewebsitedeploy/cdk-simplewebsite-deploy.svg)](https://central.sonatype.com/artifact/com.thonbecker.simplewebsitedeploy/cdk-simplewebsite-deploy)
4
7
 
5
8
  # cdk-simplewebsite-deploy
6
9
 
7
- This is an AWS CDK v2 construct library for deploying a single-page website with S3, CloudFront, Route 53, and ACM. `CreateCloudfrontSite` is the recommended construct because it uses a private S3 origin with CloudFront Origin Access Control (OAC), while `CreateBasicSite` is deprecated because it creates a public S3 website endpoint.
10
+ This is an AWS CDK v2 construct library for deploying a single-page website using CloudFront distributions, with S3, Route 53, and ACM. `CreateCloudfrontSite` uses a private S3 origin with CloudFront Origin Access Control (OAC).
8
11
 
9
12
  ## Installation and Usage
10
13
 
@@ -43,10 +46,12 @@ export class PipelineStack extends cdk.Stack {
43
46
  <dependency>
44
47
  <groupId>com.thonbecker.simplewebsitedeploy</groupId>
45
48
  <artifactId>cdk-simplewebsite-deploy</artifactId>
46
- <version>0.4.2</version>
49
+ <version>VERSION</version>
47
50
  </dependency>
48
51
  ```
49
52
 
53
+ Replace `VERSION` with the version shown on the Maven Central badge.
54
+
50
55
  ```java
51
56
  package com.myorg;
52
57
 
@@ -96,91 +101,11 @@ class MyProjectStack(Stack):
96
101
  sub_domain='www.example.com')
97
102
  ```
98
103
 
99
- ### [CreateBasicSite](https://github.com/snappetal/cdk-simplewebsite-deploy/blob/main/API.md#cdk-cloudfront-deploy-createbasicsite)
100
-
101
- #### Deprecated. Creates a website using public S3 website endpoints with a domain hosted in Route 53.
102
-
103
- Use `CreateCloudfrontSite` for new sites. `CreateBasicSite` configures public bucket access so Route 53 can alias directly to the S3 website endpoint.
104
-
105
- ##### Typescript
106
-
107
- ```console
108
- yarn add cdk-simplewebsite-deploy
109
- ```
110
-
111
- ```python
112
- import * as cdk from 'aws-cdk-lib';
113
- import { CreateBasicSite } from 'cdk-simplewebsite-deploy';
114
- import { Construct } from 'constructs';
115
-
116
- export class PipelineStack extends cdk.Stack {
117
- constructor(scope: Construct, id: string, props?: cdk.StackProps) {
118
- super(scope, id, props);
119
-
120
- new CreateBasicSite(this, 'test-website', {
121
- websiteFolder: './src/build',
122
- indexDoc: 'index.html',
123
- hostedZone: 'example.com',
124
- });
125
- }
126
- }
127
- ```
128
-
129
- ##### Java
130
-
131
- ```xml
132
- <dependency>
133
- <groupId>com.thonbecker.simplewebsitedeploy</groupId>
134
- <artifactId>cdk-simplewebsite-deploy</artifactId>
135
- <version>0.4.2</version>
136
- </dependency>
137
- ```
104
+ ## Upgrading to 3.0.0
138
105
 
139
- ```java
140
- package com.myorg;
106
+ `CreateBasicSite` is removed. Use `CreateCloudfrontSite`.
141
107
 
142
- import com.thonbecker.simplewebsitedeploy.CreateBasicSite;
143
- import software.amazon.awscdk.Stack;
144
- import software.amazon.awscdk.StackProps;
145
- import software.constructs.Construct;
146
-
147
- public class MyProjectStack extends Stack {
148
- public MyProjectStack(final Construct scope, final String id) {
149
- this(scope, id, null);
150
- }
151
-
152
- public MyProjectStack(final Construct scope, final String id, final StackProps props) {
153
- super(scope, id, props);
154
-
155
- CreateBasicSite.Builder.create(this, "test-website")
156
- .websiteFolder("./src/build")
157
- .indexDoc("index.html")
158
- .hostedZone("example.com")
159
- .build();
160
- }
161
- }
162
- ```
163
-
164
- ##### Python
165
-
166
- ```console
167
- pip install cdk-simplewebsite-deploy
168
- ```
169
-
170
- ```python
171
- from aws_cdk import Stack
172
- from cdk_simplewebsite_deploy import CreateBasicSite
173
- from constructs import Construct
174
-
175
- class MyProjectStack(Stack):
176
-
177
- def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
178
- super().__init__(scope, construct_id, **kwargs)
179
-
180
- CreateBasicSite(self, 'test-website', website_folder='./src/build',
181
- index_doc='index.html',
182
- hosted_zone='example.com')
183
- ```
108
+ `CreateCloudfrontSite` now creates the bucket, distribution, deployment, and DNS records on the construct instead of the parent stack. CloudFormation logical IDs change, so an upgrade replaces those resources. The website bucket is replaced: the previous bucket is deleted (`RemovalPolicy.DESTROY` with auto-delete) and a new bucket is created. Redeploy the site contents from `websiteFolder` after the replacement.
184
109
 
185
110
  ## 🚀 Enhanced Features
186
111
 
@@ -188,7 +113,7 @@ The `CreateCloudfrontSite` construct includes optional advanced features for sec
188
113
 
189
114
  ### Security Headers
190
115
 
191
- Enable comprehensive security headers including HSTS, X-Frame-Options, Content-Type-Options, and XSS protection:
116
+ Enable security headers including HSTS, X-Frame-Options, Content-Type-Options, and a referrer policy:
192
117
 
193
118
  ```python
194
119
  new CreateCloudfrontSite(this, 'secure-website', {
@@ -402,7 +327,7 @@ export class AdvancedWebsiteStack extends cdk.Stack {
402
327
 
403
328
  ### 🔒 **Enhanced Security**
404
329
 
405
- * **Security Headers**: Automatic HSTS, X-Frame-Options, Content-Type-Options, and XSS protection
330
+ * **Security Headers**: Automatic HSTS, X-Frame-Options, Content-Type-Options, and a referrer policy
406
331
  * **WAF Integration**: Support for AWS WAF Web ACLs for advanced threat protection
407
332
  * **Origin Access Control**: Modern S3 bucket protection (replaces deprecated OAI)
408
333
  * **Configurable OAC Permissions**: Optional origin access levels for the website bucket
@@ -423,7 +348,7 @@ export class AdvancedWebsiteStack extends cdk.Stack {
423
348
 
424
349
  ### 🚀 **Developer Experience**
425
350
 
426
- * **Backward Compatible**: All existing configurations continue to work
351
+ * **v3 migration**: See [Upgrading to 3.0.0](#upgrading-to-300) before upgrading an existing stack
427
352
  * **Type Safe**: Full TypeScript support with comprehensive interfaces
428
353
  * **CDK v2 Ready**: Built for the latest AWS CDK version
429
354
  * **Multi-Language**: Support for TypeScript, Python, and Java
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools~=75.3.2", "build~=1.5.0"]
2
+ requires = ["setuptools~=75.3.2", "build~=1.6.1"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [tool.pyright]
@@ -5,8 +5,8 @@ kwargs = json.loads(
5
5
  """
6
6
  {
7
7
  "name": "cdk-simplewebsite-deploy",
8
- "version": "2.3.0",
9
- "description": "This is an AWS CDK v2 Construct to simplify deploying a single-page website use CloudFront distributions.",
8
+ "version": "3.0.0",
9
+ "description": "This is an AWS CDK v2 Construct to simplify deploying a single-page website using CloudFront distributions.",
10
10
  "license": "Apache-2.0",
11
11
  "url": "https://github.com/SnapPetal/cdk-simplewebsite-deploy",
12
12
  "long_description_content_type": "text/markdown",
@@ -26,7 +26,7 @@ kwargs = json.loads(
26
26
  ],
27
27
  "package_data": {
28
28
  "cdk_simplewebsite_deploy._jsii": [
29
- "cdk-simplewebsite-deploy@2.3.0.jsii.tgz"
29
+ "cdk-simplewebsite-deploy@3.0.0.jsii.tgz"
30
30
  ],
31
31
  "cdk_simplewebsite_deploy": [
32
32
  "py.typed"
@@ -36,7 +36,7 @@ kwargs = json.loads(
36
36
  "install_requires": [
37
37
  "aws-cdk-lib>=2.270.0, <3.0.0",
38
38
  "constructs>=10.8.1, <11.0.0",
39
- "jsii>=1.140.0, <2.0.0",
39
+ "jsii>=1.141.0, <2.0.0",
40
40
  "publication>=0.0.3"
41
41
  ],
42
42
  "classifiers": [
@@ -2,10 +2,13 @@ r'''
2
2
  [![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://opensource.org/licenses/Apache-2.0)
3
3
  ![Build](https://github.com/SnapPetal/cdk-simplewebsite-deploy/workflows/build/badge.svg)
4
4
  ![Release](https://github.com/SnapPetal/cdk-simplewebsite-deploy/workflows/release/badge.svg?branch=main)
5
+ [![npm](https://img.shields.io/npm/v/cdk-simplewebsite-deploy.svg)](https://www.npmjs.com/package/cdk-simplewebsite-deploy)
6
+ [![PyPI](https://img.shields.io/pypi/v/cdk-simplewebsite-deploy.svg)](https://pypi.org/project/cdk-simplewebsite-deploy/)
7
+ [![Maven Central](https://img.shields.io/maven-central/v/com.thonbecker.simplewebsitedeploy/cdk-simplewebsite-deploy.svg)](https://central.sonatype.com/artifact/com.thonbecker.simplewebsitedeploy/cdk-simplewebsite-deploy)
5
8
 
6
9
  # cdk-simplewebsite-deploy
7
10
 
8
- This is an AWS CDK v2 construct library for deploying a single-page website with S3, CloudFront, Route 53, and ACM. `CreateCloudfrontSite` is the recommended construct because it uses a private S3 origin with CloudFront Origin Access Control (OAC), while `CreateBasicSite` is deprecated because it creates a public S3 website endpoint.
11
+ This is an AWS CDK v2 construct library for deploying a single-page website using CloudFront distributions, with S3, Route 53, and ACM. `CreateCloudfrontSite` uses a private S3 origin with CloudFront Origin Access Control (OAC).
9
12
 
10
13
  ## Installation and Usage
11
14
 
@@ -44,10 +47,12 @@ export class PipelineStack extends cdk.Stack {
44
47
  <dependency>
45
48
  <groupId>com.thonbecker.simplewebsitedeploy</groupId>
46
49
  <artifactId>cdk-simplewebsite-deploy</artifactId>
47
- <version>0.4.2</version>
50
+ <version>VERSION</version>
48
51
  </dependency>
49
52
  ```
50
53
 
54
+ Replace `VERSION` with the version shown on the Maven Central badge.
55
+
51
56
  ```java
52
57
  package com.myorg;
53
58
 
@@ -97,91 +102,11 @@ class MyProjectStack(Stack):
97
102
  sub_domain='www.example.com')
98
103
  ```
99
104
 
100
- ### [CreateBasicSite](https://github.com/snappetal/cdk-simplewebsite-deploy/blob/main/API.md#cdk-cloudfront-deploy-createbasicsite)
101
-
102
- #### Deprecated. Creates a website using public S3 website endpoints with a domain hosted in Route 53.
103
-
104
- Use `CreateCloudfrontSite` for new sites. `CreateBasicSite` configures public bucket access so Route 53 can alias directly to the S3 website endpoint.
105
-
106
- ##### Typescript
107
-
108
- ```console
109
- yarn add cdk-simplewebsite-deploy
110
- ```
111
-
112
- ```python
113
- import * as cdk from 'aws-cdk-lib';
114
- import { CreateBasicSite } from 'cdk-simplewebsite-deploy';
115
- import { Construct } from 'constructs';
116
-
117
- export class PipelineStack extends cdk.Stack {
118
- constructor(scope: Construct, id: string, props?: cdk.StackProps) {
119
- super(scope, id, props);
120
-
121
- new CreateBasicSite(this, 'test-website', {
122
- websiteFolder: './src/build',
123
- indexDoc: 'index.html',
124
- hostedZone: 'example.com',
125
- });
126
- }
127
- }
128
- ```
129
-
130
- ##### Java
131
-
132
- ```xml
133
- <dependency>
134
- <groupId>com.thonbecker.simplewebsitedeploy</groupId>
135
- <artifactId>cdk-simplewebsite-deploy</artifactId>
136
- <version>0.4.2</version>
137
- </dependency>
138
- ```
139
-
140
- ```java
141
- package com.myorg;
142
-
143
- import com.thonbecker.simplewebsitedeploy.CreateBasicSite;
144
- import software.amazon.awscdk.Stack;
145
- import software.amazon.awscdk.StackProps;
146
- import software.constructs.Construct;
147
-
148
- public class MyProjectStack extends Stack {
149
- public MyProjectStack(final Construct scope, final String id) {
150
- this(scope, id, null);
151
- }
152
-
153
- public MyProjectStack(final Construct scope, final String id, final StackProps props) {
154
- super(scope, id, props);
155
-
156
- CreateBasicSite.Builder.create(this, "test-website")
157
- .websiteFolder("./src/build")
158
- .indexDoc("index.html")
159
- .hostedZone("example.com")
160
- .build();
161
- }
162
- }
163
- ```
164
-
165
- ##### Python
166
-
167
- ```console
168
- pip install cdk-simplewebsite-deploy
169
- ```
170
-
171
- ```python
172
- from aws_cdk import Stack
173
- from cdk_simplewebsite_deploy import CreateBasicSite
174
- from constructs import Construct
175
-
176
- class MyProjectStack(Stack):
105
+ ## Upgrading to 3.0.0
177
106
 
178
- def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
179
- super().__init__(scope, construct_id, **kwargs)
107
+ `CreateBasicSite` is removed. Use `CreateCloudfrontSite`.
180
108
 
181
- CreateBasicSite(self, 'test-website', website_folder='./src/build',
182
- index_doc='index.html',
183
- hosted_zone='example.com')
184
- ```
109
+ `CreateCloudfrontSite` now creates the bucket, distribution, deployment, and DNS records on the construct instead of the parent stack. CloudFormation logical IDs change, so an upgrade replaces those resources. The website bucket is replaced: the previous bucket is deleted (`RemovalPolicy.DESTROY` with auto-delete) and a new bucket is created. Redeploy the site contents from `websiteFolder` after the replacement.
185
110
 
186
111
  ## 🚀 Enhanced Features
187
112
 
@@ -189,7 +114,7 @@ The `CreateCloudfrontSite` construct includes optional advanced features for sec
189
114
 
190
115
  ### Security Headers
191
116
 
192
- Enable comprehensive security headers including HSTS, X-Frame-Options, Content-Type-Options, and XSS protection:
117
+ Enable security headers including HSTS, X-Frame-Options, Content-Type-Options, and a referrer policy:
193
118
 
194
119
  ```python
195
120
  new CreateCloudfrontSite(this, 'secure-website', {
@@ -403,7 +328,7 @@ export class AdvancedWebsiteStack extends cdk.Stack {
403
328
 
404
329
  ### 🔒 **Enhanced Security**
405
330
 
406
- * **Security Headers**: Automatic HSTS, X-Frame-Options, Content-Type-Options, and XSS protection
331
+ * **Security Headers**: Automatic HSTS, X-Frame-Options, Content-Type-Options, and a referrer policy
407
332
  * **WAF Integration**: Support for AWS WAF Web ACLs for advanced threat protection
408
333
  * **Origin Access Control**: Modern S3 bucket protection (replaces deprecated OAI)
409
334
  * **Configurable OAC Permissions**: Optional origin access levels for the website bucket
@@ -424,7 +349,7 @@ export class AdvancedWebsiteStack extends cdk.Stack {
424
349
 
425
350
  ### 🚀 **Developer Experience**
426
351
 
427
- * **Backward Compatible**: All existing configurations continue to work
352
+ * **v3 migration**: See [Upgrading to 3.0.0](#upgrading-to-300) before upgrading an existing stack
428
353
  * **Type Safe**: Full TypeScript support with comprehensive interfaces
429
354
  * **CDK v2 Ready**: Built for the latest AWS CDK version
430
355
  * **Multi-Language**: Support for TypeScript, Python, and Java
@@ -475,87 +400,6 @@ else:
475
400
  _constructs_77d1e7e8 = _LazyImport("constructs")
476
401
 
477
402
 
478
- @jsii.data_type(
479
- jsii_type="cdk-simplewebsite-deploy.BasicSiteConfiguration",
480
- jsii_struct_bases=[],
481
- name_mapping={
482
- "hosted_zone": "hostedZone",
483
- "index_doc": "indexDoc",
484
- "website_folder": "websiteFolder",
485
- "error_doc": "errorDoc",
486
- },
487
- )
488
- class BasicSiteConfiguration:
489
- def __init__(
490
- self,
491
- *,
492
- hosted_zone: builtins.str,
493
- index_doc: builtins.str,
494
- website_folder: builtins.str,
495
- error_doc: typing.Optional[builtins.str] = None,
496
- ) -> None:
497
- '''
498
- :param hosted_zone: Hosted Zone used to create the DNS record for the website.
499
- :param index_doc: The index document of the website.
500
- :param website_folder: Local path to the website folder you want to deploy on S3.
501
- :param error_doc: The error document of the website. Default: - No error document.
502
- '''
503
- if __debug__:
504
- type_hints = cached_type_hints(_typecheckingstub__55e1d457f7f88b408ecc128e65052c3c69d68b852e2406239079c5f4b76a672d)
505
- check_type(argname="argument hosted_zone", value=hosted_zone, expected_type=type_hints["hosted_zone"])
506
- check_type(argname="argument index_doc", value=index_doc, expected_type=type_hints["index_doc"])
507
- check_type(argname="argument website_folder", value=website_folder, expected_type=type_hints["website_folder"])
508
- check_type(argname="argument error_doc", value=error_doc, expected_type=type_hints["error_doc"])
509
- self._values: typing.Dict[builtins.str, typing.Any] = {
510
- "hosted_zone": hosted_zone,
511
- "index_doc": index_doc,
512
- "website_folder": website_folder,
513
- }
514
- if error_doc is not None:
515
- self._values["error_doc"] = error_doc
516
-
517
- @builtins.property
518
- def hosted_zone(self) -> builtins.str:
519
- '''Hosted Zone used to create the DNS record for the website.'''
520
- result = self._values.get("hosted_zone")
521
- assert result is not None, "Required property 'hosted_zone' is missing"
522
- return typing.cast(builtins.str, result)
523
-
524
- @builtins.property
525
- def index_doc(self) -> builtins.str:
526
- '''The index document of the website.'''
527
- result = self._values.get("index_doc")
528
- assert result is not None, "Required property 'index_doc' is missing"
529
- return typing.cast(builtins.str, result)
530
-
531
- @builtins.property
532
- def website_folder(self) -> builtins.str:
533
- '''Local path to the website folder you want to deploy on S3.'''
534
- result = self._values.get("website_folder")
535
- assert result is not None, "Required property 'website_folder' is missing"
536
- return typing.cast(builtins.str, result)
537
-
538
- @builtins.property
539
- def error_doc(self) -> typing.Optional[builtins.str]:
540
- '''The error document of the website.
541
-
542
- :default: - No error document.
543
- '''
544
- result = self._values.get("error_doc")
545
- return typing.cast(typing.Optional[builtins.str], result)
546
-
547
- def __eq__(self, rhs: typing.Any) -> builtins.bool:
548
- return isinstance(rhs, self.__class__) and rhs._values == self._values
549
-
550
- def __ne__(self, rhs: typing.Any) -> builtins.bool:
551
- return not (rhs == self)
552
-
553
- def __repr__(self) -> str:
554
- return "BasicSiteConfiguration(%s)" % ", ".join(
555
- k + "=" + repr(v) for k, v in self._values.items()
556
- )
557
-
558
-
559
403
  @jsii.data_type(
560
404
  jsii_type="cdk-simplewebsite-deploy.CloudfrontSiteConfiguration",
561
405
  jsii_struct_bases=[],
@@ -839,51 +683,6 @@ class CloudfrontSiteConfiguration:
839
683
  )
840
684
 
841
685
 
842
- class CreateBasicSite(
843
- _constructs_77d1e7e8.Construct,
844
- metaclass=jsii.JSIIMeta,
845
- jsii_type="cdk-simplewebsite-deploy.CreateBasicSite",
846
- ):
847
- '''
848
- :deprecated: Use CreateCloudfrontSite instead. CreateBasicSite configures a public S3 website endpoint.
849
-
850
- :stability: deprecated
851
- '''
852
-
853
- def __init__(
854
- self,
855
- scope: "_constructs_77d1e7e8.Construct",
856
- id: builtins.str,
857
- *,
858
- hosted_zone: builtins.str,
859
- index_doc: builtins.str,
860
- website_folder: builtins.str,
861
- error_doc: typing.Optional[builtins.str] = None,
862
- ) -> None:
863
- '''
864
- :param scope: -
865
- :param id: -
866
- :param hosted_zone: Hosted Zone used to create the DNS record for the website.
867
- :param index_doc: The index document of the website.
868
- :param website_folder: Local path to the website folder you want to deploy on S3.
869
- :param error_doc: The error document of the website. Default: - No error document.
870
-
871
- :stability: deprecated
872
- '''
873
- if __debug__:
874
- type_hints = cached_type_hints(_typecheckingstub__9b1cd29a96c6c8b996276e29a8e2730cf2a3c15a5c12e1c5bc0e23986cb136f7)
875
- check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
876
- check_type(argname="argument id", value=id, expected_type=type_hints["id"])
877
- props = BasicSiteConfiguration(
878
- hosted_zone=hosted_zone,
879
- index_doc=index_doc,
880
- website_folder=website_folder,
881
- error_doc=error_doc,
882
- )
883
-
884
- jsii.create(self.__class__, self, [scope, id, props])
885
-
886
-
887
686
  class CreateCloudfrontSite(
888
687
  _constructs_77d1e7e8.Construct,
889
688
  metaclass=jsii.JSIIMeta,
@@ -958,24 +757,12 @@ class CreateCloudfrontSite(
958
757
 
959
758
 
960
759
  __all__ = [
961
- "BasicSiteConfiguration",
962
760
  "CloudfrontSiteConfiguration",
963
- "CreateBasicSite",
964
761
  "CreateCloudfrontSite",
965
762
  ]
966
763
 
967
764
  publication.publish()
968
765
 
969
- def _typecheckingstub__55e1d457f7f88b408ecc128e65052c3c69d68b852e2406239079c5f4b76a672d(
970
- *,
971
- hosted_zone: builtins.str,
972
- index_doc: builtins.str,
973
- website_folder: builtins.str,
974
- error_doc: typing.Optional[builtins.str] = None,
975
- ) -> None:
976
- """Type checking stubs"""
977
- pass
978
-
979
766
  def _typecheckingstub__0e850e19fcfb3492790ff3ec407df63abfa515b2415ed714c8499dc3239a822f(
980
767
  *,
981
768
  hosted_zone: builtins.str,
@@ -998,18 +785,6 @@ def _typecheckingstub__0e850e19fcfb3492790ff3ec407df63abfa515b2415ed714c8499dc32
998
785
  """Type checking stubs"""
999
786
  pass
1000
787
 
1001
- def _typecheckingstub__9b1cd29a96c6c8b996276e29a8e2730cf2a3c15a5c12e1c5bc0e23986cb136f7(
1002
- scope: _constructs_77d1e7e8.Construct,
1003
- id: builtins.str,
1004
- *,
1005
- hosted_zone: builtins.str,
1006
- index_doc: builtins.str,
1007
- website_folder: builtins.str,
1008
- error_doc: typing.Optional[builtins.str] = None,
1009
- ) -> None:
1010
- """Type checking stubs"""
1011
- pass
1012
-
1013
788
  def _typecheckingstub__35939f41a1cbd87bd7b3fa20b126e3c79332b77b538ed266f3ea73f154b3c68a(
1014
789
  scope: _constructs_77d1e7e8.Construct,
1015
790
  id: builtins.str,
@@ -19,9 +19,9 @@ import constructs._jsii
19
19
 
20
20
  __jsii_assembly__ = jsii.JSIIAssembly.load(
21
21
  "cdk-simplewebsite-deploy",
22
- "2.3.0",
22
+ "3.0.0",
23
23
  __name__[0:-6],
24
- "cdk-simplewebsite-deploy@2.3.0.jsii.tgz",
24
+ "cdk-simplewebsite-deploy@3.0.0.jsii.tgz",
25
25
  )
26
26
 
27
27
  __all__ = [
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cdk-simplewebsite-deploy
3
- Version: 2.3.0
4
- Summary: This is an AWS CDK v2 Construct to simplify deploying a single-page website use CloudFront distributions.
3
+ Version: 3.0.0
4
+ Summary: This is an AWS CDK v2 Construct to simplify deploying a single-page website using CloudFront distributions.
5
5
  Home-page: https://github.com/SnapPetal/cdk-simplewebsite-deploy
6
6
  Author: Thon Becker<thon.becker@gmail.com>
7
7
  License: Apache-2.0
@@ -23,16 +23,19 @@ Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: aws-cdk-lib<3.0.0,>=2.270.0
25
25
  Requires-Dist: constructs<11.0.0,>=10.8.1
26
- Requires-Dist: jsii<2.0.0,>=1.140.0
26
+ Requires-Dist: jsii<2.0.0,>=1.141.0
27
27
  Requires-Dist: publication>=0.0.3
28
28
 
29
29
  [![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://opensource.org/licenses/Apache-2.0)
30
30
  ![Build](https://github.com/SnapPetal/cdk-simplewebsite-deploy/workflows/build/badge.svg)
31
31
  ![Release](https://github.com/SnapPetal/cdk-simplewebsite-deploy/workflows/release/badge.svg?branch=main)
32
+ [![npm](https://img.shields.io/npm/v/cdk-simplewebsite-deploy.svg)](https://www.npmjs.com/package/cdk-simplewebsite-deploy)
33
+ [![PyPI](https://img.shields.io/pypi/v/cdk-simplewebsite-deploy.svg)](https://pypi.org/project/cdk-simplewebsite-deploy/)
34
+ [![Maven Central](https://img.shields.io/maven-central/v/com.thonbecker.simplewebsitedeploy/cdk-simplewebsite-deploy.svg)](https://central.sonatype.com/artifact/com.thonbecker.simplewebsitedeploy/cdk-simplewebsite-deploy)
32
35
 
33
36
  # cdk-simplewebsite-deploy
34
37
 
35
- This is an AWS CDK v2 construct library for deploying a single-page website with S3, CloudFront, Route 53, and ACM. `CreateCloudfrontSite` is the recommended construct because it uses a private S3 origin with CloudFront Origin Access Control (OAC), while `CreateBasicSite` is deprecated because it creates a public S3 website endpoint.
38
+ This is an AWS CDK v2 construct library for deploying a single-page website using CloudFront distributions, with S3, Route 53, and ACM. `CreateCloudfrontSite` uses a private S3 origin with CloudFront Origin Access Control (OAC).
36
39
 
37
40
  ## Installation and Usage
38
41
 
@@ -71,10 +74,12 @@ export class PipelineStack extends cdk.Stack {
71
74
  <dependency>
72
75
  <groupId>com.thonbecker.simplewebsitedeploy</groupId>
73
76
  <artifactId>cdk-simplewebsite-deploy</artifactId>
74
- <version>0.4.2</version>
77
+ <version>VERSION</version>
75
78
  </dependency>
76
79
  ```
77
80
 
81
+ Replace `VERSION` with the version shown on the Maven Central badge.
82
+
78
83
  ```java
79
84
  package com.myorg;
80
85
 
@@ -124,91 +129,11 @@ class MyProjectStack(Stack):
124
129
  sub_domain='www.example.com')
125
130
  ```
126
131
 
127
- ### [CreateBasicSite](https://github.com/snappetal/cdk-simplewebsite-deploy/blob/main/API.md#cdk-cloudfront-deploy-createbasicsite)
128
-
129
- #### Deprecated. Creates a website using public S3 website endpoints with a domain hosted in Route 53.
130
-
131
- Use `CreateCloudfrontSite` for new sites. `CreateBasicSite` configures public bucket access so Route 53 can alias directly to the S3 website endpoint.
132
-
133
- ##### Typescript
134
-
135
- ```console
136
- yarn add cdk-simplewebsite-deploy
137
- ```
138
-
139
- ```python
140
- import * as cdk from 'aws-cdk-lib';
141
- import { CreateBasicSite } from 'cdk-simplewebsite-deploy';
142
- import { Construct } from 'constructs';
143
-
144
- export class PipelineStack extends cdk.Stack {
145
- constructor(scope: Construct, id: string, props?: cdk.StackProps) {
146
- super(scope, id, props);
147
-
148
- new CreateBasicSite(this, 'test-website', {
149
- websiteFolder: './src/build',
150
- indexDoc: 'index.html',
151
- hostedZone: 'example.com',
152
- });
153
- }
154
- }
155
- ```
156
-
157
- ##### Java
158
-
159
- ```xml
160
- <dependency>
161
- <groupId>com.thonbecker.simplewebsitedeploy</groupId>
162
- <artifactId>cdk-simplewebsite-deploy</artifactId>
163
- <version>0.4.2</version>
164
- </dependency>
165
- ```
132
+ ## Upgrading to 3.0.0
166
133
 
167
- ```java
168
- package com.myorg;
134
+ `CreateBasicSite` is removed. Use `CreateCloudfrontSite`.
169
135
 
170
- import com.thonbecker.simplewebsitedeploy.CreateBasicSite;
171
- import software.amazon.awscdk.Stack;
172
- import software.amazon.awscdk.StackProps;
173
- import software.constructs.Construct;
174
-
175
- public class MyProjectStack extends Stack {
176
- public MyProjectStack(final Construct scope, final String id) {
177
- this(scope, id, null);
178
- }
179
-
180
- public MyProjectStack(final Construct scope, final String id, final StackProps props) {
181
- super(scope, id, props);
182
-
183
- CreateBasicSite.Builder.create(this, "test-website")
184
- .websiteFolder("./src/build")
185
- .indexDoc("index.html")
186
- .hostedZone("example.com")
187
- .build();
188
- }
189
- }
190
- ```
191
-
192
- ##### Python
193
-
194
- ```console
195
- pip install cdk-simplewebsite-deploy
196
- ```
197
-
198
- ```python
199
- from aws_cdk import Stack
200
- from cdk_simplewebsite_deploy import CreateBasicSite
201
- from constructs import Construct
202
-
203
- class MyProjectStack(Stack):
204
-
205
- def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
206
- super().__init__(scope, construct_id, **kwargs)
207
-
208
- CreateBasicSite(self, 'test-website', website_folder='./src/build',
209
- index_doc='index.html',
210
- hosted_zone='example.com')
211
- ```
136
+ `CreateCloudfrontSite` now creates the bucket, distribution, deployment, and DNS records on the construct instead of the parent stack. CloudFormation logical IDs change, so an upgrade replaces those resources. The website bucket is replaced: the previous bucket is deleted (`RemovalPolicy.DESTROY` with auto-delete) and a new bucket is created. Redeploy the site contents from `websiteFolder` after the replacement.
212
137
 
213
138
  ## 🚀 Enhanced Features
214
139
 
@@ -216,7 +141,7 @@ The `CreateCloudfrontSite` construct includes optional advanced features for sec
216
141
 
217
142
  ### Security Headers
218
143
 
219
- Enable comprehensive security headers including HSTS, X-Frame-Options, Content-Type-Options, and XSS protection:
144
+ Enable security headers including HSTS, X-Frame-Options, Content-Type-Options, and a referrer policy:
220
145
 
221
146
  ```python
222
147
  new CreateCloudfrontSite(this, 'secure-website', {
@@ -430,7 +355,7 @@ export class AdvancedWebsiteStack extends cdk.Stack {
430
355
 
431
356
  ### 🔒 **Enhanced Security**
432
357
 
433
- * **Security Headers**: Automatic HSTS, X-Frame-Options, Content-Type-Options, and XSS protection
358
+ * **Security Headers**: Automatic HSTS, X-Frame-Options, Content-Type-Options, and a referrer policy
434
359
  * **WAF Integration**: Support for AWS WAF Web ACLs for advanced threat protection
435
360
  * **Origin Access Control**: Modern S3 bucket protection (replaces deprecated OAI)
436
361
  * **Configurable OAC Permissions**: Optional origin access levels for the website bucket
@@ -451,7 +376,7 @@ export class AdvancedWebsiteStack extends cdk.Stack {
451
376
 
452
377
  ### 🚀 **Developer Experience**
453
378
 
454
- * **Backward Compatible**: All existing configurations continue to work
379
+ * **v3 migration**: See [Upgrading to 3.0.0](#upgrading-to-300) before upgrading an existing stack
455
380
  * **Type Safe**: Full TypeScript support with comprehensive interfaces
456
381
  * **CDK v2 Ready**: Built for the latest AWS CDK version
457
382
  * **Multi-Language**: Support for TypeScript, Python, and Java
@@ -11,4 +11,4 @@ src/cdk_simplewebsite_deploy.egg-info/dependency_links.txt
11
11
  src/cdk_simplewebsite_deploy.egg-info/requires.txt
12
12
  src/cdk_simplewebsite_deploy.egg-info/top_level.txt
13
13
  src/cdk_simplewebsite_deploy/_jsii/__init__.py
14
- src/cdk_simplewebsite_deploy/_jsii/cdk-simplewebsite-deploy@2.3.0.jsii.tgz
14
+ src/cdk_simplewebsite_deploy/_jsii/cdk-simplewebsite-deploy@3.0.0.jsii.tgz
@@ -1,4 +1,4 @@
1
1
  aws-cdk-lib<3.0.0,>=2.270.0
2
2
  constructs<11.0.0,>=10.8.1
3
- jsii<2.0.0,>=1.140.0
3
+ jsii<2.0.0,>=1.141.0
4
4
  publication>=0.0.3