question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Request] DD log forwarder: Allow CF stack to be deleted/destroyed

See original GitHub issue

Describe what happened: Datadog forwarder is set up in our AWS account to forward logs from lambdas, using these steps. The forwarder uses DD’s CF stack, which is an IaC module in our infra. When we destroy our infra, CF stack fails to delete because S3 resource “ForwarderBucket” has an object (cache.json) in it. This causes our destroy pipelines to fail.

Describe what you expected: DD’s CF stack deletes seamlessly. Forwarder bucket should have force-delete enabled.

Steps to reproduce the issue:

  1. Deploy this stack with terraform apply
  2. terraform destroy yields: Error: error waiting for CloudFormation Stack deletion: failed to delete CloudFormation stack (DELETE_FAILED): ["The following resource(s) failed to delete: [ForwarderBucket]. " "The bucket you tried to delete is not empty (Service: Amazon S3; Status Code: 409; Error Code: BucketNotEmpty

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jpogocommented, Jul 23, 2021

@agocs Would it be possible to export the name/arn of the S3 bucket as a CF output? That way it could be cleaned up manually in a deterministic way as a part of CI/CD pipelines

1reaction
agocscommented, Jul 19, 2021

Hi @vkakde , this is going to be a longer-running feature request. Unfortunately, the Lambda Forwarder is written as a Cloudformation Stack, and there is no native force-delete on Cloudformation stacks. There is DeletionPolicy: Delete, but that puts us back into the same position where it requires the S3 bucket to be empty first.

The supported method for deploying the Lambda Forwarder as a Terraform stack is simply wrapping the Cloudformation template in Terraform, and that does not give us access to aws_s3_bucket’s Force Destroy option. We would have to reimplement the Lambda Forwarder deployment in native terraform. I’m not against that, but it’s an engineering effort.

There’s also the option in which we implement a bucket cleanup lambda function as a custom resource. It’s not the worst solution, but it needs thorough testing.

I’m going to document these possibilities in our internal feature request so that our PMs can prioritize it accurately, but I’ll close this issue for now. Please feel free to reopen or reach out to support@datadoghq.com in the mean time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Datadog Forwarder
The Datadog Forwarder is an AWS Lambda function that ships logs, custom metrics, and traces from your environment to Datadog. The Forwarder can:....
Read more >
CloudFormation Deployment Error ... - GitHub
Try to deploy DataDog Forwarder to the AWS using the latest template by link - https://console.aws.amazon.com/cloudformation/home#/stacks/create/review?
Read more >
Update CloudFormation stacks that are failing because of ...
I manually deleted a resource that was created by one of my AWS CloudFormation stacks, and now my stack won't update.
Read more >
HP-UX 11i Test Cases - IRS
Interview the system administrator to determine the application audit log location ... Enabling stack protection prevents certain classes of buffer overflow ...
Read more >
Manager, Transport Airplane Directorate, Aircraft Certification ...
That NPRM proposed to continue to require revising the ... Information (k) Canadian airworthiness directive CF-2005-14R1, dated May 8, 2006, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found