Skip to content

Commit 9e336b1

Browse files
Add expire_time output field to multiple ssl certificate resources (#7007) (#13392)
* Add `expire_time` output field to global `google_compute_ssl_certificate` resource * Add `expire_time` output field to regional `google_compute_region_ssl_certificate` resource * Add `expire_time` output field to global `google_compute_managed_ssl_certificate` resource * Remove duplicate `expire_time` field from `google_compute_managed_ssl_certificate`, update description in original entry Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
1 parent 373ad89 commit 9e336b1

7 files changed

+38
-2
lines changed

.changelog/7007.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```release-note:enhancement
2+
compute: added field `expire_time` to resource `google_compute_ssl_certificate`
3+
```
4+
```release-note:enhancement
5+
compute: added field `expire_time` to resource `google_compute_region_ssl_certificate`
6+
```

google/resource_compute_managed_ssl_certificate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ which type this is. Default value: "MANAGED" Possible values: ["MANAGED"]`,
107107
"expire_time": {
108108
Type: schema.TypeString,
109109
Computed: true,
110-
Description: `Expire time of the certificate.`,
110+
Description: `Expire time of the certificate in RFC3339 text format.`,
111111
},
112112
"subject_alternative_names": {
113113
Type: schema.TypeList,

google/resource_compute_region_ssl_certificate.go

+12
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ If it is not provided, the provider region is used.`,
9999
Computed: true,
100100
Description: `Creation timestamp in RFC3339 text format.`,
101101
},
102+
"expire_time": {
103+
Type: schema.TypeString,
104+
Computed: true,
105+
Description: `Expire time of the certificate in RFC3339 text format.`,
106+
},
102107
"name_prefix": {
103108
Type: schema.TypeString,
104109
Optional: true,
@@ -260,6 +265,9 @@ func resourceComputeRegionSslCertificateRead(d *schema.ResourceData, meta interf
260265
if err := d.Set("description", flattenComputeRegionSslCertificateDescription(res["description"], d, config)); err != nil {
261266
return fmt.Errorf("Error reading RegionSslCertificate: %s", err)
262267
}
268+
if err := d.Set("expire_time", flattenComputeRegionSslCertificateExpireTime(res["expireTime"], d, config)); err != nil {
269+
return fmt.Errorf("Error reading RegionSslCertificate: %s", err)
270+
}
263271
if err := d.Set("certificate_id", flattenComputeRegionSslCertificateCertificateId(res["id"], d, config)); err != nil {
264272
return fmt.Errorf("Error reading RegionSslCertificate: %s", err)
265273
}
@@ -354,6 +362,10 @@ func flattenComputeRegionSslCertificateDescription(v interface{}, d *schema.Reso
354362
return v
355363
}
356364

365+
func flattenComputeRegionSslCertificateExpireTime(v interface{}, d *schema.ResourceData, config *Config) interface{} {
366+
return v
367+
}
368+
357369
func flattenComputeRegionSslCertificateCertificateId(v interface{}, d *schema.ResourceData, config *Config) interface{} {
358370
// Handles the string fixed64 format
359371
if strVal, ok := v.(string); ok {

google/resource_compute_ssl_certificate.go

+12
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ These are in the same namespace as the managed SSL certificates.`,
9090
Computed: true,
9191
Description: `Creation timestamp in RFC3339 text format.`,
9292
},
93+
"expire_time": {
94+
Type: schema.TypeString,
95+
Computed: true,
96+
Description: `Expire time of the certificate in RFC3339 text format.`,
97+
},
9398
"name_prefix": {
9499
Type: schema.TypeString,
95100
Optional: true,
@@ -245,6 +250,9 @@ func resourceComputeSslCertificateRead(d *schema.ResourceData, meta interface{})
245250
if err := d.Set("description", flattenComputeSslCertificateDescription(res["description"], d, config)); err != nil {
246251
return fmt.Errorf("Error reading SslCertificate: %s", err)
247252
}
253+
if err := d.Set("expire_time", flattenComputeSslCertificateExpireTime(res["expireTime"], d, config)); err != nil {
254+
return fmt.Errorf("Error reading SslCertificate: %s", err)
255+
}
248256
if err := d.Set("certificate_id", flattenComputeSslCertificateCertificateId(res["id"], d, config)); err != nil {
249257
return fmt.Errorf("Error reading SslCertificate: %s", err)
250258
}
@@ -335,6 +343,10 @@ func flattenComputeSslCertificateDescription(v interface{}, d *schema.ResourceDa
335343
return v
336344
}
337345

346+
func flattenComputeSslCertificateExpireTime(v interface{}, d *schema.ResourceData, config *Config) interface{} {
347+
return v
348+
}
349+
338350
func flattenComputeSslCertificateCertificateId(v interface{}, d *schema.ResourceData, config *Config) interface{} {
339351
// Handles the string fixed64 format
340352
if strVal, ok := v.(string); ok {

website/docs/r/compute_managed_ssl_certificate.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ In addition to the arguments listed above, the following computed attributes are
256256
Domains associated with the certificate via Subject Alternative Name.
257257

258258
* `expire_time` -
259-
Expire time of the certificate.
259+
Expire time of the certificate in RFC3339 text format.
260260
* `self_link` - The URI of the created resource.
261261

262262

website/docs/r/compute_region_ssl_certificate.html.markdown

+3
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ In addition to the arguments listed above, the following computed attributes are
226226
* `creation_timestamp` -
227227
Creation timestamp in RFC3339 text format.
228228

229+
* `expire_time` -
230+
Expire time of the certificate in RFC3339 text format.
231+
229232
* `certificate_id` -
230233
The unique identifier for the resource.
231234
* `self_link` - The URI of the created resource.

website/docs/r/compute_ssl_certificate.html.markdown

+3
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ In addition to the arguments listed above, the following computed attributes are
213213
* `creation_timestamp` -
214214
Creation timestamp in RFC3339 text format.
215215

216+
* `expire_time` -
217+
Expire time of the certificate in RFC3339 text format.
218+
216219
* `certificate_id` -
217220
The unique identifier for the resource.
218221
* `self_link` - The URI of the created resource.

0 commit comments

Comments
 (0)