forked from clouddrove/terraform-digitalocean-certificate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
21 lines (20 loc) · 1.24 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
##----------------------------------------------------------------------------------------------------
#Description : Provides a DigitalOcean Certificate resource that allows you to manage certificates.
##----------------------------------------------------------------------------------------------------
resource "digitalocean_certificate" "custom" {
count = var.enabled && var.custom_certificate == true ? 1 : 0
name = var.certificate_name
type = var.type
private_key = var.private_key != "" ? file(var.private_key) : null
leaf_certificate = var.leaf_certificate != "" ? file(var.leaf_certificate) : null
certificate_chain = var.certificate_chain != "" ? file(var.certificate_chain) : null
}
##---------------------------------------------------------------------------------------------------
#Description :Provides a DigitalOcean Certificate resource that allows you to manage certificates.
##---------------------------------------------------------------------------------------------------
resource "digitalocean_certificate" "lets_encrypt" {
count = var.enabled && var.custom_certificate == false ? 1 : 0
name = var.certificate_name
type = var.certificate_type
domains = var.domain_names
}