-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
CloudFormation v2 Engine: Base Support for Fn::Base64 #12700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
8f14387
base support for dependson and apigw test unlock
MEPalma 2bfc135
base support for fn sub
MEPalma 648fcf1
Merge branch 'master' into MEP-CFN-fn_sub
MEPalma 66937e0
v1 tests port, test annotations, batch of parity improvements
MEPalma 75d12d6
base support for fn::transform
MEPalma 47a0a1a
typing migration, change types compute, unskip
MEPalma 653122e
None bindins prune the value
MEPalma bcb65f2
minor
MEPalma 52008ee
minor
MEPalma 795d3a0
support for fn::select
MEPalma 2833ff3
tests
MEPalma f55f012
split tests
MEPalma 498c08b
base support for split
MEPalma 0b969ee
init support for getazs
MEPalma 33243fb
cleanup and empty region field
MEPalma 08dec8f
conflicts
MEPalma a465e2f
cleanup
MEPalma 3b96037
Merge branch 'MEP-CFN-fn_split' into MEP-CFN-fn_getazs
MEPalma 8bb3b8c
base support for fn::base64
MEPalma 6ab90bf
pr item
MEPalma 6fd248c
conflicts
MEPalma f69e358
revert
MEPalma bd846d9
revert
MEPalma 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
97 changes: 97 additions & 0 deletions
97
tests/aws/services/cloudformation/v2/test_change_set_fn_base64.py
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import pytest | ||
from localstack_snapshot.snapshots.transformer import RegexTransformer | ||
|
||
from localstack.services.cloudformation.v2.utils import is_v2_engine | ||
from localstack.testing.aws.util import is_aws_cloud | ||
from localstack.testing.pytest import markers | ||
from localstack.utils.strings import long_uid | ||
|
||
|
||
@pytest.mark.skipif( | ||
condition=not is_v2_engine() and not is_aws_cloud(), reason="Requires the V2 engine" | ||
) | ||
@markers.snapshot.skip_snapshot_verify( | ||
paths=[ | ||
"per-resource-events..*", | ||
"delete-describe..*", | ||
# | ||
# Before/After Context | ||
"$..Capabilities", | ||
"$..NotificationARNs", | ||
"$..IncludeNestedStacks", | ||
"$..Scope", | ||
"$..Details", | ||
"$..Parameters", | ||
"$..Replacement", | ||
] | ||
) | ||
class TestChangeSetFnBase64: | ||
@markers.aws.validated | ||
def test_fn_base64_add_to_static_property( | ||
self, | ||
snapshot, | ||
capture_update_process, | ||
): | ||
name1 = f"topic-name-1-{long_uid()}" | ||
snapshot.add_transformer(RegexTransformer(name1, "topic-name-1")) | ||
template_1 = { | ||
"Resources": { | ||
"Topic1": {"Type": "AWS::SNS::Topic", "Properties": {"DisplayName": name1}} | ||
} | ||
} | ||
template_2 = { | ||
"Resources": { | ||
"Topic1": { | ||
"Type": "AWS::SNS::Topic", | ||
"Properties": {"DisplayName": {"Fn::Base64": "HelloWorld"}}, | ||
} | ||
} | ||
} | ||
capture_update_process(snapshot, template_1, template_2) | ||
|
||
@markers.aws.validated | ||
def test_fn_base64_remove_from_static_property( | ||
self, | ||
snapshot, | ||
capture_update_process, | ||
): | ||
name1 = f"topic-name-1-{long_uid()}" | ||
snapshot.add_transformer(RegexTransformer(name1, "topic-name-1")) | ||
template_1 = { | ||
"Resources": { | ||
"Topic1": { | ||
"Type": "AWS::SNS::Topic", | ||
"Properties": {"DisplayName": {"Fn::Base64": "HelloWorld"}}, | ||
} | ||
} | ||
} | ||
template_2 = { | ||
"Resources": { | ||
"Topic1": {"Type": "AWS::SNS::Topic", "Properties": {"DisplayName": name1}} | ||
} | ||
} | ||
capture_update_process(snapshot, template_1, template_2) | ||
|
||
@markers.aws.validated | ||
def test_fn_base64_change_input_string( | ||
self, | ||
snapshot, | ||
capture_update_process, | ||
): | ||
template_1 = { | ||
"Resources": { | ||
"Topic1": { | ||
"Type": "AWS::SNS::Topic", | ||
"Properties": {"DisplayName": {"Fn::Base64": "OldValue"}}, | ||
} | ||
} | ||
} | ||
template_2 = { | ||
"Resources": { | ||
"Topic1": { | ||
"Type": "AWS::SNS::Topic", | ||
"Properties": {"DisplayName": {"Fn::Base64": "NewValue"}}, | ||
} | ||
} | ||
} | ||
capture_update_process(snapshot, template_1, template_2) |
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.
🎉