hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.81k stars 9.16k forks source link

[Enhancement]: aws_guardduty_detector Lambda Protection support #30859

Closed oleptho closed 1 year ago

oleptho commented 1 year ago

Description

Amazon GuardDuty now supports Lambda Protection but the terraform resource for GuardDuty does not yet support it.

It would be great if we could enable GuardDuty Lambda Protection with terraform resource aws_guardduty_detector.

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

resource "aws_guardduty_detector" "MyDetector" {
  enable = true

  datasources {
    s3_logs {
      enable = true
    }
    lambda_protection {
      enable = true
    }
    kubernetes {
      audit_logs {
        enable = false
      }
    }
    malware_protection {
      scan_ec2_instance_with_findings {
        ebs_volumes {
          enable = true
        }
      }
    }
  }
}

References

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

galoitsu commented 1 year ago

GuardDuty API changes in March 2023#Mapping dataSources to features

According to the official documentation above, it appears that the DataSources attribute cannot be used to set Lambda protection and that the Features attribute must be used instead.

However, this provider does not currently support the Features attribute, so you cannot use this provider to set Lambda protection.

See #30303 .

ewbankkit commented 1 year ago

You will be able to use the upcoming aws_guardduty_detector_feature resource (https://github.com/hashicorp/terraform-provider-aws/pull/31463):

resource "aws_guardduty_detector" "example" {
  enable = true
}

resource "aws_guardduty_detector_feature" "example" {
  detector_id = aws_guardduty_detector.example.id
  name        = "LAMBDA_NETWORK_LOGS"
  status      = "ENABLED"
}
github-actions[bot] commented 1 year ago

This functionality has been released in v5.20.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 11 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.