Share:
copying SVG files to S3 using AWS CLI
Although a really simple one once you work it out, but painful before you get there, the AWS CLI is failry primitive in some respects and can cause some pain in getting things done.
We recently had this problem introducing SVG files to our static website that is built using AWESTRUCT and hosted on S3. Yes, AWESTRUCT is pretty cool.
SVG files by default have the wrong content-type and wont render correctly. To solve this, we did the following.
aws s3 sync _site/ s3://BUCKET --delete --exclude '*.svg'
aws s3 sync _site/ s3://BUCKET --delete --exclude '*' --include '*.svg' --content-type 'image/svg+xml'
Pretty easy but took some time to work out the right combination, especially since we are using Jenkins to build a Docker container to produce the slave that then pushes to S3.
Related Tech Posts
-
How to deploy a Quarkus Lambda Application using Lambda Containers
Learn how to deploy a Quarkus Lambda Application using Lambda Containers.
-
Using Cfhighlander to create reusable and modular AWS CloudFormation templates
Learn how Cfhighlander‘s existing component library can be used to produce reusable CloudFormation templates for managing AWS resources in a modular way.
-
Start and Stop instances on AWS
Moving your infrastructure to one of the mainstream cloud providers is in most cases a massive cost saving for organizations. However, nowadays the goal is no longer to just to get to the cloud, but to make the best use of it by utilizing services at your disposal.
-
Running docker containers from the CLI backed by AWS
How to run docker containers in AWS, whilst working with them like you would _locally_.
DevOps Insights
directly to your inbox
Join your peers and sign up to our best content, news, services and events.