create CloudFormation outputs and enable 'Fn::GetAtt' to work.

This commit is contained in:
Joseph Lawson 2014-10-21 12:45:03 -04:00
commit 1d9ffafaa5
10 changed files with 269 additions and 8 deletions

View file

@ -30,6 +30,13 @@ class Role(object):
def physical_resource_id(self):
return self.id
def get_cfn_attribute(self, attribute_name):
if attribute_name == 'Arn':
raise NotImplementedError('"Fn::GetAtt" : [ "{0}" , "Arn" ]"')
raise BotoServerError(400,
'Bad Request',
'Template error: resource {0} does not support attribute type {1} in Fn::GetAtt')
class InstanceProfile(object):
def __init__(self, instance_profile_id, name, path, roles):
@ -53,6 +60,13 @@ class InstanceProfile(object):
def physical_resource_id(self):
return self.name
def get_cfn_attribute(self, attribute_name):
if attribute_name == 'Arn':
raise NotImplementedError('"Fn::GetAtt" : [ "{0}" , "Arn" ]"')
raise BotoServerError(400,
'Bad Request',
'Template error: resource {0} does not support attribute type {1} in Fn::GetAtt')
class Certificate(object):
def __init__(self, cert_name, cert_body, private_key, cert_chain=None, path=None):
@ -78,6 +92,13 @@ class AccessKey(object):
"%Y-%m-%d-%H-%M-%S"
)
def get_cfn_attribute(self, attribute_name):
if attribute_name == 'SecretAccessKey':
return self.secret_access_key
raise BotoServerError(400,
'Bad Request',
'Template error: resource {0} does not support attribute type {1} in Fn::GetAtt')
class Group(object):
def __init__(self, name, path='/'):
@ -91,6 +112,13 @@ class Group(object):
self.users = []
def get_cfn_attribute(self, attribute_name):
if attribute_name == 'Arn':
raise NotImplementedError('"Fn::GetAtt" : [ "{0}" , "Arn" ]"')
raise BotoServerError(400,
'Bad Request',
'Template error: resource {0} does not support attribute type {1} in Fn::GetAtt')
class User(object):
def __init__(self, name, path='/'):
@ -143,6 +171,13 @@ class User(object):
else:
raise BotoServerError(404, 'Not Found')
def get_cfn_attribute(self, attribute_name):
if attribute_name == 'Arn':
raise NotImplementedError('"Fn::GetAtt" : [ "{0}" , "Arn" ]"')
raise BotoServerError(400,
'Bad Request',
'Template error: resource {0} does not support attribute type {1} in Fn::GetAtt')
class IAMBackend(BaseBackend):