我有点被这个困住了。我用自己的云形成模板创建了一个弹性豆茎环境,但我只能为现有的应用程序启动它。如何使用相同的资源( AWS::ElasticBean秸秆::environment )来创建新的应用程序,以及如何使用相同的模板将标准的AWS Java示例应用程序部署到这个新环境。
如果我用这个:
Resources:
MyEB:
Type: AWS::ElasticBeanstalk::Environment
Properties:
ApplicationName: customerApp如果说customerApp不存在,就会出现错误。
根据Marcin的请求,我的完整模板中删除了值,以便使其更短,如果这是有意义的话:
Resources:
MyEB:
Type: AWS::ElasticBeanstalk::Environment
Properties:
ApplicationName: customerApp
Description: Test
PlatformArn: arn:aws:elasticbeanstalk:eu-west-1::platform/Tomcat 8.5 with Corretto 8 running on 64bit Amazon Linux 2/4.2.17
EnvironmentName: iw-test3
OptionSettings:
- Namespace: aws:autoscaling:launchconfiguration
OptionName: ImageId
- Namespace: aws:autoscaling:launchconfiguration
OptionName: DisableIMDSv1
- Namespace: aws:elasticbeanstalk:application:environment
OptionName: username
- Namespace: aws:elasticbeanstalk:application:environment
OptionName: password
- Namespace: aws:elasticbeanstalk:application:environment
OptionName: rest_client_id
- Namespace: aws:elasticbeanstalk:application:environment
OptionName: rest_client_secret
- Namespace: aws:ec2:vpc
OptionName: VPCId
- Namespace: aws:ec2:vpc
OptionName: Subnets
- Namespace: aws:ec2:vpc
OptionName: ELBSubnets
- Namespace: aws:elbv2:loadbalancer
OptionName: SharedLoadBalancer
- Namespace: aws:elbv2:listener:443
OptionName: Rules
- Namespace: aws:elasticbeanstalk:environment:process:default
OptionName: HealthCheckPath
Value: /health
- Namespace: aws:elasticbeanstalk:managedactions
OptionName: ManagedActionsEnabled
Value: true
- Namespace: aws:elasticbeanstalk:managedactions
OptionName: PreferredStartTime
- Namespace: aws:elasticbeanstalk:managedactions:platformupdate
OptionName: UpdateLevel
- Namespace: aws:ec2:instances
OptionName: InstanceTypes
- Namespace: aws:ec2:instances
OptionName: SupportedArchitectures
- Namespace: aws:autoscaling:asg
OptionName: MaxSize
- Namespace: aws:elasticbeanstalk:environment:proxy
OptionName: ProxyServer
- Namespace: aws:elasticbeanstalk:environment
OptionName: ServiceRole
- Namespace: aws:elasticbeanstalk:environment
OptionName: LoadBalancerIsShared
- Namespace: aws:elasticbeanstalk:environment
OptionName: LoadBalancerType
- Namespace: aws:ec2:vpc
OptionName: AssociatePublicIpAddress
- Namespace: aws:autoscaling:launchconfiguration
OptionName: IamInstanceProfile
- Namespace: aws:elbv2:listenerrule:dnsRule
OptionName: PathPatterns
- Namespace: aws:elbv2:listenerrule:dnsRule
OptionName: Priority
- Namespace: aws:elbv2:listenerrule:dnsRule
OptionName: Process
- Namespace: aws:elbv2:listenerrule:dnsRule
OptionName: HostHeaders更新
我增加了以下资源:
MyApplication:
Type: AWS::ElasticBeanstalk::Application
Properties:
Description: Test Application
MyApplicationVarsion:
Type: AWS::ElasticBeanstalk::ApplicationVersion
Properties:
ApplicationName: customerApp_IW
Description: Test Application Version
SourceBundle:
S3Bucket: !Sub "elasticbeanstalk-samples-${AWS::Region}"
S3Key: corretto.zip现在出现的错误是:
Unable to download from S3 location (Bucket: elasticbeanstalk-samples-eu-west-1 Key: corretto.zip). Reason: Forbidden: S3Bucket=elasticbeanstalk-samples-eu-west-1, S3Key=corretto.zip (Service: AWSElasticBeanstalk; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 8abc30ac-fd88-4828-95bd-67e3ed69aebe; Proxy: null)发布于 2022-08-17 11:45:52
您必须定义自己的AWS::ElasticBean秸秆::ApplicationVersion。然后定义VersionLabel来部署特定的zip。
https://stackoverflow.com/questions/73387648
复制相似问题