Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion samtranslator/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from samtranslator.intrinsics.resolver import IntrinsicsResolver
from samtranslator.model.exceptions import InvalidResourceException
from samtranslator.model.types import Validator
from samtranslator.model.types import Validator, any_type
from samtranslator.plugins import LifeCycleEvents
from samtranslator.model.tags.resource_tagging import get_tag_list

Expand Down Expand Up @@ -45,6 +45,17 @@ def __init__(self, required: bool, validate: Validator) -> None:
super().__init__(required, validate, False)


class PassThroughProperty(PropertyType):
"""
Pass-through property.

SAM Translator should not try to read the value other than passing it to underlaying CFN resources.
"""

def __init__(self, required: bool) -> None:
super().__init__(required, any_type(), False)


class Resource(object):
"""A Resource object represents an abstract entity that contains a Type and a Properties object. They map well to
CloudFormation resources as well sub-types like AWS::Lambda::Function or `Events` section of
Expand Down
4 changes: 2 additions & 2 deletions samtranslator/model/sam_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from samtranslator.metrics.method_decorator import cw_timer
from samtranslator.model import (
ResourceResolver,
Property,
PassThroughProperty,
PropertyType,
SamResourceMacro,
Resource,
Expand Down Expand Up @@ -1283,7 +1283,7 @@ class SamHttpApi(SamResourceMacro):
# In the future, we might rename and expose this property to customers so they can have SAM manage Explicit APIs
# Swagger.
"__MANAGE_SWAGGER": PropertyType(False, is_type(bool)),
"Name": Property(False, any_type()),
"Name": PassThroughProperty(False),
"StageName": PropertyType(False, one_of(is_str(), is_type(dict))),
"Tags": PropertyType(False, is_type(dict)),
"DefinitionBody": PropertyType(False, is_type(dict)),
Expand Down