s3deploy | simple tool to deploy static websites | Cloud Storage library
kandi X-RAY | s3deploy Summary
kandi X-RAY | s3deploy Summary
A simple tool to deploy static websites to Amazon S3 and CloudFront with Gzip and custom headers support (e.g. "Cache-Control"). It uses ETag hashes to check if a file has changed, which makes it optimal in combination with static site generators like Hugo.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of s3deploy
s3deploy Key Features
s3deploy Examples and Code Snippets
Community Discussions
Trending Discussions on s3deploy
QUESTION
How can I stop CDK from creating a new OAI everytime I create a new CloudFront distribution?
I want to use XXXXXXXXXXXXX1
for all distributions, but XXXXXXXXXXXXX2
is created, not sure why because I am explicitly saying to use the other with: cloudfront.OriginAccessIdentity(this, "XXXXXXXXXXXXX1")
Here is my CDK stack with TypeScript
...ANSWER
Answered 2022-Apr-03 at 17:08This is the expected behaviour as written. new cloudfront.OriginAccessIdentity(this, "XXXXXXXXXXXXX1")
creates a new OAI for each stack instance deployed. The second parameter is the CDK id, not an OAI id.
To get a read-only reference to an existing OAI created outside the CDK App, use the static OriginAccessIdentity.fromOriginAccessIdentityName method, passing "XXXXXXXXXXXXX1"
as the third argument.
QUESTION
Can someone answer my these two questions plz
Do I need to create seprate s3 buckets like one for react app and other for Images and files ?
When I deploy my app like this:
...
ANSWER
Answered 2022-Mar-17 at 12:37Yes you should have a separate bucket for website deployment and data storage. The bucket you use for website will usually be a public one (unless you are using it with cloudfront).
QUESTION
I have deployed my website here:
...ANSWER
Answered 2022-Jan-17 at 09:09Your website doesn't feel like 100% (client side) static website. By that I mean every HTML page is pre-generated and everything is static on client side. If that's the case then /work/1
should not load any html page as it's not a html resource. For it to be HTML resource it should be like /work/1.html
With that being said, it looks like you're using React or some other technology which translates the routing when previous page is known. /
-> /work/1
As you have CloudFront already in your stack. Just set the error pages to redirect back to home page and then it should work fine. Attaching the solution for my react app hosted on S3+CloudFront.
QUESTION
Trying to deploy a Gatsby site with AWS CDK but the BucketDeployment always fails the error message:
...ANSWER
Answered 2022-Jan-04 at 16:38The lambda responsible for unzipping the archive and copying the contents to the destination crashed because it ran out of memory.
Increase its memory with memoryLimit
when creating your BucketDeployment
construct. By default, the lambda gets 128MB of memory, which is insufficient in your case.
QUESTION
I am trying to setup a brand new pipeline with the last version of AWS CDK for typescript (1.128).
The creation of the pipeline is pretty straight forward. I have added sources and build stages with no issues. The objective here is to have an automatic deployment of a static landing page.
So far I have this piece of code:
...ANSWER
Answered 2021-Oct-26 at 03:05You can extend Step
and implement ICodePipelineActionFactory
. It's an interface that gets codepipeline.IStage
and adds whatever actions you need to add.
Once you have the factory step, you pass it as either pre
or post
options of the addStage()
method option.
Something close to the following should work:
QUESTION
I am attempting to upload a file to a S3 bucket created using CDK, however i am consistently running into the same error even using the example code provided by AWS.
Here is the stack.
...ANSWER
Answered 2020-Oct-14 at 12:01Try to pass env
into the Bucket Stack props.
Code snippet:
This should be located under bin
folder when you decalre stacks.
QUESTION
Is it possible to run an external build command as part of a CDK stack sequence? Intention: 1) create a rest API, 2) write rest URL to config file, 3) build and deploy a React app:
...ANSWER
Answered 2020-May-11 at 10:15Unfortunately, it is not possible, as the necessary references are only available after deploy and therefore after you try to write the file (the file will contain cdk tokens).
I personally have solved this problem by telling cdk to output the apigateway URLs to a file and then parse it after the deploy to upload it so a S3 bucket, to do it you need:
- deploy with the output file options, for example:
cdk deploy -O ./cdk.out/deploy-output.json
- In
./cdk.out/deploy-output.json
you will find a JSON object with a key for each stack that produced an output (e.g. your stack that contains an API gateway) - manually parse that JSON to get your apigateway url
- create your configuration file and upload it to S3 (you can do it via aws-sdk)
Of course, you have the last steps in a custom script, which means that you have to wrap your cdk deploy
. I suggest to do so with a nodejs script, so that you can leverage aws-sdk to upload your file to S3 easily.
QUESTION
In CodePipeline in the AWS console its possible to specify a S3 deploy step https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-s3deploy.html I'd like to be able to do this exactly, but in cloudformation. I'm missing something obvious here. Any help appreciated.
I was able to get a source and build step in cloudformation for the pipeline, but not the deploy step. The provider for that step I would think would be s3, but I can't seem to get it to work.
...ANSWER
Answered 2020-Jan-22 at 20:07Here is a sample deploy step for S3
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install s3deploy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page