调用CreateEnvironment操作时发生错误(InvalidParameterValue):Tag key 'Name'被保留

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

尝试使用 Jenkins 将 Spring Boot 应用程序部署到 AWS Elastic beanstalk 时收到以下错误。过去部署没有问题,但最近开始出现此错误。

botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the CreateEnvironment operation: Tag key 'Name' is reserved and can't be modified.

以下是用于设置 cloudformation 堆栈的配置。

[
    {
      "OptionName": "ELBSubnets",
      "Namespace": "aws:ec2:vpc",
      "ExportName": "apis-nonprod-vpc-apis-sit-vpc::PublicSubnets"
    },
    {
      "OptionName": "Subnets",
      "ResourceName": "AWSEBAutoScalingGroup",
      "Namespace": "aws:ec2:vpc",
      "ExportName": "apis-nonprod-vpc-apis-sit-vpc::PrivateSubnets"
    },
    {
      "OptionName": "VPCId",
      "ResourceName": "AWSEBLoadBalancerSecurityGroup",
      "Namespace": "aws:ec2:vpc",
      "ExportName": "apis-nonprod-vpc-apis-sit-vpc::VpcId"
    },
    {
      "OptionName": "EC2KeyName",
      "Namespace": "aws:autoscaling:launchconfiguration",
      "Value": "develop-apis-sit"
    },
    {
      "Namespace": "aws:elasticbeanstalk:customoption",
      "OptionName": "SecretBucket",
      "Value": "apis-sit-secrets"
    },
    {
      "OptionName": "spring.profiles.active",
      "Namespace": "aws:elasticbeanstalk:application:environment",
      "Value": "sit"
    },
    {
      "OptionName": "IamInstanceProfile",
      "Namespace": "aws:autoscaling:launchconfiguration",
      "ExportName": "app-dev::EbsInstanceIamInstanceProfileName"
    },
    {
      "OptionName": "SSMParameterNamespace",
      "Namespace": "aws:elasticbeanstalk:customoption",
      "Value": "app-dev"
    },
    {
      "OptionName": "BatchSize",
      "Namespace": "aws:elasticbeanstalk:command",
      "Value": "1"
    },
    {
      "OptionName": "AppDynamicsAgentBucket",
      "Namespace": "aws:elasticbeanstalk:customoption",
      "Value": "appdynamics-agents-nonprod"
    }
]
jenkins amazon-elastic-beanstalk aws-cloudformation
1个回答
0
投票

Name
是 Elastic Beanstalk 默认应用于您的环境的少数标签之一,您无法编辑这些默认标签。

来自 AWS 文档

Elastic Beanstalk 将环境标签应用于环境资源 本身以及 Elastic Beanstalk 所使用的其他 AWS 资源 为环境创造。

默认情况下,Elastic Beanstalk 会向您的环境应用一些标签:

  • elasticbeanstalk:environment-name
    – 环境的名称。
  • elasticbeanstalk:environment-id
    – 环境 ID。
  • Name
    – 也是环境的名称。
    Name
    在 Amazon EC2 仪表板中用于识别和排序资源。

您无法编辑这些默认标签。

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