Пример #1
0
class RDS():
	def __init__(self,ip=None):
		self.connection = RDSConnection(AWS_ACCESS_KEY,AWS_SECRET_ACCESS_KEY,validate_certs=False)
		self.ip = ip
		self.db_security_group = DBSecurityGroup(self.connection,name="default")
	def authorize_ip(self):
		if self.ip == None:
			g = GetMyIP()
			self.ip = g.get_my_ip()
		self.db_security_group.authorize("%s/32" % self.ip)

	def deauthorize_ip(self):
		if self.ip != None:
			self.db_security_group.revoke("%s/32" % self.ip)
		else:
			raise Exception
Пример #2
0
	def __init__(self,ip=None):
		self.connection = RDSConnection(AWS_ACCESS_KEY,AWS_SECRET_ACCESS_KEY,validate_certs=False)
		self.ip = ip
		self.db_security_group = DBSecurityGroup(self.connection,name="default")