| Variable | What is it? |
|---|---|
| CLOUDFRONT_DOMAIN | The domain of the created distribution |
| CLOUDFRONT_PUBLIC_KEY_ID | The unique ID of the public key. This can be found under the "Public Keys" section in the CloudFront sidebar e.g. K1X0XXXXXXXXXX |
| SECRET_ID | The name of the secret that holds the private key.In this article, I have set it as "clodufront/privatekey" |
π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Inspect the DOM and save the parent tbody element as a global variable temp1 | |
| async function automate() { | |
| for (const item of temp1.childNodes) { | |
| if (item.classList.contains("_X-XXXX")) { // replace with the class name of the <td> entry with validation error | |
| const edit = item.getElementsByClassName("pointer")[0]; | |
| const clickEvent = new Event("click", { bubbles: true }); | |
| edit.dispatchEvent(clickEvent); | |
| await sleep(1000); |
| Fields | Purpose |
|---|---|
| Origin domain | The source of your content and this input field will display all the available S3 buckets from your account. You can select the bucket from where you wish to serve the content |
| Origin Access | The access boundary for the S3 bucket Public - Provided the bucket has public access, this option will allow anyone to access the objects from the bucket using the generated CloudFront URL (e.g. https://custom.cloudfront.com/image.png) Origin access control settings - This is the recommended access level and we will use this to create a new control setting that enables only signed URLs to access the content |
| Restrict viewer access | This will control the viewing access of the content from the bucketNo - Anyone can download/view the content using the custom CloudFront URL (e.g. https://custom.cloudfront.com/image.png)**Yes** - The objects will be accessible only using a signed URL (or a signe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Runtime: Java 17 | |
| * Required Gradle Dependencies: | |
| * | |
| * | |
| dependencies { | |
| implementation 'com.amazonaws:aws-lambda-java-core:1.2.2' | |
| implementation 'com.amazonaws:aws-java-sdk-cloudfront:1.12.638' | |
| implementation 'software.amazon.awssdk:s3:2.23.0' | |
| implementation 'software.amazon.awssdk:secretsmanager:2.20.109' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| # The cryptography package needs to be bundled along with this script as a zip file | |
| # Use the exact command from below to download the cryptography package | |
| # The cryptography package relies on a shared object file which will not be available | |
| # in the lambda runtime. Running this command ensures that it is added to the target directory | |
| pip install \ | |
| --platform manylinux2014_x86_64 \ | |
| --implementation cp \ |