amazon-web-services - AWS Elastic Beanstalk 启动到默认 VPC
问题描述
我正在尝试在我的 VPC 中启动 Tomcat Beanstalk 实例。但由于某种原因,实例不考虑我的配置模板。
我做了什么 :
- 在单独的脚本中创建 VPC 并手动启动请求的实例并通过 SSH 连接到它
问题 1:如果我出于某种原因使用 cloud-formation,则脚本(如下)会为 Beanstalk 创建一个新堆栈
问题 2:成功启动后,beantalk 会创建到默认 VPC 中,如果我删除默认 VPC,则会崩溃。
我该如何调试呢?为什么会发生这种情况,因为我将正确的参数传递给脚本?
SampleApplication:
Type: 'AWS::ElasticBeanstalk::Application'
Properties:
ApplicationName: !Ref ApplicationName
Description: OCAP's AWS Elastic Beanstalk Sample Application
SampleApplicationVersion:
Type: 'AWS::ElasticBeanstalk::ApplicationVersion'
Properties:
Description: Version 1.0
ApplicationName: !Ref SampleApplication
SourceBundle:
S3Bucket: !Ref AppS3Bucket
S3Key: !Ref AppS3Key
SampleIdentityEnvironment:
Type: 'AWS::ElasticBeanstalk::Environment'
Properties:
ApplicationName: !Ref SampleApplication
EnvironmentName : OCAPSampleIdentityManager
VersionLabel: !Ref SampleApplicationVersion
SolutionStackName: !FindInMap [ StackMap, !Ref StackType, stackName ]
DependsOn:
- ConfigurationTemplate
- SampleApplicationVersion
配置模板:
Type: AWS::ElasticBeanstalk::ConfigurationTemplate
Properties:
ApplicationName: !Ref SampleApplication
Description: 64bit Amazon Linux running Tomcat 7
SolutionStackName: !FindInMap [ StackMap, !Ref StackType, stackName ]
OptionSettings:
- Namespace: aws:autoscaling:launchconfiguration
OptionName: EC2KeyName
Value: !Ref KeyName
- Namespace: aws:ec2:vpc
OptionName: VPCId
Value : vpc-0123456789
- Namespace: 'aws:ec2:vpc'
OptionName: Subnets
Value: subnet-0123456789, subnet-0123456789
- Namespace: 'aws:ec2:vpc'
OptionName: ELBSubnets
Value: subnet-0123456789, subnet-0123456789
- Namespace: 'aws:ec2:vpc'
OptionName: AssociatePublicIpAddress
Value: 'true'
解决方案
已解决的问题 2:您需要在“SampleIdentityEnvironment:”中定义它
TemplateName: !Ref ConfigurationTemplate
推荐阅读
- java - 根据优先级过滤列表中的值
- java - 如何更改检票口中无线电组的默认选定值
- c++ - 我可以在不复制任何数据的情况下通过向量附加特征矩阵吗?
- php - 警告:模块 ini 文件在 /etc/php/7.1/mods-available 下不存在
- html - 从数组中搜索 Json 键以匹配对象并推送到表
- c# - 使用实体框架调用存储过程时,当我得到 JSON 作为结果时返回类型错误
- reactjs - 改变反应组件中的声音
- java - Viewflipper 图像在使用动态数据时不会改变
- xml - 如果条件,如何获取 Xslt 1.0 中最后一页的值?
- java - 使用 optional 在 Map 中填充值