-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into release-v1.61.0
- Loading branch information
Showing
7 changed files
with
140 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.61.0" | ||
__version__ = "1.60.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import Any, Dict, Optional, Union | ||
|
||
from samtranslator.intrinsics.resolver import IntrinsicsResolver | ||
from samtranslator.model.exceptions import InvalidResourceException | ||
|
||
|
||
def resolve_string_parameter_in_resource( | ||
logical_id: str, | ||
intrinsics_resolver: IntrinsicsResolver, | ||
parameter_value: Optional[Union[str, Dict[str, Any]]], | ||
parameter_name: str, | ||
) -> Optional[Union[str, Dict[str, Any]]]: | ||
"""Try to resolve values in a resource from template parameters.""" | ||
if not parameter_value: | ||
return parameter_value | ||
value = intrinsics_resolver.resolve_parameter_refs(parameter_value) | ||
|
||
if not isinstance(value, str) and not isinstance(value, dict): | ||
raise InvalidResourceException( | ||
logical_id, | ||
"Could not resolve parameter for '{}' or parameter is not a String.".format(parameter_name), | ||
) | ||
return value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.