aws-prototyping-sdk.static-website


Nameaws-prototyping-sdk.static-website JSON
Version 0.19.68 PyPI version JSON
download
home_pagehttps://github.com/aws/aws-prototyping-sdk
Summary@aws-prototyping-sdk/static-website
upload_time2023-08-24 23:17:28
maintainer
docs_urlNone
authorAWS APJ COPE<apj-cope@amazon.com>
requires_python~=3.7
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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](https://docs.amplify.aws/lib/client-configuration/configuring-amplify-categories/q/platform/js/#authentication-amazon-cognito).

```python
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,
        }
    },
});
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aws/aws-prototyping-sdk",
    "name": "aws-prototyping-sdk.static-website",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "~=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "AWS APJ COPE<apj-cope@amazon.com>",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/8b/8c/25caf0263de5ec2662d02cad14a3f83009cab93b69983ab78b5d0d4e90ee/aws_prototyping_sdk.static_website-0.19.68.tar.gz",
    "platform": null,
    "description": "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.\n\nBelow is a conceptual view of the default architecture this module creates:\n\n```\nCloudfront Distribution (HTTPS only) -> S3 Bucket (Private via OAI)\n|_ WAF V2 ACL                                |_ index.html (+ other website files and assets)\n                                             |_ runtime-config.json\n```\n\nA 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](https://docs.amplify.aws/lib/client-configuration/configuring-amplify-categories/q/platform/js/#authentication-amazon-cognito).\n\n```python\nconst userIdentity = new UserIdentity(this, 'UserIdentity');\nnew StaticWebsite(this, 'StaticWebsite', {\n    websiteContentPath: '<relative>/<path>/<to>/<built>/<website>',\n    runtimeOptions: {\n        jsonPayload: {\n            region: Stack.of(this).region,\n            identityPoolId: userIdentity.identityPool.identityPoolId,\n            userPoolId: userIdentity.userPool?.userPoolId,\n            userPoolWebClientId: userIdentity.userPoolClient?.userPoolClientId,\n        }\n    },\n});\n```\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "@aws-prototyping-sdk/static-website",
    "version": "0.19.68",
    "project_urls": {
        "Homepage": "https://github.com/aws/aws-prototyping-sdk",
        "Source": "https://github.com/aws/aws-prototyping-sdk"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ffcb0ec00a6158060369ebd79edbf6bd7bfe438894b6560ff4ee4aba1753b6d4",
                "md5": "992464bd71e8d403f5adbaaa1f9964f9",
                "sha256": "9464677e1a0c53a2fa5d6b6bec07df5868be8cd7304300d2a908a291b00710e2"
            },
            "downloads": -1,
            "filename": "aws_prototyping_sdk.static_website-0.19.68-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "992464bd71e8d403f5adbaaa1f9964f9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.7",
            "size": 108055,
            "upload_time": "2023-08-24T23:17:27",
            "upload_time_iso_8601": "2023-08-24T23:17:27.106281Z",
            "url": "https://files.pythonhosted.org/packages/ff/cb/0ec00a6158060369ebd79edbf6bd7bfe438894b6560ff4ee4aba1753b6d4/aws_prototyping_sdk.static_website-0.19.68-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b8c25caf0263de5ec2662d02cad14a3f83009cab93b69983ab78b5d0d4e90ee",
                "md5": "91f3b9d26e26f4b5c58a1ced60b80013",
                "sha256": "c0450adbcc7ddeee0dee90d0b3585e303ef653597be092d0d7f4c11b388773b4"
            },
            "downloads": -1,
            "filename": "aws_prototyping_sdk.static_website-0.19.68.tar.gz",
            "has_sig": false,
            "md5_digest": "91f3b9d26e26f4b5c58a1ced60b80013",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.7",
            "size": 109600,
            "upload_time": "2023-08-24T23:17:28",
            "upload_time_iso_8601": "2023-08-24T23:17:28.364765Z",
            "url": "https://files.pythonhosted.org/packages/8b/8c/25caf0263de5ec2662d02cad14a3f83009cab93b69983ab78b5d0d4e90ee/aws_prototyping_sdk.static_website-0.19.68.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-24 23:17:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aws",
    "github_project": "aws-prototyping-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aws-prototyping-sdk.static-website"
}
        
Elapsed time: 0.11941s