aws-s3 | Amazon S3 volume type for Craft CMS | Plugin library
kandi X-RAY | aws-s3 Summary
kandi X-RAY | aws-s3 Summary
Amazon S3 volume type for Craft CMS.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Build the config array
- Convert volumes to S3 .
- Load bucket list .
- Execute a command
- Load bucket data
- Cleans up all volumes that have failed .
- Get a command .
- Initializes the bucket .
- To remove storage class setting .
aws-s3 Key Features
aws-s3 Examples and Code Snippets
Community Discussions
Trending Discussions on aws-s3
QUESTION
I'm trying to use CDK and CodePipeline to build and deploy a React application to S3. After the CodePipeline
phase, in my own stack, I defined the S3 bucket like this:
ANSWER
Answered 2022-Jan-28 at 07:51For the first question:
And if I change to Source.asset("./build") I get the error: ... Why is it searching for the build directory on my machine?
This is happening when you run cdk synth
locally. Remember, cdk synth
will always reference the file system where this command is run. Locally it will be your machine, in the pipeline it will be in the container or environment that is being used by AWS CodePipeline.
Dig a little deeper into BucketDeployment
But also, there is some interesting things that happen here that could be helpful. BucketDeployment
doesn't just pull from the source you reference in BucketDeployment.sources
and upload it to the bucket you specify in BucketDeployment.destinationBucket
. According to the BucketDeployment docs the assets are uploaded to an intermediary bucket and then later merged to your bucket. This matters because it will explain your error received Error: Cannot find asset at C:\Users\pupeno\Code\ww3fe\build
because when you run cdk synth
it will expect the dir ./build
as stated in Source.asset("./build")
to exist.
This gets really interesting when trying to use a CodePipeline
to build and deploy a single page app like React in your case. By default, CodePipeline will execute a Source
step, followed a Synth
step, then any of the waves or stages you add after. Adding a wave that builds your react app won't work right away because we now see that the output directory of building you react app is needed during the Synth
step because of how BucketDeployment
works. We need to be able to have the order be Source -> Build -> Synth -> Deploy. As found in this question, we can control the order of the steps by using inputs and outputs. CodePipeline will order the steps to ensure input/output dependencies are met. So we need the have our Synth step use the Build's output as its input.
Concerns with the currently defined pipeline
I believe that your current pipeline is missing a CodeBuildStep
that would bundle your react app and output it to the directory that you specified in BucketDeployment.sources
. We also need to set the inputs to order these actions correctly. Below are some updates to the pipeline definition, though some changes may need to be made to have the correct file paths. Also, set BucketDeployment.sources
to the dir where your app bundle is written to.
QUESTION
Our app allow our clients large file uploads. Files are stored on AWS/S3 and we use Uppy for the upload, and dockerize it to be used under a kubernetes deployment where we can up the number of instances.
It works well, but we noticed all > 5GB uploads fail. I know uppy has a plugin for AWS multipart uploads, but even when installed during the container image creation, the result is the same.
Here's our Dockerfile. Has someone ever succeeded in uploading > 5GB files to S3 via uppy? IS there anything we're missing?
...ANSWER
Answered 2022-Mar-06 at 04:38In the AWS S3 service in a single PUT operation, you can upload a single object up to 5 GB in size.
To upload > 5GB files to S3 you need to use the multipart upload S3 API, and also the AwsS3Multipart
Uppy API.
Check your upload code to understand if you are using AWSS3Multipart correctly, setting the limit properly for example, in this case a limit between 5 and 15 is recommended.
QUESTION
I am new to Terraform.
I have two list of objects and I would like to merge them as a map in terraform:
...ANSWER
Answered 2022-Mar-03 at 23:56Your syntax creates list of maps, not maps. The correct way to create the maps is:
QUESTION
Currently i'm using laravel lumen version 8 for API and i want to integrate laravel/passport
for OAuth authorization for the API but when i try to install laravel/passport
i get the following error and cannot install laravel/passport
for the project. I tried installing dusterio/lumen
library for laravel/passport
but the package had also some issue with lumen 8.
ANSWER
Answered 2022-Feb-28 at 06:27Main problem is the tymon/jwt-auth removing this package and clean install fixed the problem.
QUESTION
I've an Angular project on a Bitbucket repository. I created this pipeline that deploys the application on AWS S3 and invalidate the CloudFront distribution. Everything works fine. I would like to add the build number to the published version in order to know not just the version of the application but also the build that generated it.
...ANSWER
Answered 2022-Feb-08 at 11:15The Bitbucket Pipelines yml file is just running Bash/shell commands on a Linux Docker machine. So you can use the normal Bash commands, like sed and perl, to do a "find and replace" inside a JSON text file.
1. Generate the correct Regular ExpressionWe need to write an expression that will search the text in a file for "version": "dd.dd.dd"
and replace it with "version": "dd.dd.ddb123"
, where "d"
is a digit from 0-9
.
Use https://regex101.com to write and test a regex that does this. Here's a working expression and demo and an explanation: https://regex101.com/r/sRviUF/2
- Regular Expression:
("version".*:.*"\d.*(?="))
- Substitution:
${1}b123
Explanation:
(
and)
= Capture the found text as group 1, to use it as a substitution/replacement later"version".*:.*"
= Look for the string"version":"
with 0 or more spaces allowed before and after the colon:
\d.*(?=")
= Look for a single digit0-9
, then any characters. Then use a Positive Lookahead(?=")
to stop the capture before the next speech mark character"
${1}b123
= Replace with the captured group 1, then add a"b"
then add the numbers123
.
Test and practice on a Linux or MacOS Terminal, or use the Linux Bash Shell on Windows 10, or use an online Linux Terminal.
You will discover that the sed command cannot handle regexes with positive lookahead or negative lookahead, so we have to use perl
instead. We also need to simulate the BITBUCKET_BUILD_NUMBER
environment variable that is available on the Docker machine when the Pipeline is running.
QUESTION
I have the following AWS CDK pipeline which works. It basically takes source from 2 different GitHub repositories (one for the application code, one for the cdk code) and builds the application code and the cdk code :
...ANSWER
Answered 2022-Feb-04 at 15:36So I found a solution. Maybe not the solution. Indeed, this seems quite convoluted ... and I am sure there is a better way.
So the solution lies in the fact that the ShellStep in the CodePipeline construct attaches the output of additionalInputs
(so the result of the previous CodeBuildStep i.e. lambdaBuildStep
) in a specific directory which is dynamically generated but stored in an environment variable called CODEBUILD_SRC_DIR_BuildLambda_lambda_repo
so you can see it's a combination of the name of the CodeBuildStep and the repo (with the dash changed to underscores).
So my solution was to use this environment variables as my Lambda code asset.
QUESTION
I'm using CDK to deploy a CodePipeline that builds and deploys a React application to S3. All of that is working, but I want the deployment to update a domain name to point that S3 bucket.
I already have the Zone defined in Route53 but it is defined by a different cloud formation stack because there are a lot of details that are not relevant for this app (MX, TXT, etc). What's the right way for my Pipeline/Stacks to set those domain names?
I could think of two solutions:
- Delegate the domain to another zone, so zone
example.com
delegatesstaging.example.com
. - Have my pipeline inject records into the existing zone.
I didn't try the delegation zone method. I was slightly concerned about manually maintaining the generated nameservers from staging.example.com
into my CloudFormation for zone example.com
.
I did try injecting the records into the existing zone, but I run into some issues. I'm open to either solving these issues or doing this whichever way is correct.
In my stack (full pipeline at the bottom) I first define and deploy to the bucket:
...ANSWER
Answered 2022-Jan-31 at 16:31You cannot depend on CDK pipeline to fix itself if the synth stage is failing, since the Pipeline CloudFormation Stack is changed in the SelfMutate stage which uses the output of the synth stage. You will need to do one of the following options to fix your pipeline:
Run
cdk synth
andcdk deploy PipelineStack
locally (or anywhere outside the pipeline, where you have the required AWS IAM permissions). Edit: You will need to temporarily set selfMutatation tofalse
for this to work (Reference)Temporarily remove
route53.HostedZone.fromLookup
androute53.CnameRecord
from your MainStack while still keeping therolePolicyStatements
change. Commit and push your code, let CodePipeline run once, making sure that the Pipeline self mutates and the IAM role has the required additional permissions. Add back the route53 constructs, commit, push again and check whether your code works with the new changes.
QUESTION
here is the error:
ERROR TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
Here is the code
...ANSWER
Answered 2022-Jan-20 at 04:56- If you're returning
of(result)
inside aswitchMap()
, then usemap()
instead. You can simply return the result without wrapping it inof()
. - Your switch block handles two cases, but what if both cases fail? That is when you are not returning anything. Try adding a default case at the end to return something if both cases fail.
QUESTION
I am trying to deploy new things on our server.
It's failing every time i don't know why, every time i get:
...ANSWER
Answered 2021-Dec-15 at 14:36I got my problem solved. At first i tried to apply solutions at this post but it didn't solve my problem.
The only thing that solved my problem was by upgrading my composer version.
So i upgraded my composer from 1.8.0
to 2.1.3
by:
QUESTION
I'm trying out the new Strapi v4. I installed the provider-upload-aws-s3 to upload my images to S3 and configured it. I do see my images in the S3 bucket, but I do not see them in the Media Gallery. I inspected request and I see I'm getting this error:
Content Security Policy: The page’s settings blocked the loading of a resource at {my img URL}.
When trying to get the image directly in the browser with the same URL and the image is being loaded.
I believe it has something to do with this warning (quote from Strapi documentation):
Strapi has a default Security Middleware that has a very strict contentSecurityPolicy that limits loading images and media to "'self'" only, see the example configuration on the provider page or take a look at our middleare documentation for more information.
But I'm not sure what to do with it and how to override it. So how do I make the uploaded to S3 images appear in the Media Gallery?
...ANSWER
Answered 2021-Dec-15 at 06:27Well, at this point I was really sure it's a bug and reported it at Strapi Github issues. But according to this answer I received some more configuration had to be done in middlewares.js
file:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aws-s3
To create a new asset volume for your Amazon S3 bucket, go to Settings → Assets, create a new volume, and set the Volume Type setting to “Amazon S3”. Tip: The Base URL, Access Key ID, Secret Access Key, Bucket, Region, Subfolder, CloudFront Distribution ID, and CloudFront Path Prefix settings can be set to environment variables. See Environmental Configuration in the Craft docs to learn more about that.
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