from boto.ec2.cloudwatch.alarm import MetricAlarm
from boto.ec2.cloudwatch.dimension import Dimension
from boto.sns import connect_to_region
from boto.ec2.cloudwatch.alarm import MetricAlarm
from boto.ec2.cloudwatch.dimension import Dimension
from boto.sns import connect_to_region
class Connection():
"""Connection Establishement with AWS -- VPC/EC2/CloudWatch"""
#-----------------------------------------------------------------------------------------------------------------------------
def setEnvironment(self):
class Connection():
"""Connection Establishement with AWS -- VPC/EC2/CloudWatch"""
#-----------------------------------------------------------------------------------------------------------------------------
def setEnvironment(self):
"""Credentials for connecting to AWS-CloudWatch"""
#Reads from the environment variables
self.AWS_KEY = os.environ.get("AWS_ACCESS_KEY_ID")
"""Credentials for connecting to AWS-CloudWatch"""
#Reads from the environment variables
self.AWS_KEY = os.environ.get("AWS_ACCESS_KEY_ID")
self.AWS_REGION = os.environ.get("AWS_EC2_REGION","us-west-2")
#TODO Read from the cloudwatch_credentials.txt file
self.AWS_REGION = os.environ.get("AWS_EC2_REGION","us-west-2")
#TODO Read from the cloudwatch_credentials.txt file
return self.connection_instance()
except Exception as e:
log.error("AWS Credentials not configured, Try setting the access credentials first %s: ",str(e))
return self.connection_instance()
except Exception as e:
log.error("AWS Credentials not configured, Try setting the access credentials first %s: ",str(e))