diff --git a/.changelog/7007.txt b/.changelog/7007.txt new file mode 100644 index 00000000000..5ea0271503c --- /dev/null +++ b/.changelog/7007.txt @@ -0,0 +1,6 @@ +```release-note:enhancement +compute: added field `expire_time` to resource `google_compute_ssl_certificate` +``` +```release-note:enhancement +compute: added field `expire_time` to resource `google_compute_region_ssl_certificate` +``` diff --git a/google/resource_compute_managed_ssl_certificate.go b/google/resource_compute_managed_ssl_certificate.go index f56e652cb8a..31491c0d721 100644 --- a/google/resource_compute_managed_ssl_certificate.go +++ b/google/resource_compute_managed_ssl_certificate.go @@ -107,7 +107,7 @@ which type this is. Default value: "MANAGED" Possible values: ["MANAGED"]`, "expire_time": { Type: schema.TypeString, Computed: true, - Description: `Expire time of the certificate.`, + Description: `Expire time of the certificate in RFC3339 text format.`, }, "subject_alternative_names": { Type: schema.TypeList, diff --git a/google/resource_compute_region_ssl_certificate.go b/google/resource_compute_region_ssl_certificate.go index 67f9b077cdb..0a641a73ecf 100644 --- a/google/resource_compute_region_ssl_certificate.go +++ b/google/resource_compute_region_ssl_certificate.go @@ -99,6 +99,11 @@ If it is not provided, the provider region is used.`, Computed: true, Description: `Creation timestamp in RFC3339 text format.`, }, + "expire_time": { + Type: schema.TypeString, + Computed: true, + Description: `Expire time of the certificate in RFC3339 text format.`, + }, "name_prefix": { Type: schema.TypeString, Optional: true, @@ -260,6 +265,9 @@ func resourceComputeRegionSslCertificateRead(d *schema.ResourceData, meta interf if err := d.Set("description", flattenComputeRegionSslCertificateDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading RegionSslCertificate: %s", err) } + if err := d.Set("expire_time", flattenComputeRegionSslCertificateExpireTime(res["expireTime"], d, config)); err != nil { + return fmt.Errorf("Error reading RegionSslCertificate: %s", err) + } if err := d.Set("certificate_id", flattenComputeRegionSslCertificateCertificateId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading RegionSslCertificate: %s", err) } @@ -354,6 +362,10 @@ func flattenComputeRegionSslCertificateDescription(v interface{}, d *schema.Reso return v } +func flattenComputeRegionSslCertificateExpireTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + func flattenComputeRegionSslCertificateCertificateId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { diff --git a/google/resource_compute_ssl_certificate.go b/google/resource_compute_ssl_certificate.go index da5238a0473..9ad47e15030 100644 --- a/google/resource_compute_ssl_certificate.go +++ b/google/resource_compute_ssl_certificate.go @@ -90,6 +90,11 @@ These are in the same namespace as the managed SSL certificates.`, Computed: true, Description: `Creation timestamp in RFC3339 text format.`, }, + "expire_time": { + Type: schema.TypeString, + Computed: true, + Description: `Expire time of the certificate in RFC3339 text format.`, + }, "name_prefix": { Type: schema.TypeString, Optional: true, @@ -245,6 +250,9 @@ func resourceComputeSslCertificateRead(d *schema.ResourceData, meta interface{}) if err := d.Set("description", flattenComputeSslCertificateDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading SslCertificate: %s", err) } + if err := d.Set("expire_time", flattenComputeSslCertificateExpireTime(res["expireTime"], d, config)); err != nil { + return fmt.Errorf("Error reading SslCertificate: %s", err) + } if err := d.Set("certificate_id", flattenComputeSslCertificateCertificateId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading SslCertificate: %s", err) } @@ -335,6 +343,10 @@ func flattenComputeSslCertificateDescription(v interface{}, d *schema.ResourceDa return v } +func flattenComputeSslCertificateExpireTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + func flattenComputeSslCertificateCertificateId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { diff --git a/website/docs/r/compute_managed_ssl_certificate.html.markdown b/website/docs/r/compute_managed_ssl_certificate.html.markdown index 5e3d4c801ab..d79a0d167c4 100644 --- a/website/docs/r/compute_managed_ssl_certificate.html.markdown +++ b/website/docs/r/compute_managed_ssl_certificate.html.markdown @@ -256,7 +256,7 @@ In addition to the arguments listed above, the following computed attributes are Domains associated with the certificate via Subject Alternative Name. * `expire_time` - - Expire time of the certificate. + Expire time of the certificate in RFC3339 text format. * `self_link` - The URI of the created resource. diff --git a/website/docs/r/compute_region_ssl_certificate.html.markdown b/website/docs/r/compute_region_ssl_certificate.html.markdown index 49a2f1cd109..8a015fadb9f 100644 --- a/website/docs/r/compute_region_ssl_certificate.html.markdown +++ b/website/docs/r/compute_region_ssl_certificate.html.markdown @@ -226,6 +226,9 @@ In addition to the arguments listed above, the following computed attributes are * `creation_timestamp` - Creation timestamp in RFC3339 text format. +* `expire_time` - + Expire time of the certificate in RFC3339 text format. + * `certificate_id` - The unique identifier for the resource. * `self_link` - The URI of the created resource. diff --git a/website/docs/r/compute_ssl_certificate.html.markdown b/website/docs/r/compute_ssl_certificate.html.markdown index 3d4df0cd2c3..57619fb4fb7 100644 --- a/website/docs/r/compute_ssl_certificate.html.markdown +++ b/website/docs/r/compute_ssl_certificate.html.markdown @@ -213,6 +213,9 @@ In addition to the arguments listed above, the following computed attributes are * `creation_timestamp` - Creation timestamp in RFC3339 text format. +* `expire_time` - + Expire time of the certificate in RFC3339 text format. + * `certificate_id` - The unique identifier for the resource. * `self_link` - The URI of the created resource.