From aecb4e869b80a65ce4bfc09a5dc0bec56ece7da7 Mon Sep 17 00:00:00 2001 From: Sumit Sampang Rai <4235912+sumit-sampang-rai@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:11:55 +0545 Subject: [PATCH 1/6] Add SQL application content type --- internal/service/s3/object_data_source.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/s3/object_data_source.go b/internal/service/s3/object_data_source.go index 380426fd97c7..c88076290a68 100644 --- a/internal/service/s3/object_data_source.go +++ b/internal/service/s3/object_data_source.go @@ -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 { From e212647f563b72e9789d430cb12a1e60b6c6393b Mon Sep 17 00:00:00 2001 From: Sumit Sampang Rai <4235912+sumit-sampang-rai@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:28:45 +0545 Subject: [PATCH 2/6] Added supported content-types in s3_object.html.markdown --- .../docs/cdktf/python/d/s3_object.html.markdown | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/website/docs/cdktf/python/d/s3_object.html.markdown b/website/docs/cdktf/python/d/s3_object.html.markdown index 2ec6776d21d6..3aab950b65f2 100644 --- a/website/docs/cdktf/python/d/s3_object.html.markdown +++ b/website/docs/cdktf/python/d/s3_object.html.markdown @@ -13,7 +13,19 @@ 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 @@ -120,4 +132,4 @@ This data source exports the following attributes in addition to the arguments a -> **Note:** Terraform ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`. - \ No newline at end of file + From 2a3c73bdf7c7aa4a3fba0052b3be23544ce1865f Mon Sep 17 00:00:00 2001 From: Sumit Sampang Rai <4235912+sumit-sampang-rai@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:30:15 +0545 Subject: [PATCH 3/6] Added supported content-types in s3_bucket_object.html.markdown --- .../python/d/s3_bucket_object.html.markdown | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/website/docs/cdktf/python/d/s3_bucket_object.html.markdown b/website/docs/cdktf/python/d/s3_bucket_object.html.markdown index 3a01e9a5dee2..cec7a422394f 100644 --- a/website/docs/cdktf/python/d/s3_bucket_object.html.markdown +++ b/website/docs/cdktf/python/d/s3_bucket_object.html.markdown @@ -15,7 +15,19 @@ 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 @@ -116,4 +128,4 @@ This data source exports the following attributes in addition to the arguments a -> **Note:** Terraform ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`. - \ No newline at end of file + From 7c3b405bb5ccf0006a9142fe66f03057deec2ee0 Mon Sep 17 00:00:00 2001 From: Sumit Sampang Rai <4235912+sumit-sampang-rai@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:35:21 +0545 Subject: [PATCH 4/6] Add changelog --- .changelog/38737.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/38737.txt diff --git a/.changelog/38737.txt b/.changelog/38737.txt new file mode 100644 index 000000000000..3ae3bf8cd496 --- /dev/null +++ b/.changelog/38737.txt @@ -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` +``` From 787e52223c79da7b22f6c6527577ff40aabf86dc Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 7 Aug 2024 09:12:38 -0400 Subject: [PATCH 5/6] CDKTF documentation is generated. --- .../python/d/s3_bucket_object.html.markdown | 16 ++-------------- .../docs/cdktf/python/d/s3_object.html.markdown | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/website/docs/cdktf/python/d/s3_bucket_object.html.markdown b/website/docs/cdktf/python/d/s3_bucket_object.html.markdown index cec7a422394f..3a01e9a5dee2 100644 --- a/website/docs/cdktf/python/d/s3_bucket_object.html.markdown +++ b/website/docs/cdktf/python/d/s3_bucket_object.html.markdown @@ -15,19 +15,7 @@ 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/*` -* `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. +~> **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. ## Example Usage @@ -128,4 +116,4 @@ This data source exports the following attributes in addition to the arguments a -> **Note:** Terraform ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/s3_object.html.markdown b/website/docs/cdktf/python/d/s3_object.html.markdown index 3aab950b65f2..2ec6776d21d6 100644 --- a/website/docs/cdktf/python/d/s3_object.html.markdown +++ b/website/docs/cdktf/python/d/s3_object.html.markdown @@ -13,19 +13,7 @@ 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/*` -* `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. +~> **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. ## Example Usage @@ -132,4 +120,4 @@ This data source exports the following attributes in addition to the arguments a -> **Note:** Terraform ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`. - + \ No newline at end of file From 9172b874c6c4ea3b5c7dcbc64511870dfc2cccec Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 7 Aug 2024 09:15:21 -0400 Subject: [PATCH 6/6] Update documentation. --- website/docs/d/s3_bucket_object.html.markdown | 15 ++++++++++++++- website/docs/d/s3_object.html.markdown | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/website/docs/d/s3_bucket_object.html.markdown b/website/docs/d/s3_bucket_object.html.markdown index 70a199e1c381..2bd430bf092a 100644 --- a/website/docs/d/s3_bucket_object.html.markdown +++ b/website/docs/d/s3_bucket_object.html.markdown @@ -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 diff --git a/website/docs/d/s3_object.html.markdown b/website/docs/d/s3_object.html.markdown index 923ca0776c22..c110f4f95398 100644 --- a/website/docs/d/s3_object.html.markdown +++ b/website/docs/d/s3_object.html.markdown @@ -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