Skip to content
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

Tracking Issue: Fn::ToJsonString RFC #14

Closed
8 tasks done
mluk-aws opened this issue Apr 29, 2022 · 5 comments
Closed
8 tasks done

Tracking Issue: Fn::ToJsonString RFC #14

mluk-aws opened this issue Apr 29, 2022 · 5 comments
Assignees
Labels
management/tracking Tracking issue for RFC status/review Status of RFC: Review

Comments

@mluk-aws
Copy link
Contributor

mluk-aws commented Apr 29, 2022

Description

Provide an intrinsic function that converts an input template block into an escaped JSON string.

Original Issue: #53

Workflow

  • Tracking issue created (label: status/proposed)
  • RFC pull request submitted
  • Reviewers assigned (label: status/review)
  • Reviewers signed-off (label approved applied to pull request)
  • Final comments period (label: status/final-comments-period)
  • Approved and merged (label: status/approved)
  • Implementation started (label: status/implementing)
  • Implementation complete (label: status/done)

Author is responsible to progress the RFC according to this checklist, and
apply the relevant labels to this issue so that the RFC table in README gets
updated.

@mluk-aws mluk-aws self-assigned this Apr 29, 2022
@mluk-aws mluk-aws added status/proposed Status of RFC: Proposed management/tracking Tracking issue for RFC labels Apr 29, 2022
@mluk-aws mluk-aws added status/review Status of RFC: Review and removed status/proposed Status of RFC: Proposed labels May 3, 2022
@lejiati lejiati added approved RFC PR approved by CFN engineers and removed approved RFC PR approved by CFN engineers labels May 7, 2022
@jiemying
Copy link

Hi have cases say it is not working at the moment

  EventPattern:
    Fn::ToJsonString:
      - test1: 'test2'
        test3: 'test4'

Stack will fail at the Transform stage with error "Transform AWS::LanguageExtensions failed with: Fn::ToJsonString resolve value type mismatch. Rollback requested by user."

@MalikAtalla-AWS
Copy link
Contributor

Hey @jiemying,
thanks for bringing this up.

To unblock you: EventPattern supports Json objects natively. There is no need to use Fn::ToJsonString for the EventPattern attribute.

@jiemying
Copy link

Hey @jiemying, thanks for bringing this up.

To unblock you: EventPattern supports Json objects natively. There is no need to use Fn::ToJsonString for the EventPattern attribute.

Hi, thx for coming back to me so promptly!

Yep I am aware of that, that was for reference.

The error happens at the Transform stage of the CloudFormation stack operation, no matter where I put the above test Fn::ToJsonString in the template's resources properties, the stack transform stage failed with the same error.

I suspect the object "type" passed to this intrinsic function in the back-end, does not match wanted object type of the code, hence the exception error throws. Look at the exception part of the code may be helpful.

@MalikAtalla-AWS
Copy link
Contributor

Hey @jiemying,
if this happens even when you put Fn::ToJsonString somewhere else (where a String is expected), I would appreciate if you could provide an example template. If you still have it handy, any chance you could open a new issue in this same repo?

@lejiati
Copy link
Contributor

lejiati commented Sep 15, 2022

Close this issue as it's available via AWS::LanguageExtensions

@lejiati lejiati closed this as completed Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
management/tracking Tracking issue for RFC status/review Status of RFC: Review
Projects
None yet
Development

No branches or pull requests

4 participants