feat: add ListObjects method & relevant e2e tests
This commit is contained in:
1 parent
56f89a5dcf
commit
241901319d
17 files changed
+1242
-263
No files matched your search
Vendored
+41
-1
@@ -16,7 +16,47 @@ locals {
|
||||
hashicorp_email = split(":", data.aws_caller_identity.current.user_id)[1]
|
||||
tags = {
|
||||
User = split(":", data.aws_caller_identity.current.user_id)[1]
|
||||
Repo = "boundary-plugin-aws"
|
||||
Repo = "boundary-plugin-aws"
|
||||
Environment = "Demo"
|
||||
}
|
||||
|
||||
# total number of objects of each type to create
|
||||
s3_pagination_test_object_count = 350
|
||||
# Dynamically build a flat map of S3 objects:
|
||||
# - root-level text files
|
||||
# - nested JSON files
|
||||
# - placeholder "empty directories"
|
||||
# - some static files in list-objects directory
|
||||
# This map is consumed directly by an aws_s3_object resource
|
||||
s3_files = merge(
|
||||
# Root-level text files
|
||||
{
|
||||
for i in range(local.s3_pagination_test_object_count) :
|
||||
"list-objects-paginated/root-file-${i}.txt" => "This is a root-level file #${i}."
|
||||
},
|
||||
|
||||
# Nested JSON files inside sub-directories
|
||||
{
|
||||
for i in range(local.s3_pagination_test_object_count) :
|
||||
"list-objects-paginated/nested-dir-${i}/data-file-${i}.json" =>
|
||||
jsonencode({
|
||||
id = i,
|
||||
message = "This is a nested JSON file #${i}."
|
||||
})
|
||||
},
|
||||
|
||||
# "Empty" directories (in S3 these are just placeholder objects ending with `/`)
|
||||
{
|
||||
for i in range(local.s3_pagination_test_object_count) :
|
||||
"list-objects-paginated/empty-dir-${i}/dir-${i}/" => "" # zero-length object to mimic directory
|
||||
},
|
||||
|
||||
# Static example files in list-objects directory
|
||||
{
|
||||
"list-objects/file1.txt" = "This is the content for file 1."
|
||||
"list-objects/data.json" = jsonencode({ key = "value", items = [1, 2, 3] })
|
||||
"list-objects/nested-dir/file2.txt" = "This is a nested file."
|
||||
"list-objects/empty-nested-dir/" = ""
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user