-
Notifications
You must be signed in to change notification settings - Fork 5
/
anchor-cert.tf
54 lines (45 loc) · 1.36 KB
/
anchor-cert.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
// Create trusted Anchor Certificate
resource "tls_private_key" "trustanchor_key" {
algorithm = "ECDSA"
ecdsa_curve = "P256"
}
resource "tls_self_signed_cert" "trustanchor_cert" {
key_algorithm = tls_private_key.trustanchor_key.algorithm
private_key_pem = tls_private_key.trustanchor_key.private_key_pem
validity_period_hours = 87600
is_ca_certificate = true
subject {
common_name = "identity.linkerd.cluster.local"
}
allowed_uses = [
"crl_signing",
"cert_signing",
"server_auth",
"client_auth"
]
}
resource "tls_private_key" "issuer_key" {
algorithm = "ECDSA"
ecdsa_curve = "P256"
}
resource "tls_cert_request" "issuer_req" {
key_algorithm = tls_private_key.issuer_key.algorithm
private_key_pem = tls_private_key.issuer_key.private_key_pem
subject {
common_name = "identity.linkerd.cluster.local"
}
}
resource "tls_locally_signed_cert" "issuer_cert" {
cert_request_pem = tls_cert_request.issuer_req.cert_request_pem
ca_key_algorithm = tls_private_key.trustanchor_key.algorithm
ca_private_key_pem = tls_private_key.trustanchor_key.private_key_pem
ca_cert_pem = tls_self_signed_cert.trustanchor_cert.cert_pem
validity_period_hours = 8760
is_ca_certificate = true
allowed_uses = [
"crl_signing",
"cert_signing",
"server_auth",
"client_auth"
]
}