python - Pulumi 中的新线角色作为 secret /值

标签 python amazon-web-services pulumi

我想在配置中将 key 作为 secret 存储在 Pulumi 中。

key 具有以下结构

-----开始私钥----- xxxxx xxxxx xxxxx -----结束私钥-----

但是,当将其添加到配置中时,我面临两个问题:

  • ----- 开头的配置设置会出错。
  • Pulumi 正在将 \n 转换为 \\,因此在尝试提取 key 作为 secret 时会出错。

我已经尝试了所有格式,将其存储为 --plaintext 以及建议的其他解决方案 here但没有成功。

如果有人能为这里带来一些光明,我将不胜感激。预先感谢您。

最佳答案

您需要从 stdin 传输 key ,如下所示:

cat ~/.ssh/id_rsa | pulumi config set secretKey --secret

关于python - Pulumi 中的新线角色作为 secret /值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70868369/

相关文章:

python - 如何在python中运行并行程序

python - 在 python 中,如何将 PIL 或 Imagemagick 图像作为文件打开

python - 为什么 z3.And() 慢?

python - 为函数定义的角色不能由 Lambda 承担

c# - 如何通过 SSH 连接到 Aurora serverless MySQL 实例

python - 当我在 Pulumi 中使用 F-string 通过 Python 创建连接字符串时收到错误

azure - 使用 Pulumi 将现有 VNet 添加到 Azure KeyVault 失败

android - Android 上运行的 Kivy 应用程序在屏幕锁定后关闭。如何避免?

amazon-web-services - 清理 AWS CodePipeline 中的旧文件

pulumi - 如何将 Visual Studio 调试器附加到 pulumi