The static-website module is able to deploy your pre-packaged static website content into an S3 Bucket, fronted by Cloudfront. This module uses an Origin Access Identity to ensure your Bucket can only be accessed via Cloudfront and is configured to only allow HTTPS requests by default. Custom runtime configurations can also be specified which will emit a runtime-config.json file along with your website content. Typically this includes resource Arns, Id's etc which may need to be referenced from your website. This package uses sane defaults and at a minimum only requires the path to your website assets.
Below is a conceptual view of the default architecture this module creates:
Cloudfront Distribution (HTTPS only) -> S3 Bucket (Private via OAI)
|_ WAF V2 ACL |_ index.html (+ other website files and assets)
|_ runtime-config.json
A typical use case is to create a static website with AuthN. To accomplish this, we can leverage the UserIdentity to create the User Pool (Cognito by default) and Identity Pool. We can then pipe the respective pool id's as runtimeOptions into the StaticWebsite. After the website is deployed, these values can be interrogated from the runtime-config.json deployed alongside the website in order to perform authentication within the app using something like the Amplify Auth API.
const userIdentity = new UserIdentity(this, 'UserIdentity');
new StaticWebsite(this, 'StaticWebsite', {
websiteContentPath: '<relative>/<path>/<to>/<built>/<website>',
runtimeOptions: {
jsonPayload: {
region: Stack.of(this).region,
identityPoolId: userIdentity.identityPool.identityPoolId,
userPoolId: userIdentity.userPool?.userPoolId,
userPoolWebClientId: userIdentity.userPoolClient?.userPoolClientId,
}
},
});
Metadata
Release files for aws-prototyping-sdk.static-website 0.19.68
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aws_prototyping_sdk.static_website-0.19.68.tar.gz | 109.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aws_prototyping_sdk.static_website-0.19.68-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 217.7 kB
Release files / aws_prototyping_sdk.static_website-0.19.68.tar.gz
| Download URL | aws_prototyping_sdk.static_website-0.19.68.tar.gz |
|---|---|
| Size | 109.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0450adbcc7ddeee0dee90d0b3585e303ef653597be092d0d7f4c11b388773b4
|
|
BLAKE2b-256 checksum How to use checksums |
8b8c25caf0263de5ec2662d02cad14a3f83009cab93b69983ab78b5d0d4e90ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / aws_prototyping_sdk.static_website-0.19.68-py3-none-any.whl
| Download URL | aws_prototyping_sdk.static_website-0.19.68-py3-none-any.whl |
|---|---|
| Size | 108.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9464677e1a0c53a2fa5d6b6bec07df5868be8cd7304300d2a908a291b00710e2
|
|
BLAKE2b-256 checksum How to use checksums |
ffcb0ec00a6158060369ebd79edbf6bd7bfe438894b6560ff4ee4aba1753b6d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for aws-prototyping-sdk.static-website 0.19.68
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.