This repository was archived by the owner on Mar 23, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
CFn: fix number parameter types #13231
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eb00bf9
Add assertion for deploying existing log group
simonrw 2979ec5
Handle number type parameters correctly
simonrw 36e626c
Add test for updating parameter type
simonrw ceb8ec2
Intrinsic function results are always strings
simonrw 7938398
is_number correctly returns False for booleans
simonrw 812284b
Skip existing log group test if legacy engine
simonrw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,6 +1,11 @@ | ||
| import os.path | ||
|
|
||
| import pytest | ||
| from tests.aws.services.cloudformation.conftest import skip_if_legacy_engine | ||
|
|
||
| from localstack.testing.pytest import markers | ||
| from localstack.testing.pytest.fixtures import StackDeployError | ||
| from localstack.utils.strings import short_uid | ||
|
|
||
|
|
||
| @markers.aws.validated | ||
|
|
@@ -47,3 +52,26 @@ def test_cfn_handle_log_group_resource(deploy_cfn_template, aws_client, snapshot | |
| stack.destroy() | ||
| response = aws_client.logs.describe_log_groups(logGroupNamePrefix=log_group_prefix) | ||
| assert len(response["logGroups"]) == 0 | ||
|
|
||
|
|
||
| @markers.aws.validated | ||
| @skip_if_legacy_engine() | ||
| def test_handle_existing_log_group(deploy_cfn_template, aws_client, snapshot, cleanups): | ||
| snapshot.add_transformer(snapshot.transform.cloudformation_api()) | ||
| snapshot.add_transformer(snapshot.transform.key_value("ParameterValue")) | ||
|
|
||
| log_group_name = f"logs-{short_uid()}" | ||
|
|
||
| # create the log group | ||
| aws_client.logs.create_log_group(logGroupName=log_group_name) | ||
| cleanups.append(lambda: aws_client.logs.delete_log_group(logGroupName=log_group_name)) | ||
|
|
||
| with pytest.raises(StackDeployError) as exc_info: | ||
| deploy_cfn_template( | ||
| template_path=os.path.join( | ||
| os.path.dirname(__file__), "../../../templates/logs_group.yml" | ||
| ), | ||
| parameters={"LogGroupName": log_group_name}, | ||
| ) | ||
|
|
||
| snapshot.match("failed-stack-describe", exc_info.value.describe_result) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: It could be useful to have the status reason if there was any.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I'm not sure I understand. There is no
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. I'm talking about the StatusReason that should be in the CREATE_FAILED event of the Log Group. |
||
This file contains hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise: Nice consideration.