Skip to content

Commit

Permalink
Merge pull request #38737 from sumit-sampang-rai/s3-object-can-read-a…
Browse files Browse the repository at this point in the history
…pplication-sql

s3 datasource aws_s3_object can read application/x-sql
  • Loading branch information
ewbankkit authored Aug 7, 2024
2 parents a2332ce + 9172b87 commit 311c0a3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changelog/38737.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:enhancement
data-source/aws_s3_object: Expand content types that can be read from S3 to include `application/x-sql`
```

```release-note:enhancement
data-source/aws_s3_bucket_object: Expand content types that can be read from S3 to include include `application/x-sql`
```
1 change: 1 addition & 0 deletions internal/service/s3/object_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ func isContentTypeAllowed(contentType *string) bool {
regexache.MustCompile(`^application/x-sh$`),
regexache.MustCompile(`^application/xhtml\+xml$`),
regexache.MustCompile(`^application/xml$`),
regexache.MustCompile(`^application/x-sql$`),
regexache.MustCompile(`^text/.+`),
}
for _, r := range allowedContentTypes {
Expand Down
15 changes: 14 additions & 1 deletion website/docs/d/s3_bucket_object.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,20 @@ description: |-
The S3 object data source allows access to the metadata and
_optionally_ (see below) content of an object stored inside S3 bucket.

~> **Note:** The content of an object (`body` field) is available only for objects which have a human-readable `Content-Type` (`text/*` and `application/json`). This is to prevent printing unsafe characters and potentially downloading large amount of data which would be thrown away in favor of metadata.
~> **Note:** The content of an object (`body` field) is available only for objects which have a human-readable `Content-Type`:

* `text/*`
* `application/json`
* `application/ld+json`
* `application/x-httpd-php`
* `application/xhtml+xml`
* `application/x-csh`
* `application/x-sh`
* `application/xml`
* `application/atom+xml`
* `application/x-sql`

This is to prevent printing unsafe characters and potentially downloading large amount of data which would be thrown away in favor of metadata.

## Example Usage

Expand Down
15 changes: 14 additions & 1 deletion website/docs/d/s3_object.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ description: |-
The S3 object data source allows access to the metadata and
_optionally_ (see below) content of an object stored inside S3 bucket.

~> **Note:** The content of an object (`body` field) is available only for objects which have a human-readable `Content-Type` (`text/*` and `application/json`). This is to prevent printing unsafe characters and potentially downloading large amount of data which would be thrown away in favor of metadata.
~> **Note:** The content of an object (`body` field) is available only for objects which have a human-readable `Content-Type`:

* `text/*`
* `application/json`
* `application/ld+json`
* `application/x-httpd-php`
* `application/xhtml+xml`
* `application/x-csh`
* `application/x-sh`
* `application/xml`
* `application/atom+xml`
* `application/x-sql`

This is to prevent printing unsafe characters and potentially downloading large amount of data which would be thrown away in favor of metadata.

## Example Usage

Expand Down

0 comments on commit 311c0a3

Please sign in to comment.