File tree 3 files changed +14
-6
lines changed
3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change
1
+ ```release-note: none
2
+
3
+ ```
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ func TestAccPrivatecaCertificate_privatecaCertificateConfigExample(t *testing.T)
59
59
60
60
func testAccPrivatecaCertificate_privatecaCertificateConfigExample (context map [string ]interface {}) string {
61
61
return acctest .Nprintf (`
62
+
62
63
resource "google_privateca_ca_pool" "default" {
63
64
location = "us-central1"
64
65
name = "tf-test-my-pool%{random_suffix}"
Original file line number Diff line number Diff line change @@ -27,13 +27,13 @@ A Certificate corresponds to a signed X.509 certificate issued by a Certificate.
27
27
28
28
29
29
30
- ## Example Usage - Privateca Certificate Config
30
+ ## Example Usage - Privateca Certificate Generated Key
31
31
32
32
33
33
``` hcl
34
34
resource "google_privateca_ca_pool" "default" {
35
35
location = "us-central1"
36
- name = "my-pool "
36
+ name = "default "
37
37
tier = "ENTERPRISE"
38
38
}
39
39
@@ -76,12 +76,16 @@ resource "google_privateca_certificate_authority" "default" {
76
76
ignore_active_certificates_on_deletion = true
77
77
}
78
78
79
+ resource "tls_private_key" "cert_key" {
80
+ algorithm = "RSA"
81
+ }
82
+
79
83
resource "google_privateca_certificate" "default" {
80
84
location = "us-central1"
81
85
pool = google_privateca_ca_pool.default.name
82
86
certificate_authority = google_privateca_certificate_authority.default.certificate_authority_id
83
87
lifetime = "86000s"
84
- name = "my-certificate "
88
+ name = "cert-1 "
85
89
config {
86
90
subject_config {
87
91
subject {
@@ -105,8 +109,8 @@ resource "google_privateca_certificate" "default" {
105
109
}
106
110
key_usage {
107
111
base_key_usage {
108
- crl_sign = false
109
- decipher_only = false
112
+ cert_sign = true
113
+ crl_sign = true
110
114
}
111
115
extended_key_usage {
112
116
server_auth = false
@@ -126,7 +130,7 @@ resource "google_privateca_certificate" "default" {
126
130
}
127
131
public_key {
128
132
format = "PEM"
129
- key = filebase64("test-fixtures/rsa_public.pem" )
133
+ key = base64encode(tls_private_key.cert_key.public_key_pem )
130
134
}
131
135
}
132
136
}
You can’t perform that action at this time.
0 commit comments