How to specify an EC2 Security Group using the eb cli

I need to connect my Elastic Beanstalk application to an external(not created by EB) database hosted on RDS. I can do this easily in two steps: 1) Create application 2) edit configuration and add the necessary security group in the EB console

I want the correct security group to be added on startup, to avoid the possible human errors of doing it manually.

My problem is that using eb start it dynamically creates the security group. I can't figure out a way to automatically set the correct (or a second) ec2 security group that allows access to the database. The eb cli doesn't seem to allow for using saved configurations.

Is it possible using the config file? Or am I missing something?


我希望这有助于在.ebextensions上创建一个.config:

Resources:
  AWSEBSecurityGroup:
    Type: "AWS::EC2::SecurityGroup"
    Properties:
      GroupDescription: "My Own SecurityGroup for ElasticBeanstalk environment."
      SecurityGroupIngress:
        - {CidrIp: "0.0.0.0/0", IpProtocol: "tcp", FromPort: "443", ToPort: "443"}
        - {CidrIp: "0.0.0.0/0", IpProtocol: "tcp", FromPort: "80", ToPort: "80"}
链接地址: http://www.djcxy.com/p/71874.html

上一篇: 使用Boto告诉文件何时成功上传到Glacier

下一篇: 如何使用eb cli指定EC2安全组