Ben Giddins
My feedback
3 results found
-
18 votes
Hi we working to enhance the the use of Triggers and Functions in Terraform, but this effort still several quarters away. Feel free to reach on in the interim in case of any questions and happy to help.
An error occurred while saving the comment -
30 votesBen Giddins supported this idea ·
-
21 votes
An error occurred while saving the comment Ben Giddins commentedThat actually makes a lot of sense - we actually already have a provisioning Lambda written in Go to create a number of views used in our application - we can extend this to create the indexes as well.
An error occurred while saving the comment Ben Giddins commentedAgreed - our entire infrastructure is built out using Terraform - it's an aberration to have to manually create indexes on collections when we can create search indexes using Terraform.
Ben Giddins supported this idea ·
I went through the exercise today of deploying a database trigger that calls a function using mongodbatlas_event_trigger.
There's no mechanism to deploy the function code through Terraform - the above resource needs you to first create a JavaScript function either through the UI or CLI, and refer to it by an ID you extract from the URL in the UI.
Basically it would be great if mongodbatlas_event_trigger could be a little more like aws_lambda_function where I could bring in the function's JavaScript file from a path or an S3 bucket (we use an S3 bucket for Lambda zips in our workflow).
This is what my Lambda tfs look like:
data "aws_s3_object" "my_lambda_function" {
bucket = var.s3_bucket_deployment
key = "lambda/go1.x/web/my_lambda_function.zip"
}
resource "aws_lambda_function" "my_lambda_function" {
function_name = "${var.deployment}_my_lambda_function"
s3_bucket = data.aws_s3_object.my_lambda_function.bucket
s3_key = data.aws_s3_object.my_lambda_function.key
s3_object_version = data.aws_s3_object.my_lambda_function.version_id
...
Would be great to be able to grab a .js from the path or S3 and publish the function either in it's own resource or as part of mongodbatlas_event_trigger.