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
1 change: 1 addition & 0 deletions localstack/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
APPLICATION_AMZ_JSON_1_0 = 'application/x-amz-json-1.0'
APPLICATION_AMZ_JSON_1_1 = 'application/x-amz-json-1.1'
APPLICATION_JSON = 'application/json'
APPLICATION_XML = 'application/xml'
APPLICATION_X_WWW_FORM_URLENCODED = 'application/x-www-form-urlencoded'

# strings to indicate truthy/falsy values
Expand Down
4 changes: 3 additions & 1 deletion localstack/utils/cloudformation/template_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@ def extract_resource_attribute(resource_type, resource, attribute):
elif resource_type == 'ApiGateway::Resource':
if attribute == 'PhysicalResourceId':
return resource['id']
return resource.get(attribute)
attribute_lower = common.first_char_to_lower(attribute)
return resource.get(attribute) or resource.get(attribute_lower)


def resolve_ref(stack_name, ref, resources, attribute):
Expand Down Expand Up @@ -968,6 +969,7 @@ def get_resource_dependencies(resource_id, resource, resources):
result = {}
dumped = json.dumps(common.json_safe(resource))
dependencies = resource.get('DependsOn', [])
dependencies = dependencies if isinstance(dependencies, list) else [dependencies]
for other_id, other in resources.items():
if resource != other:
# TODO: traverse dict instead of doing string search
Expand Down
4 changes: 4 additions & 0 deletions localstack/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,10 @@ def parse_chunked_data(data):
return ''.join(chunks)


def first_char_to_lower(s):
return '%s%s' % (s[0].lower(), s[1:])


def is_number(s):
try:
float(s) # for int, long and float
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jsonpath-rw==1.4.0
localstack-ext[full]>=0.10.51
localstack-ext>=0.10.51 #basic-lib
localstack-client>=0.14 #basic-lib
moto-ext>=1.3.15.4
moto-ext>=1.3.15.5
nose>=1.3.7
nose-timer>=0.7.5
psutil==5.4.8
Expand Down