Closed MaximilianoAguirre closed 1 year ago
This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days
This PR was automatically closed because of stale in 10 days
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
This PR implements a feature to detect the content type based in the value of the key set to the object once uploaded. It uses a mime types DB used by a JS library with great adoption which bases the definitions mainly in
IANA
standards. There is a local copy of the DB that can be used, and an optional variable that allows to download a DB when running terraform.If
content_type
variable is set, everything is disabled.Motivation and Context
Often when uploading s3 objects to s3 through terraform resources it is difficult to dynamically set the content type of the object, specially when iterating with
fileset
. Content type is quite important in certain scenarios, for example when using the bucket as a website (the Content-Type header sent in the HTTP header to the client will rely on this).Breaking Changes
There is a new dependency of the
hashicorp/http
provider in order to be able to expose theon demand query
of the DB feature. It is not a breaking change but a new dependency that existing environments might have conflicts with.How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectsBased in the
examples/object
, many of the possible combinations of variables to create an object have been successfully deployed:pre-commit run -a
on my pull request