【发布时间】:2021-06-11 07:43:56
【问题描述】:
因此,在我的 Lambda 函数中,我将数据转换为 JSON 对象:
x=json.dumps(my_data)
现在,我想将对象 x 存储为 S3 中的 .json 文件。我如何做到这一点?
【问题讨论】:
标签: amazon-web-services amazon-s3 aws-lambda
因此,在我的 Lambda 函数中,我将数据转换为 JSON 对象:
x=json.dumps(my_data)
现在,我想将对象 x 存储为 S3 中的 .json 文件。我如何做到这一点?
【问题讨论】:
标签: amazon-web-services amazon-s3 aws-lambda
Write-S3Object cmdlet 支持将内嵌文本内容上传到 Amazon S3 的功能。使用 -Content 参数(别名 -Text),您可以指定应上传到 Amazon S3 的基于文本的内容,而无需先将其放入文件中。该参数接受简单的单行字符串以及此处包含多行的字符串。
PS > # Specifying content in-line, single line text:
PS > write-s3object mybucket -key myobject.txt -content "file content"
PS > # Specifying content in-line, multi-line text: (note final newline needed to end in-line here-string)
PS > write-s3object mybucket -key myobject.txt -content @"
>> line 1
>> line 2
>> line 3
>> "@
>>
PS > # Specifying content from a variable: (note final newline needed to end in-line here-string)
PS > $x = @"
>> line 1
>> line 2
>> line 3
>> "@
>>
PS > write-s3object mybucket -key myobject.txt -content $x
【讨论】: