gpt4 book ai didi

amazon-web-services - 如何在cloudformation中为我的beanstalk定义nodejs的版本

转载 作者:行者123 更新时间:2023-12-04 10:03:16 25 4
gpt4 key购买 nike

我正在尝试使用特定版本的nodejs创建beanstalk:

这是我在cloudformation中的beanstalk的设置选项:

    "configurationTemplate": {
"Type": "AWS::ElasticBeanstalk::ConfigurationTemplate",
"Properties": {
"ApplicationName": {
"Ref": "xxxxx"
},
"Description": "AWS ElasticBeanstalk Sample Configuration Template",
"OptionSettings": [
{
"Namespace": "aws:autoscaling:asg",
"OptionName": "MinSize",
"Value": {
"Ref": "MinEc2s"
}
},
{
"Namespace": "aws:autoscaling:asg",
"OptionName": "MaxSize",
"Value": {
"Ref": "MaxEc2s"
}
},
{
"Namespace": "aws:elasticbeanstalk:environment",
"OptionName": "EnvironmentType",
"Value": "LoadBalanced"
},
{
"Namespace": "aws:autoscaling:launchconfiguration",
"OptionName": "InstanceType",
"Value": {
"Ref": "InstanceType"
}
},
{
"Namespace": "aws:ec2:vpc",
"OptionName": "VPCId",
"Value": {
"Ref": "VpcIdBn"
}
},
{
"Namespace": "aws:ec2:vpc",
"OptionName": "Subnets",
"Value": {
"Ref": "SubnetIds"
}
}
],
"SolutionStackName": "64bit Amazon Linux 2017.03 v4.2.0 running
Node.js"
}
}

如您所见,我定义了我需要的堆栈解决方案,如下所示:

"SolutionStackName": "64bit Amazon Linux 2017.03 v4.2.0 running 
Node.js"

当我运行此命令时,一切正常,我的 beanstalk 已创建,但节点版本为 6.x.x,但我需要较新版本的 Nodejs。我检查了手动创建的 benastalk,发现 beanstalk 可以接受版本 7.10.1,这是我需要的版本。所以我改变了堆栈解决方案如下:

"SolutionStackName": "64bit Amazon Linux 2017.03 v4.2.0 running 
Node.js 7.10.1"

当我运行 cloudformation 时,它无法运行。那么我有什么遗漏的吗?如何定义我想要安装的节点版本?有什么想法吗?

最佳答案

您是否尝试过添加以下代码?

  OptionSettings:
- Namespace: aws:elasticbeanstalk:container:nodejs
OptionName: NodeVersion
Value: "8.11.3"

关于amazon-web-services - 如何在cloudformation中为我的beanstalk定义nodejs的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45223237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com