如何更新现有的 AWS AppConfig 配置文件数据?

问题描述 投票:0回答:1

假设我的应用程序配置中有一个托管配置版本:

{
  "configs": [
    {
      "A": 1,
      "B": 2
    },
    {
      "C": 3,
      "D": 4
    }
  ]
} 

现在,我想将此版本更新为新版本:

{
  "configs": [
    {
      "A": 1,
      "B": 2
    },
    {
      "C": 3,
      "D": 4
    },
    {
      "E": 5,
      "F": 6
    }
  ]
} 

我们怎样才能实现这一目标? 就文档而言,我们可以使用

CreateHostedConfigurationVersion
创建新版本,但无法更新现有版本。还有其他办法吗?

amazon-web-services app-config
1个回答
0
投票

只需重新创建它即可:

content=$(cat foo.json | base64)

aws appconfig create-hosted-configuration-version \
  --application-id APPID \
  --configuration-profile-id PROFILEID \
  --content $content \
  --content-type application/json \
  out.json

将创建新版本的 AppConfig 配置文件。

© www.soinside.com 2019 - 2024. All rights reserved.