-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacm-node1.tf
34 lines (28 loc) · 867 Bytes
/
acm-node1.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
# Host certificates:
resource "tls_private_key" "host1_key" {
algorithm = "RSA"
}
resource "tls_cert_request" "host1_csr" {
key_algorithm = "RSA"
private_key_pem = tls_private_key.host1_key.private_key_pem
subject {
common_name = "host1.sub.${local.domain}"
}
}
resource "aws_acmpca_certificate" "host1_crt" {
certificate_authority_arn = aws_acmpca_certificate_authority.subordinate.arn
certificate_signing_request = tls_cert_request.host1_csr.cert_request_pem
signing_algorithm = "SHA256WITHRSA"
validity {
type = "YEARS"
value = 1
}
}
resource "local_file" "host1_crt" {
content = aws_acmpca_certificate.host1_crt.certificate
filename = "output/node.pem"
}
resource "local_file" "host1_chain" {
content = aws_acmpca_certificate.host1_crt.certificate_chain
filename = "output/node.chain"
}