Decentralize cloudformation naming responsibilities (#3201)
* #3127 - Decentralize CF naming responsibilities * Decentralize CloudFormation naming responsibilities * Update URLs in cloudformation_resource_type functions * Fix flake8 errors * Black formatting * Add a bunch of imports to populate CloudFormationModel.__subclasses__ * Add noqa to s3 models import statement in cloudformation/parsing.py * Black formatting * Remove debugging print statement Co-authored-by: Bert Blommers <info@bertblommers.nl>
This commit is contained in:
parent
88a1134657
commit
9a9a1d8413
26 changed files with 717 additions and 208 deletions
|
|
@ -4,7 +4,7 @@ import datetime
|
|||
import json
|
||||
|
||||
from moto.compat import OrderedDict
|
||||
from moto.core import BaseBackend, BaseModel
|
||||
from moto.core import BaseBackend, BaseModel, CloudFormationModel
|
||||
from moto.core.utils import unix_time
|
||||
from moto.core import ACCOUNT_ID
|
||||
from .comparisons import get_comparison_func
|
||||
|
|
@ -82,7 +82,7 @@ class Item(BaseModel):
|
|||
return {"Item": included}
|
||||
|
||||
|
||||
class Table(BaseModel):
|
||||
class Table(CloudFormationModel):
|
||||
def __init__(
|
||||
self,
|
||||
name,
|
||||
|
|
@ -135,6 +135,15 @@ class Table(BaseModel):
|
|||
}
|
||||
return results
|
||||
|
||||
@staticmethod
|
||||
def cloudformation_name_type():
|
||||
return "TableName"
|
||||
|
||||
@staticmethod
|
||||
def cloudformation_type():
|
||||
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html
|
||||
return "AWS::DynamoDB::Table"
|
||||
|
||||
@classmethod
|
||||
def create_from_cloudformation_json(
|
||||
cls, resource_name, cloudformation_json, region_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue