Min*_*ieh 6 amazon-web-services aws-cli
只是想知道如何将文件直接通过管道传输到 aws ssm 参数存储?例如
# Put into ssm parameter store
cat my_github_private.key | aws ssm put-parameter --region ap-southeast-1 --name MY_GITHUB_PRIVATE_KEY --type SecureString --key-id alias/aws/ssm --value ???
# And read it back
aws ssm get-parameter --region ap-southeast-1 --name MY_GITHUB_PRIVATE_KEY --with-decryption --query Parameter.Value --output text > my_github_private.key.1
# Two should be identical
diff my_github_private.key my_github_private.key.1
Run Code Online (Sandbox Code Playgroud)
stdin您可以直接添加到命令行参数中,而不是从中获取值?
aws ssm put-parameter \
--region ap-southeast-1 \
--name MY_GITHUB_PRIVATE_KEY \
--type SecureString \
--key-id alias/aws/ssm \
--value file://my_github_private.key
Run Code Online (Sandbox Code Playgroud)
注意:--value "$(cat my_github_private.key)"也有效
| 归档时间: |
|
| 查看次数: |
7699 次 |
| 最近记录: |