Skip to content

Commit 1333c90

Browse files
committed
feat: vendor vpc flow log and rds enhanced monitoring forwarder source artifacts
1 parent ff7733a commit 1333c90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+38
-63
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ terraform.rc
3535

3636
# Lambda zip archive and scripts
3737
*.zip
38+
!/modules/**/vendored_archives/*.zip
3839
*.py

README.md

Lines changed: 4 additions & 0 deletions

modules/rds_enhanced_monitoring_forwarder/README.md

Lines changed: 0 additions & 2 deletions

modules/rds_enhanced_monitoring_forwarder/main.tf

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ locals {
44

55
role_name = coalesce(var.role_name, var.name)
66
policy_name = coalesce(var.policy_name, var.name)
7-
8-
script_url = "https://raw.githubusercontent.com/DataDog/datadog-serverless-functions/aws-dd-forwarder-${var.forwarder_version}/aws/rds_enhanced_monitoring/lambda_function.py"
9-
script_file = "${path.module}/lambda_function.py"
10-
forwarder_zip = "${path.module}/aws-dd-rds-enhanced-monitoring-forwarder-${var.forwarder_version}.zip"
117
}
128

139
data "aws_caller_identity" "current" {}
14-
1510
data "aws_region" "current" {}
1611

1712
################################################################################
@@ -75,32 +70,10 @@ resource "aws_iam_role_policy_attachment" "this" {
7570
# Forwarder Lambda Function
7671
################################################################################
7772

78-
resource "null_resource" "this" {
79-
count = var.create ? 1 : 0
80-
81-
triggers = {
82-
on_version_change = var.forwarder_version
83-
}
84-
85-
provisioner "local-exec" {
86-
command = "curl --silent -o ${local.script_file} -L '${local.script_url}'"
87-
}
88-
}
89-
90-
data "archive_file" "lambda_zip" {
91-
count = var.create ? 1 : 0
92-
93-
type = "zip"
94-
source_file = local.script_file
95-
output_path = local.forwarder_zip
96-
97-
depends_on = [null_resource.this]
98-
}
99-
10073
resource "aws_lambda_function" "this" {
10174
count = var.create ? 1 : 0
10275

103-
filename = local.forwarder_zip
76+
filename = "${path.module}/vendored_archives/${var.forwarder_version}.zip"
10477
function_name = var.name
10578
handler = "lambda_function.lambda_handler"
10679

@@ -135,8 +108,6 @@ resource "aws_lambda_function" "this" {
135108
}
136109

137110
tags = merge(var.tags, var.lambda_tags, local.version_tag)
138-
139-
depends_on = [null_resource.this]
140111
}
141112

142113
resource "aws_lambda_permission" "cloudwatch" {
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)