copying SVG files to S3 using AWS CLI
15 April 2015
1 Minute Read
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
Learn how Cfhighlander‘s existing component library can be used to produce reusable CloudFormation templates for managing AWS resources in a modular way.
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.
How to run docker containers in AWS, whilst working with them like you would _locally_.
In the wake of doing things faster with serverless, the serverless.com project and the benefits you get from Lambda. Discover how to automate the deployment of serverless projects in Jenkins.
directly to your inbox
Join your peers and sign up to our best content, news, services and events.