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

Should this be used with cloudformation templates? #25

Closed
exiadbq opened this issue Jan 15, 2021 · 3 comments
Closed

Should this be used with cloudformation templates? #25

exiadbq opened this issue Jan 15, 2021 · 3 comments

Comments

@exiadbq
Copy link

exiadbq commented Jan 15, 2021

https://github.com/DataDog/datadog-cloudformation-macro#datadog-cloudformation-macro
read me says yes,

sub folder no mentioning
https://github.com/DataDog/datadog-cloudformation-macro/tree/master/serverless#datadog-serverless-macro

Support guy suggest it should work with CF templates, but seems not clear, or not sure if working.

@tianchu
Copy link
Contributor

tianchu commented Jan 15, 2021

This macro primarily focuses on AWS SAM and CDK use cases, but it should work for CloudFormation projects too. Let us know if you encounter any issue. For quick questions like this, you could also find us in our slack community.

@exiadbq
Copy link
Author

exiadbq commented Jan 21, 2021

Thanks for replying!

Transform:
  - AWS::Serverless-2016-10-31
  - Name: DatadogServerless
    Parameters:
      nodeLayerVersion: 43
      forwarderArn:
        Fn::ImportValue: datadog-forwarder-ForwarderArn

I got an error while generating changeset for my cfn template on template level, I didn't add service param as my template has multiple functions and each can be its own service.

The value of parameter forwarderArn under transform DatadogServerless must resolve to a string, number, boolean or a list of any of these.
Which may or may not relate to aws/serverless-application-model#22?

@tianchu
Copy link
Contributor

tianchu commented Jan 21, 2021

@exiadbq you are right, your issue and aws/serverless-application-model#22 are due to the same root cause -- CFN passes the raw template to the macro for transformation, i.e., our macro sees Fn::ImportValue: datadog-forwarder-ForwarderArn instead of the actual value of the forwarder ARN, so it's not gonna work.

The workaround is to NOT define the forwarderArn parameter (which creates the subscription filters behind scene) and instead you define subscription filters on your functions' log groups in your SAM/CFN template. Similar to what is described here.

I'm going to close this issue, since I think this kind of questions are better suited for our slack community.

@tianchu tianchu closed this as completed Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants