cdk-private-s3-hosting 0.0.1__tar.gz → 0.0.3__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_private_s3_hosting-0.0.1/src/cdk_private_s3_hosting.egg-info → cdk_private_s3_hosting-0.0.3}/PKG-INFO +16 -2
  2. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/README.md +15 -1
  3. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/setup.py +2 -2
  4. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/src/cdk-private-s3-hosting/__init__.py +57 -4
  5. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/src/cdk-private-s3-hosting/_jsii/__init__.py +2 -2
  6. cdk_private_s3_hosting-0.0.3/src/cdk-private-s3-hosting/_jsii/cdk-private-s3-hosting@0.0.3.jsii.tgz +0 -0
  7. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3/src/cdk_private_s3_hosting.egg-info}/PKG-INFO +16 -2
  8. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/src/cdk_private_s3_hosting.egg-info/SOURCES.txt +1 -1
  9. cdk_private_s3_hosting-0.0.1/src/cdk-private-s3-hosting/_jsii/cdk-private-s3-hosting@0.0.1.jsii.tgz +0 -0
  10. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/LICENSE +0 -0
  11. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/MANIFEST.in +0 -0
  12. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/pyproject.toml +0 -0
  13. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/setup.cfg +0 -0
  14. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/src/cdk-private-s3-hosting/py.typed +0 -0
  15. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/src/cdk_private_s3_hosting.egg-info/dependency_links.txt +0 -0
  16. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/src/cdk_private_s3_hosting.egg-info/requires.txt +0 -0
  17. {cdk_private_s3_hosting-0.0.1 → cdk_private_s3_hosting-0.0.3}/src/cdk_private_s3_hosting.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cdk-private-s3-hosting
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Summary: CDK Construct for a private frontend hosting S3 bucket
5
5
  Home-page: https://github.com/badmintoncryer/cdk-private-s3-hosting.git
6
6
  Author: Kazuho CryerShinozuka<malaysia.cryer@gmail.com>
@@ -96,7 +96,21 @@ new s3deploy.BucketDeployment(this, 'DeployWebsite', {
96
96
  After deploying the stack, you can access the website using the `domainName` you specified from the VPC.
97
97
 
98
98
  ```sh
99
- curl http://cryer-nao-domain.com
99
+ [cloudshell-user@ip-10-0-31-170 ~]$ curl http://cryer-nao-domain.com/ -L
100
+ <!doctype html>
101
+ <html lang="en">
102
+ <head>
103
+ <meta charset="UTF-8" />
104
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
105
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
106
+ <title>Vite + React + TS</title>
107
+ <script type="module" crossorigin src="/assets/index-f40OySzR.js"></script>
108
+ <link rel="stylesheet" crossorigin href="/assets/index-DiwrgTda.css">
109
+ </head>
110
+ <body>
111
+ <div id="root"></div>
112
+ </body>
113
+ </html>
100
114
  ```
101
115
 
102
116
  **Note**: All access to the path pattern `*/` will be redirected to `/index.html`. Therefore, it will function correctly even when the path is set on the frontend and the page is reloaded.
@@ -68,7 +68,21 @@ new s3deploy.BucketDeployment(this, 'DeployWebsite', {
68
68
  After deploying the stack, you can access the website using the `domainName` you specified from the VPC.
69
69
 
70
70
  ```sh
71
- curl http://cryer-nao-domain.com
71
+ [cloudshell-user@ip-10-0-31-170 ~]$ curl http://cryer-nao-domain.com/ -L
72
+ <!doctype html>
73
+ <html lang="en">
74
+ <head>
75
+ <meta charset="UTF-8" />
76
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
77
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
78
+ <title>Vite + React + TS</title>
79
+ <script type="module" crossorigin src="/assets/index-f40OySzR.js"></script>
80
+ <link rel="stylesheet" crossorigin href="/assets/index-DiwrgTda.css">
81
+ </head>
82
+ <body>
83
+ <div id="root"></div>
84
+ </body>
85
+ </html>
72
86
  ```
73
87
 
74
88
  **Note**: All access to the path pattern `*/` will be redirected to `/index.html`. Therefore, it will function correctly even when the path is set on the frontend and the page is reloaded.
@@ -5,7 +5,7 @@ kwargs = json.loads(
5
5
  """
6
6
  {
7
7
  "name": "cdk-private-s3-hosting",
8
- "version": "0.0.1",
8
+ "version": "0.0.3",
9
9
  "description": "CDK Construct for a private frontend hosting S3 bucket",
10
10
  "license": "Apache-2.0",
11
11
  "url": "https://github.com/badmintoncryer/cdk-private-s3-hosting.git",
@@ -26,7 +26,7 @@ kwargs = json.loads(
26
26
  ],
27
27
  "package_data": {
28
28
  "cdk-private-s3-hosting._jsii": [
29
- "cdk-private-s3-hosting@0.0.1.jsii.tgz"
29
+ "cdk-private-s3-hosting@0.0.3.jsii.tgz"
30
30
  ],
31
31
  "cdk-private-s3-hosting": [
32
32
  "py.typed"
@@ -69,7 +69,21 @@ new s3deploy.BucketDeployment(this, 'DeployWebsite', {
69
69
  After deploying the stack, you can access the website using the `domainName` you specified from the VPC.
70
70
 
71
71
  ```sh
72
- curl http://cryer-nao-domain.com
72
+ [cloudshell-user@ip-10-0-31-170 ~]$ curl http://cryer-nao-domain.com/ -L
73
+ <!doctype html>
74
+ <html lang="en">
75
+ <head>
76
+ <meta charset="UTF-8" />
77
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
78
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
79
+ <title>Vite + React + TS</title>
80
+ <script type="module" crossorigin src="/assets/index-f40OySzR.js"></script>
81
+ <link rel="stylesheet" crossorigin href="/assets/index-DiwrgTda.css">
82
+ </head>
83
+ <body>
84
+ <div id="root"></div>
85
+ </body>
86
+ </html>
73
87
  ```
74
88
 
75
89
  **Note**: All access to the path pattern `*/` will be redirected to `/index.html`. Therefore, it will function correctly even when the path is set on the frontend and the page is reloaded.
@@ -109,6 +123,7 @@ from ._jsii import *
109
123
  import aws_cdk.aws_certificatemanager as _aws_cdk_aws_certificatemanager_ceddda9d
110
124
  import aws_cdk.aws_ec2 as _aws_cdk_aws_ec2_ceddda9d
111
125
  import aws_cdk.aws_elasticloadbalancingv2 as _aws_cdk_aws_elasticloadbalancingv2_ceddda9d
126
+ import aws_cdk.aws_route53 as _aws_cdk_aws_route53_ceddda9d
112
127
  import aws_cdk.aws_s3 as _aws_cdk_aws_s3_ceddda9d
113
128
  import constructs as _constructs_77d1e7e8
114
129
 
@@ -130,16 +145,18 @@ class PrivateS3Hosting(
130
145
  certificate: typing.Optional[_aws_cdk_aws_certificatemanager_ceddda9d.ICertificate] = None,
131
146
  enable_private_dns: typing.Optional[builtins.bool] = None,
132
147
  internet_facing: typing.Optional[builtins.bool] = None,
148
+ sub_domain: typing.Optional[builtins.str] = None,
133
149
  vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
134
150
  ) -> None:
135
151
  '''
136
152
  :param scope: -
137
153
  :param id: -
138
154
  :param bucket_props: The properties for the S3 bucket. Default: - use default properties
139
- :param domain_name: The domain name for the website. This will be used to create the S3 bucket and the ALB listener
155
+ :param domain_name: The domain name for the website. S3 bucket name will be created with ``domainName``. If ``enablePrivateDns`` is enabled, a private hosted zone also will be created for the ``domainName`` and an A record has been created from ``domainName`` to the ALB DNS name.". If ``subDomein`` is provided, these names will be ``${subDomain}.${domainName}``.
140
156
  :param certificate: The certificate for the website. Default: - use HTTP
141
157
  :param enable_private_dns: Enable private DNS for the website. By eneabling this, a private hosted zone will be created for the domain name and an alias record will be created for the ALB You can access to the alb by the ``http(s)://<domainName>`` from the VPC Default: true
142
158
  :param internet_facing: Whether the ALB is internet facing. Default: false
159
+ :param sub_domain: The sub domain for the website. S3 bucket name will be created with ``${subDomain}.{domainName}``. If ``enablePrivateDns`` is enabled, a private hosted zone also will be created for the ``domainName`` and an A record has been created from ``${subDomain}.${domainName}`` to the ALB DNS name.". Default: - no sub domain
143
160
  :param vpc: The VPC for the website. Default: - create a new VPC with 2 AZs and 0 NAT gateways
144
161
  '''
145
162
  if __debug__:
@@ -152,6 +169,7 @@ class PrivateS3Hosting(
152
169
  certificate=certificate,
153
170
  enable_private_dns=enable_private_dns,
154
171
  internet_facing=internet_facing,
172
+ sub_domain=sub_domain,
155
173
  vpc=vpc,
156
174
  )
157
175
 
@@ -177,6 +195,12 @@ class PrivateS3Hosting(
177
195
  '''The VPC.'''
178
196
  return typing.cast(_aws_cdk_aws_ec2_ceddda9d.IVpc, jsii.get(self, "vpc"))
179
197
 
198
+ @builtins.property
199
+ @jsii.member(jsii_name="hostedZone")
200
+ def hosted_zone(self) -> typing.Optional[_aws_cdk_aws_route53_ceddda9d.IHostedZone]:
201
+ '''The hosted zone for the website.'''
202
+ return typing.cast(typing.Optional[_aws_cdk_aws_route53_ceddda9d.IHostedZone], jsii.get(self, "hostedZone"))
203
+
180
204
 
181
205
  @jsii.data_type(
182
206
  jsii_type="cdk-private-s3-hosting.PrivateS3HostingProps",
@@ -187,6 +211,7 @@ class PrivateS3Hosting(
187
211
  "certificate": "certificate",
188
212
  "enable_private_dns": "enablePrivateDns",
189
213
  "internet_facing": "internetFacing",
214
+ "sub_domain": "subDomain",
190
215
  "vpc": "vpc",
191
216
  },
192
217
  )
@@ -199,15 +224,17 @@ class PrivateS3HostingProps:
199
224
  certificate: typing.Optional[_aws_cdk_aws_certificatemanager_ceddda9d.ICertificate] = None,
200
225
  enable_private_dns: typing.Optional[builtins.bool] = None,
201
226
  internet_facing: typing.Optional[builtins.bool] = None,
227
+ sub_domain: typing.Optional[builtins.str] = None,
202
228
  vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
203
229
  ) -> None:
204
230
  '''Properties for PrivateS3Hosting.
205
231
 
206
232
  :param bucket_props: The properties for the S3 bucket. Default: - use default properties
207
- :param domain_name: The domain name for the website. This will be used to create the S3 bucket and the ALB listener
233
+ :param domain_name: The domain name for the website. S3 bucket name will be created with ``domainName``. If ``enablePrivateDns`` is enabled, a private hosted zone also will be created for the ``domainName`` and an A record has been created from ``domainName`` to the ALB DNS name.". If ``subDomein`` is provided, these names will be ``${subDomain}.${domainName}``.
208
234
  :param certificate: The certificate for the website. Default: - use HTTP
209
235
  :param enable_private_dns: Enable private DNS for the website. By eneabling this, a private hosted zone will be created for the domain name and an alias record will be created for the ALB You can access to the alb by the ``http(s)://<domainName>`` from the VPC Default: true
210
236
  :param internet_facing: Whether the ALB is internet facing. Default: false
237
+ :param sub_domain: The sub domain for the website. S3 bucket name will be created with ``${subDomain}.{domainName}``. If ``enablePrivateDns`` is enabled, a private hosted zone also will be created for the ``domainName`` and an A record has been created from ``${subDomain}.${domainName}`` to the ALB DNS name.". Default: - no sub domain
211
238
  :param vpc: The VPC for the website. Default: - create a new VPC with 2 AZs and 0 NAT gateways
212
239
  '''
213
240
  if isinstance(bucket_props, dict):
@@ -219,6 +246,7 @@ class PrivateS3HostingProps:
219
246
  check_type(argname="argument certificate", value=certificate, expected_type=type_hints["certificate"])
220
247
  check_type(argname="argument enable_private_dns", value=enable_private_dns, expected_type=type_hints["enable_private_dns"])
221
248
  check_type(argname="argument internet_facing", value=internet_facing, expected_type=type_hints["internet_facing"])
249
+ check_type(argname="argument sub_domain", value=sub_domain, expected_type=type_hints["sub_domain"])
222
250
  check_type(argname="argument vpc", value=vpc, expected_type=type_hints["vpc"])
223
251
  self._values: typing.Dict[builtins.str, typing.Any] = {
224
252
  "bucket_props": bucket_props,
@@ -230,6 +258,8 @@ class PrivateS3HostingProps:
230
258
  self._values["enable_private_dns"] = enable_private_dns
231
259
  if internet_facing is not None:
232
260
  self._values["internet_facing"] = internet_facing
261
+ if sub_domain is not None:
262
+ self._values["sub_domain"] = sub_domain
233
263
  if vpc is not None:
234
264
  self._values["vpc"] = vpc
235
265
 
@@ -247,7 +277,13 @@ class PrivateS3HostingProps:
247
277
  def domain_name(self) -> builtins.str:
248
278
  '''The domain name for the website.
249
279
 
250
- This will be used to create the S3 bucket and the ALB listener
280
+ S3 bucket name will be created with ``domainName``.
281
+
282
+ If ``enablePrivateDns`` is enabled,
283
+ a private hosted zone also will be created for the ``domainName``
284
+ and an A record has been created from ``domainName`` to the ALB DNS name.".
285
+
286
+ If ``subDomein`` is provided, these names will be ``${subDomain}.${domainName}``.
251
287
  '''
252
288
  result = self._values.get("domain_name")
253
289
  assert result is not None, "Required property 'domain_name' is missing"
@@ -287,6 +323,21 @@ class PrivateS3HostingProps:
287
323
  result = self._values.get("internet_facing")
288
324
  return typing.cast(typing.Optional[builtins.bool], result)
289
325
 
326
+ @builtins.property
327
+ def sub_domain(self) -> typing.Optional[builtins.str]:
328
+ '''The sub domain for the website.
329
+
330
+ S3 bucket name will be created with ``${subDomain}.{domainName}``.
331
+
332
+ If ``enablePrivateDns`` is enabled,
333
+ a private hosted zone also will be created for the ``domainName``
334
+ and an A record has been created from ``${subDomain}.${domainName}`` to the ALB DNS name.".
335
+
336
+ :default: - no sub domain
337
+ '''
338
+ result = self._values.get("sub_domain")
339
+ return typing.cast(typing.Optional[builtins.str], result)
340
+
290
341
  @builtins.property
291
342
  def vpc(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc]:
292
343
  '''The VPC for the website.
@@ -324,6 +375,7 @@ def _typecheckingstub__1f6a3822c2541f3c785fce5f3187d688039409f4677b681948fb4a3ae
324
375
  certificate: typing.Optional[_aws_cdk_aws_certificatemanager_ceddda9d.ICertificate] = None,
325
376
  enable_private_dns: typing.Optional[builtins.bool] = None,
326
377
  internet_facing: typing.Optional[builtins.bool] = None,
378
+ sub_domain: typing.Optional[builtins.str] = None,
327
379
  vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
328
380
  ) -> None:
329
381
  """Type checking stubs"""
@@ -336,6 +388,7 @@ def _typecheckingstub__5f3ff047cbd8e8c18995347a63899f04375c4e4a279cffb2f203e5b10
336
388
  certificate: typing.Optional[_aws_cdk_aws_certificatemanager_ceddda9d.ICertificate] = None,
337
389
  enable_private_dns: typing.Optional[builtins.bool] = None,
338
390
  internet_facing: typing.Optional[builtins.bool] = None,
391
+ sub_domain: typing.Optional[builtins.str] = None,
339
392
  vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
340
393
  ) -> None:
341
394
  """Type checking stubs"""
@@ -33,9 +33,9 @@ import constructs._jsii
33
33
 
34
34
  __jsii_assembly__ = jsii.JSIIAssembly.load(
35
35
  "cdk-private-s3-hosting",
36
- "0.0.1",
36
+ "0.0.3",
37
37
  __name__[0:-6],
38
- "cdk-private-s3-hosting@0.0.1.jsii.tgz",
38
+ "cdk-private-s3-hosting@0.0.3.jsii.tgz",
39
39
  )
40
40
 
41
41
  __all__ = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cdk-private-s3-hosting
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Summary: CDK Construct for a private frontend hosting S3 bucket
5
5
  Home-page: https://github.com/badmintoncryer/cdk-private-s3-hosting.git
6
6
  Author: Kazuho CryerShinozuka<malaysia.cryer@gmail.com>
@@ -96,7 +96,21 @@ new s3deploy.BucketDeployment(this, 'DeployWebsite', {
96
96
  After deploying the stack, you can access the website using the `domainName` you specified from the VPC.
97
97
 
98
98
  ```sh
99
- curl http://cryer-nao-domain.com
99
+ [cloudshell-user@ip-10-0-31-170 ~]$ curl http://cryer-nao-domain.com/ -L
100
+ <!doctype html>
101
+ <html lang="en">
102
+ <head>
103
+ <meta charset="UTF-8" />
104
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
105
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
106
+ <title>Vite + React + TS</title>
107
+ <script type="module" crossorigin src="/assets/index-f40OySzR.js"></script>
108
+ <link rel="stylesheet" crossorigin href="/assets/index-DiwrgTda.css">
109
+ </head>
110
+ <body>
111
+ <div id="root"></div>
112
+ </body>
113
+ </html>
100
114
  ```
101
115
 
102
116
  **Note**: All access to the path pattern `*/` will be redirected to `/index.html`. Therefore, it will function correctly even when the path is set on the frontend and the page is reloaded.
@@ -6,7 +6,7 @@ setup.py
6
6
  src/cdk-private-s3-hosting/__init__.py
7
7
  src/cdk-private-s3-hosting/py.typed
8
8
  src/cdk-private-s3-hosting/_jsii/__init__.py
9
- src/cdk-private-s3-hosting/_jsii/cdk-private-s3-hosting@0.0.1.jsii.tgz
9
+ src/cdk-private-s3-hosting/_jsii/cdk-private-s3-hosting@0.0.3.jsii.tgz
10
10
  src/cdk_private_s3_hosting.egg-info/PKG-INFO
11
11
  src/cdk_private_s3_hosting.egg-info/SOURCES.txt
12
12
  src/cdk_private_s3_hosting.egg-info/dependency_links.txt