如何为AWS EB实例自动创建到VPC的经典链接 [英] How to auto create a Classic Link for AWS EB Instances to VPC

查看:75
本文介绍了如何为AWS EB实例自动创建到VPC的经典链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在EB上有一个经典应用程序,需要连接到VPC中的RDS.

I have a Classic app on EB that needs to connect to RDS in a VPC.

我可以通过进入EC2-实例-操作-ClassicLink-链接到VPC,手动配置EB实例以允许到VPC的经典链接. 一旦做到这一点,一切都会很好,但是没有人工干预,它将不会自动链接新实例.

I can manually configure the EB instances to allow a Classic Link to the VPC by going into EC2 - Instance - Actions - ClassicLink - Link to VPC. Once I do this all is fine BUT this won't auto-link new instances without manual intervention.

我知道我需要将EB应用程序移动到VPC中,但是我想知道是否可以将EB设置为为EB中的新实例自动创建经典链接?

I know I need to move the EB app to be within the VPC but I was wondering if I could set EB to auto-create a Classic Link for new instances within EB?

我本以为可以编辑config/yml文件来预配置新实例,但没有找到对此的引用.

I would have thought I could edit the config/yml files to pre-configure new instances but haven't found any reference to this.

有人知道这是否可行吗?

Does anyone know if this is possible and if so how to do it?

谢谢!

推荐答案

我想知道是否可以将EB设置为EB中的新实例自动创建经典链接

I was wondering if I could set EB to auto-create a Classic Link for new instances within EB

是-您可以使用attach-classic-link-vpc命令将EC2-Classic实例链接到启用了ClassicLink的VPC.请参考 EB-CLI PowerShell EC2API 参考文档,以获取每种语言的指南.

Yes - you can link an EC2-Classic instance to a ClassicLink-enabled VPC with the attach-classic-link-vpc command. Refer to EB-CLI, PowerShell, or EC2API reference documentation for a guide to it within each language.

如果您希望实例在创建后自动执行操作,我的建议是使用EC2API.通过元数据查询并获取实例ID和VPC ID呼叫.然后在EC2API调用中使用ID.

My recommendation would be to use the EC2API if you want the instance to do it automatically upon creation. Query and get the instance ids and vpc ids via the metadata calls. Then use the ids in the EC2API call.

有人知道这是否可行吗?

Does anyone know if this is possible and if so how to do it?

检查底部的示例 EC2API attach-classic-link-vpc页面或另一个示例

Check the example at the bottom of the EC2API attach-classic-link-vpc page or another example found at this site. The later has you grant permission to run this command via Identity and Access Management first.

可以找到其他classiclink api调用

Other classiclink api calls can be found here in case you need to classiclink enable your VPC or perform other common classiclink tasks.

试一试,然后试一试.如果您遇到问题,请创建一个新问题,并提供确切的详细信息以及您可以发布的尽可能多的配置/诊断信息,我们会尽力帮助您解决问题.

Take a run at it and give it a go. If you get stuck, create a new question with exact particulars and as much configuration/diagnostic info as you can post and we can try and help you get through it.

这篇关于如何为AWS EB实例自动创建到VPC的经典链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆