Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s3 datasource aws_s3_object can read application/x-sql #38737

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading