aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

AWS::CloudFormation::Macro - Surface error messages from CloudFormation Macros

Open
#482 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

## 1. AWS::CloudFormation::Macro-DisplayStatus

## 2. The CloudFormation Macro interface supports a "status" property in the returned object, but does not display the value on failure.

The Macro interface provides a "status" field, as documented here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html
and indicates that any value other than "success" will be treated as an error. However, when setting it to any other value, that value is not displayed back to the user on failure, instead the message is:

"Transform 123456789012::MyMacro failed without an error message."

Passing this error message back to the user would allow for new features to be implemented with macros, such as extended runtime parameter validation (like ensuring each member of a CommaDelimitedList matches a regex) or error checking (such as implementing custom validation rules)

## 3. Expected behavior

When a CloudFormation Macro returns some value other than "success" in the "status" field, that status is included in the reason for the failure (display back to the caller in the stack events).

## 4. Suggest specific test cases

## 5. Helpful Links to speed up research and evaluation

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html

## 6. Other

## 7. Any additional context (optional)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.