0

Is there a programmatic (api) method of authorizing a particular IP addresses to access a particular EC2 instance, e.g. for RDP.

This could be done by either creating a security group with the IP address and adding the security group to an instance. Or, this could be done, by adding an IP address to a particular security group.

Ulad Kasach
  • 11,558
  • 11
  • 61
  • 87

1 Answers1

1

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. Finally, if necessary, associate the security group with the instance with modify-instance-attribute.

The APIs are similarly named and a Java example is available.

jzonthemtn
  • 3,344
  • 1
  • 21
  • 30