forked from mnsanfilippo/terraform-cloud-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
63 lines (54 loc) · 1.72 KB
/
variables.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
locals {
lambda_name = aws_lambda_function.tfc_workspaces_backup.function_name
# bucket_arn = module.s3_bucket.s3_bucket_arn
# kms_arn = aws_kms_key.tfc_workspace_backup.arn
#apigw_invoke_url = module.api_gateway.default_apigatewayv2_stage_invoke_url
}
variable "lambda_name" {
description = "The name of the lambda function"
type = string
default = "tfc-workspaces-backup"
}
variable "bucket_name" {
description = "Bucket to save the backups"
type = string
}
variable "apigw_name" {
description = "The name of the API gateway"
type = string
default = "tfc-workspaces-backup"
}
variable "notification_name" {
description = "The notification name for the TFC notification"
type = string
default = "tfc-workspaces-backup"
}
variable "workspace_ids" {
description = "List of the workspaces IDs to back up."
type = list(string)
}
# tflint-ignore: terraform_naming_convention
variable "TFE_TOKEN" {
type = string
description = "Terraform Cloud Token"
}
variable "bucket_builds" {
description = "Lambda Builds Bucket"
type = string
}
variable "lambda_s3_key" {
description = "Lambda Build Key"
type = string
}
variable "tags" {
description = "sdp-standard-tags object"
type = any
validation {
condition = length(setintersection(keys(var.tags.aws_tags), ["CostCenter", "Environment", ])) == 2
error_message = "ERROR: tags['aws_tags'] must contain 'CostCenter' and 'Environment' keys."
}
validation {
condition = length(setintersection(keys(var.tags), ["aws_tags", "env", "environment", ])) == 3
error_message = "ERROR: tags must contain 'aws_tags', 'env', and 'environment' keys."
}
}