Add S3 parsing for CloudFormation

This commit is contained in:
Declan Shanaghy 2016-08-15 10:57:40 -07:00
parent ae938223d4
commit 1441087e5c
2 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,7 @@ from moto.kms import models as kms_models
from moto.rds import models as rds_models
from moto.redshift import models as redshift_models
from moto.route53 import models as route53_models
from moto.s3 import models as s3_models
from moto.sns import models as sns_models
from moto.sqs import models as sqs_models
from .utils import random_suffix
@ -57,6 +58,7 @@ MODEL_MAP = {
"AWS::Route53::RecordSet": route53_models.RecordSet,
"AWS::Route53::RecordSetGroup": route53_models.RecordSetGroup,
"AWS::SNS::Topic": sns_models.Topic,
"AWS::S3::Bucket": s3_models.FakeBucket,
"AWS::SQS::Queue": sqs_models.Queue,
}

View File

@ -288,6 +288,16 @@ class FakeBucket(object):
def set_acl(self, acl):
self.acl = acl
@property
def physical_resource_id(self):
return self.name
@classmethod
def create_from_cloudformation_json(
cls, resource_name, cloudformation_json, region_name):
bucket = s3_backend.create_bucket(resource_name, region_name)
return bucket
class S3Backend(BaseBackend):