-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
50 lines (39 loc) · 1.12 KB
/
variables.tf
File metadata and controls
50 lines (39 loc) · 1.12 KB
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
variable "hostname" {
type = string
description = "The hostname to reach the SQL Server."
}
variable "port" {
type = string
default = "1433"
description = "The port to connect to SQL Server."
}
variable "admin_username" {
type = string
description = <<EOF
The name of the SQL Server user that has access to administer users.
EOF
}
variable "admin_password_secret_name" {
type = string
description = <<EOF
The name of the secret in AWS Secrets Manager containing the admin password as plaintext.
EOF
}
data "aws_secretsmanager_secret" "admin_password" {
name = var.admin_password_secret_name
}
ephemeral "aws_secretsmanager_secret_version" "admin_password" {
secret_id = data.aws_secretsmanager_secret.admin_password.id
}
locals {
admin_password = ephemeral.aws_secretsmanager_secret_version.admin_password.secret_string
}
variable "security_group_name" {
type = string
default = ""
description = "The name of the security group attached to the database."
}
data "aws_security_group" "this" {
count = var.security_group_name == "" ? 0 : 1
name = var.security_group_name
}