forked from ugur-zongur/terraform-provider-lambdabased
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
executable file
·39 lines (34 loc) · 927 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
terraform {
required_providers {
lambdabased = {
source = "thetradedesk/lambdabased"
}
}
}
provider "lambdabased" {
region = "us-east-1"
}
locals {
credentials = {
creds = "temporary-creds" # For instance, this can a token acquired with aws_eks_cluster_auth
}
parameters = {
param = "parameter-value"
}
destroy_parameters = {
param = "parameter-destroy-value"
}
}
resource "lambdabased_resource" "test" {
function_name = "test-function"
triggers = {
param = sha512(jsonencode(local.parameters)) # drop sha512 if you want to store this in cleartext in the tf state
}
input = jsonencode(merge(local.credentials, local.parameters))
conceal_input = true
conceal_result = true
finalizer {
function_name = "test-function" # or another function if needed
input = jsonencode(merge(local.credentials, local.destroy_parameters))
}
}