尝试使用 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"
}
]
Name
是 Elastic Beanstalk 默认应用于您的环境的少数标签之一,您无法编辑这些默认标签。
来自 AWS 文档:
Elastic Beanstalk 将环境标签应用于环境资源 本身以及 Elastic Beanstalk 所使用的其他 AWS 资源 为环境创造。
默认情况下,Elastic Beanstalk 会向您的环境应用一些标签:
– 环境的名称。elasticbeanstalk:environment-name
– 环境 ID。elasticbeanstalk:environment-id
– 也是环境的名称。Name
在 Amazon EC2 仪表板中用于识别和排序资源。Name
您无法编辑这些默认标签。