DataDog / datadog-cloudformation-macro

CloudFormation Macros by Datadog
Apache License 2.0
14 stars 22 forks source link

Cannot set property 'DatadogServerless...' of undefined #22

Closed ohnu closed 3 years ago

ohnu commented 4 years ago

Actual Behavior

We are receiving the following error:

❌ ConvertorService-development failed: Error: Failed to create ChangeSet CDK-a4f92cc3-e91c-42e3-8706-50d1416ddc22 on ConvertorService-development: FAILED, Transform 588037597690::DatadogServerless failed with: Cannot set property 'DatadogServerlessMainHandler0B2856CD' of undefined Failed to create ChangeSet CDK-a4f92cc3-e91c-42e3-8706-50d1416ddc22 on ConvertorService-development: FAILED, Transform 588037597690::DatadogServerless failed with: Cannot set property 'DatadogServerlessMainHandler0B2856CD' of undefined

Steps to Reproduce the Problem

Specifications

For the Datadog Serverless Macro:

Stacktrace

N/A - does not show up

Observations

I've tried to trace this issue, and I think it might be related to https://github.com/DataDog/datadog-cloudformation-macro/pull/20/files Specifically at line 188 it is trying to set a value, but the outputs variable seem to be undefined. To go around this I've manually edited this line const outputs = fragment.Outputs; to have a fallback to an empty object and seemed to work. I do not have underlying knowledge to understand why the fragment's outputs are empty but they just seem to be that way in my case.

johnchapin commented 4 years ago

I've been impacted by this as well.

My workaround in a SAM template is to add an Outputs key with an empty map as the value at the top level, like this:

Outputs: {}
ohnu commented 3 years ago

@Hesperide @JacksonDavenport any plans on fixing this ?

tianchu commented 3 years ago

@ohnu This does sound like a regression in the latest version, we should be able to fix it. Meanwhile, for anyone encountering this issue, please try using version 0.1.3.

joeferraro commented 3 years ago

We are also encountering an issue related to outputs. The exception we receive references an unresolved element "in the Outputs block of the template." Removing the datadog macro allows the template to be deployed.

tianchu commented 3 years ago

We have rolled out quite a few new versions since the issue being reported and lots of the implementation has changed. Is anyone still experiencing this issue on the latest version?

hghotra commented 3 years ago

@ohnu closing this issue for now, please let us know if you're still running into this issue.