DataDog / datadog-cloudformation-macro

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

Can no longer deploy cloudformation stacks with datadog layers with the latest datadog macro #133

Closed sawilde closed 1 week ago

sawilde commented 1 week ago

Expected Behavior

deploys without issue as before

Actual Behavior

fails to deploy and is now requesting the extensionLayerVersion field is provided

Error: Failed to create changeset for the stack: XXXX, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state: For expression "Status" we matched expected path: "FAILED" Status: FAILED. Reason: Transform 026031068607::DatadogServerless failed with: Please add the 'extensionLayerVersion' parameter for the Datadog serverless macro

it is not possible to add that field alone as doing so then results in

Error: Failed to create changeset for the stack: XXXX, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state: For expression "Status" we matched expected path: "FAILED" Status: FAILED. Reason: Transform 026031068607::DatadogServerless failed with: When `extensionLayerVersion` is set, `apiKey`, `apiKeySecretArn`, or `apiKmsKey` must also be set.

We do not have these as we are using the datadog-forwarder to take our cloudwatch logs and push them into datadog

Steps to Reproduce the Problem

  1. upgrade to template version 0.14.0.yml (current latest.yml) with a setup that uses datadog-forwarder (additional infrastructure)

Specifications

For the Datadog Serverless Macro:

Stacktrace

Error: Failed to create changeset for the stack: XXXX, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state: For expression "Status" we matched expected path: "FAILED" Status: FAILED. Reason: Transform 026031068607::DatadogServerless failed with: Please add the 'extensionLayerVersion' parameter for the Datadog serverless macro

The problem seems to stem from this PR

https://github.com/DataDog/datadog-cloudformation-macro/pull/131

which now throws an error when extensionLayerVersion is not provided.

TophrC-dd commented 1 week ago

Hello @sawilde -- We had put out an update that had added the ability to add the extension layer independently of the other layers. The parameter addExtension is currently defaults to true. I am going to work on making a change so the parameter is set to false by default. This should resolve the error.

I apologize for the inconvenience this has caused.

sawilde commented 1 week ago

So the fix is to add

addLayers: false

to our templates?

Where is this documented?

TophrC-dd commented 1 week ago

Hey @sawilde -- a work around for now is adding the parameter addExtension to false. I am working on a pr currently to default this parameter to false. so this would be a temporary work around. The documentation is in a pr currently.

sawilde commented 1 week ago

And what value should I use for extensionLayerVersion?

PS sorry for the questions but trying to make sure the all details are available to others seeking a fix/solution

TophrC-dd commented 1 week ago

Hey @sawilde -- just as an update. We had just released version 0.14.1 of the cloudformation macro - which addresses this issue and you should now be able to run the macro as you had it previously configured.

Thank you for reaching out and letting us know of this issue.

sawilde commented 1 week ago

referencing https://github.com/DataDog/datadog-cloudformation-macro/pull/134