Sahidul Islam
Sahidul Islam

Reputation: 489

How to add inbound rule to AWS default VPC security group using boto

I want to add inbound rules to my default vpc security group using boto. But i find no proper documentation to do so. Does it possible to do? can anyone help?

Upvotes: 1

Views: 545

Answers (2)

Naveen Vijay
Naveen Vijay

Reputation: 16532

Here under the group_ids use the sg-id of the default security; which you can get from the AWS management console.

import boto
ec2 = boto.connect_ec2()
sg = ec2.get_all_security_groups(group_ids='sg-12345')[0]
sg.authorize(ip_protocol="-1", from_port=None, to_port=None, cidr_ip="0.0.0.0/0", src_group=None, dry_run=False)

Upvotes: 3

Sahidul Islam
Sahidul Islam

Reputation: 489

python has boto.vpc module to work with vpc. but to modify or add inbound rules to security group you have to use boto.ec2 module.

Upvotes: 1

Related Questions