![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@headup/aws-cdn
Advanced tools
An AWS CDK Construct for creating static file hosts using S3, CloudFront and Edge Lambda.
Features:
_redirects
file supportstrict-transport-security
, x-xss-protection
etc.).html
extensions eg. /foo
will resolve to /foo.html
in the S3 Bucketnpm install @headup/aws-cdn
Lets also install aws-cdk v2 and TypeScript tooling
npm install aws-cdk aws-cdk-lib constructs typescript ts-node
You need to have an AWS account configured with enough permissions to manage CloudFormation stacks, IAM, S3 Buckets and Lambda Functions.
Create src/stacks.ts
:
import * as cdk from "@aws-cdk/core";
import { HeadupWebsite } from "@headup/aws-cdn";
class MyStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props: cdk.StackProps) {
super(scope, id, props);
new HeadupWebsite(this, "mywebsite", {
descriptionName: "My Web Site", // human readable name for various comment and description fields
// Create alias A record for CloudFront distribution. This is
// alternative for *.cloudfront.net domain. Use this as the
// domain CNAME value. Using own domain here allows more flexibility
// since it can be rerouted if needed.
aRecordAlias: {
// Get the id from the AWS Route53 panel
hostedZoneId: "***",
zoneName: "valucloud.fi",
domainName: "customer-example.valucloud.fi",
},
// After first deploy you can assign a custom domain to the website
// domainNames: ["example.com"],
// A matching certificate in the certificate manager
// certificateArn:
// "arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
});
}
}
const app = new cdk.App();
new MyStack(app, "my-stack", {
env: { account: "<aws account id>", region: "eu-north-1" },
});
❗️ ❗️ ❗️ ❗️ Note
Once you have deployed the stack DO NOT CHANGE the passed id (here mywebsite
)
because it causes recreation of the CloudFront distribution which means you have
update your DNS too.
Create cdk.json
{
"app": "npx ts-node src/stacks.ts"
}
Deploy the stack(s).
npx cdk deploy mywebsite mywebsite-edge-lambda
The edge lambda stack is implicit since Edge Lambdas must be configured to the
us-east-1
region and a single stack can be only in one region.
xxxxxxxxxxxxxx.cloudfront.net
) using the AWS Console UI and set it as the
CNAME of your domaincloudFrontDomain
option and put in your domain and the ARN of
the certificateYou can create multiple instances of the HeadupWebsite
construct in your stack.
You can also manually create the IAM user and the Edge Router to share them between the sites:
import { HeadupWebsite, HeadupEdgeRouter } from "@headup/aws-cdn";
class MyStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props: cdk.StackProps) {
super(scope, id, props);
const user = new iam.User(this, "my-shared-user");
const edgeRouter = new HeadupEdgeRouter(this, "myedge-stack", {
stackId: "myedge-stack",
});
new HeadupWebsite(this, "mywebsite1", { user, edgeRouter });
new HeadupWebsite(this, "mywebsite2", { user, edgeRouter });
new HeadupWebsite(this, "mywebsite3", { user, edgeRouter });
}
}
FAQs
AWS CDK Stack for Headup static sites
The npm package @headup/aws-cdn receives a total of 24 weekly downloads. As such, @headup/aws-cdn popularity was classified as not popular.
We found that @headup/aws-cdn demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.