Update a sg to add port from existing sg using boto.authorize -
i trying update security grouping add together port other security group. ex: sg.authorize('tcp', 22, 22, sg-123456)
but getting below error
sg.authorize('sg-abcdef', 'tcp', 22, 22, 'sg-123456') file "/usr/local/lib/python2.7/site-packages/boto/ec2/securitygroup.py", line 187, in authorize src_group_owner_id = src_group.owner_id attributeerror: 'str' object has no attribute 'owner_id'
if want utilize authorize
method of securitygroup
object have pass in securitygroup
object representing source security group. appear passing in string containing id of security group.
you utilize authorize_security_group
method of ec2connection
object. take string value source security group:
ec2.authorize_security_group(group_id='sg-abcdef', ip_protocol='tcp', from_port=22, to_port=22, src_security_group_group_id='sg-123456', src_security_group_owner_id='123456789012')
boto
No comments:
Post a Comment