DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

How I can enable s3 caching on an existing aws codebuild project?

I have made a CI/CD pipeline using amazon aws codepipeline, aws codebuild and github for a laravel rest api project. Now what I want to achieve is to cache the composer dependencies in a common bucket therefore any other project could use the same dependencies without need to download them all over again.

So can you help me with that look bellow for more info regarding my issue:
https://devops.stackexchange.com/q/11271/4396

Top comments (3)

Collapse
 
diek profile image
diek

You can store the dependencies in a S3 as a compressed file, pricing is better for less amount of files.
Then when you deploy a new instance, you only have to download your S3 file and decompress it.
I think that the best way to do this is to dockerize your deployment and add the download dependencies and decompression commands into the DockerFile to automatize it.

If it not fits with your needs, feel free to contact me to talk about it in a closer way.

Collapse
 
pcmagas profile image
Dimitrios Desyllas

So the only way to do that is via manually typing s3 commands to upload the directory into the s3 bucket? The question is that I need to edit an existing codebuild step in order to enable caching, but the aws console does not allow it. So I want to edit this step so I can do it so.

Collapse
 
diek profile image
diek

Ah, sorry, i cannot help with codebuild, i don't know how it works.