简体   繁体   English

动态/以编程方式授权对EC2实例的入站流量IP地址访问

[英]Dynamically/Programmatically Authorize Inbound Traffic IP Address Access to EC2 Instance

Is there a programmatic (api) method of authorizing a particular IP addresses to access a particular EC2 instance, eg for RDP. 是否有一种程序化(api)方法来授权特定的IP地址访问特定的EC2实例,例如RDP。

This could be done by either creating a security group with the IP address and adding the security group to an instance. 这可以通过使用IP地址创建安全组并将安全组添加到实例来完成。 Or, this could be done, by adding an IP address to a particular security group. 或者,可以通过将IP地址添加到特定的安全组来完成此操作。

Use create-security-group if a security group doesn't already exist and then authorize-security-group-ingress to add the IP address to the group. 如果安全组尚不存在,请使用create-security-group ,然后授权安全组入口将IP地址添加到该组中。 Finally, if necessary, associate the security group with the instance with modify-instance-attribute . 最后,如有必要,将安全组与带有configure-instance-attribute的实例相关联。

The APIs are similarly named and a Java example is available. 这些API的名称类似,并且提供了Java示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM