我一直在按照本文档通过 CLI 在 AppConfig 中创建托管版本。
问题: aws 命令中的
content
参数需要严格类型的 blob。我想上传一个相对较大的大约 40kB 的 yaml 文件,它作为 blob 类型的content
存在于我的代码库中。
将此 yaml 文件转换为 base64 并通过 CLI 添加到
content
参数的理想方法是什么?
我手动尝试将 yaml 转换为 base64 并添加到命令中,但 CLI 无法处理那么多数据并且没有响应。
注意:在 VSCode Windows 中使用 Powershell
我看到您正在使用 PowerShell。如果您能够在 PowerShell 环境中安装 AWS CLI,使用
--content fileb://mylargefile.yaml
应该允许您上传大型 YAML 文件作为 AppConfig 托管配置版本。在运行命令之前无需对文件进行任何 Base64 转换。
例子
$ aws appconfig create-hosted-configuration-version \
--application-id "yourid" \
--configuration-profile-id "yourid" \
--content-type text/plain \
--region us-east-1 \
--content fileb://mylargefile.yaml \
configuration_version_output_file
{
"ApplicationId": "yourid",
"ConfigurationProfileId": "yourid",
"VersionNumber": "1",
"ContentType": "text/plain"
}