创建特性标志而不是类型为“freeform”的AppConfig标志。

huangapple go评论70阅读模式
英文:

aws terraform, how to create feature flag instead of type freeform appconfig flag

问题

以下是您的appconfig代码的翻译部分:

resource "aws_appconfig_application" "feature_flag_app" {
  name        = "FFApplication"
  description = "AppConfig Application for Lambda"
}

resource "aws_appconfig_environment" "feature_flag_app" {
  name           = "FFEnvironment"
  application_id = aws_appconfig_application.feature_flag_app.id
  description    = "AppConfig Environment for Lambda"
}

resource "aws_appconfig_configuration_profile" "feature_flag_app" {
  name           = "FFConfigurationProfile"
  application_id = aws_appconfig_application.feature_flag_app.id
  location_uri   = "hosted" # Replace with your SSM document ARN or another supported location
  description    = "AppConfig Configuration Profile for Lambda"
}

resource "aws_appconfig_hosted_configuration_version" "feature_flag_app" {
  application_id           = aws_appconfig_application.feature_flag_app.id
  configuration_profile_id = aws_appconfig_configuration_profile.feature_flag_app.configuration_profile_id
  description              = "Example Feature Flag Configuration Version"
  content_type             = "application/json"
#
  content = jsonencode({
    flags : {
      simpleflag : {
        name : "simpleflag",
        _deprecation : {
          "status" : "planned"
        }
      }
    },
    values : {
      dbaccess : {
        enabled : "true",
      }
    },
    version : "1"
  })
}

由Terraform创建的相应标志的类型是freeform,不确定您是否漏掉了什么。您尝试创建类型为feature flag的appconfig feature flag,但您得到的是类型为freeform的feature flag。

英文:

Following is my appconfig code

resource "aws_appconfig_application" "feature_flag_app" {
  name        = "FFApplication"
  description = "AppConfig Application for Lambda"
}

resource "aws_appconfig_environment" "feature_flag_app" {
  name           = "FFEnvironment"
  application_id = aws_appconfig_application.feature_flag_app.id
  description    = "AppConfig Environment for Lambda"
}

resource "aws_appconfig_configuration_profile" "feature_flag_app" {
  name           = "FFConfigurationProfile"
  application_id = aws_appconfig_application.feature_flag_app.id
  location_uri   = "hosted" # Replace with your SSM document ARN or another supported location
  description    = "AppConfig Configuration Profile for Lambda"
}

resource "aws_appconfig_hosted_configuration_version" "feature_flag_app" {
  application_id           = aws_appconfig_application.feature_flag_app.id
  configuration_profile_id = aws_appconfig_configuration_profile.feature_flag_app.configuration_profile_id
  description              = "Example Feature Flag Configuration Version"
  content_type             = "application/json"
#
  content = jsonencode({
    flags : {
      simpleflag : {
        name : "simpleflag",
        _deprecation : {
          "status" : "planned"
        }
      }
    },
    values : {
      dbaccess : {
        enabled : "true",
      }
    },
    version : "1"
  })
}

The corresponding flag created by terraform is of type freeform, not sure what I am missing.

I tried to create appconfig feature flag of type feature flag, I am getting a feature flag of type freeform

答案1

得分: 2

You need to fix the other resource, aws_appconfig_configuration_profile to set it to be of type AWS.AppConfig.FeatureFlags:

resource "aws_appconfig_configuration_profile" "feature_flag_app" {
  name           = "FFConfigurationProfile"
  application_id = aws_appconfig_application.feature_flag_app.id
  location_uri   = "hosted" # Replace with your SSM document ARN or another supported location
  description    = "AppConfig Configuration Profile for Lambda"
  type           = "AWS.AppConfig.FeatureFlags"
}

Without the type argument it is by default AWS.Freeform:

type - (Optional) Type of configurations contained in the profile. Valid values: AWS.AppConfig.FeatureFlags and AWS.Freeform. Default: AWS.Freeform.

英文:

You need to fix the other resource, aws_appconfig_configuration_profile to set it to be of type AWS.AppConfig.FeatureFlags:

resource "aws_appconfig_configuration_profile" "feature_flag_app" {
  name           = "FFConfigurationProfile"
  application_id = aws_appconfig_application.feature_flag_app.id
  location_uri   = "hosted" # Replace with your SSM document ARN or another supported location
  description    = "AppConfig Configuration Profile for Lambda"
  type           = "AWS.AppConfig.FeatureFlags"
}

Without the type argument it is by default AWS.Freeform:

> type - (Optional) Type of configurations contained in the profile. Valid values: AWS.AppConfig.FeatureFlags and AWS.Freeform. Default: AWS.Freeform.

huangapple
  • 本文由 发表于 2023年4月13日 17:37:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76003927.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定