Merge pull request #1537 from william-richard/cloudformation-ecs-cluster-name-optional

If Properies isn't set, cloudformation will just use default values
This commit is contained in:
Steve Pulec 2018-04-12 18:52:16 -04:00 committed by GitHub
commit 080e3c5f5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 22 deletions

View file

@ -61,7 +61,11 @@ class Cluster(BaseObject):
@classmethod
def create_from_cloudformation_json(cls, resource_name, cloudformation_json, region_name):
properties = cloudformation_json['Properties']
# if properties is not provided, cloudformation will use the default values for all properties
if 'Properties' in cloudformation_json:
properties = cloudformation_json['Properties']
else:
properties = {}
ecs_backend = ecs_backends[region_name]
return ecs_backend.create_cluster(