Skip to content

Commit 77f563f

Browse files
wiktornNandiniAgrawal15
authored andcommitted
Add numeric_id to google_compute_instance_template (GoogleCloudPlatform#13584)
1 parent 0e15bbe commit 77f563f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

mmv1/third_party/terraform/services/compute/resource_compute_instance_template.go.tmpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"reflect"
88
"strings"
9+
"strconv"
910
"time"
1011

1112
"github.com/hashicorp/errwrap"
@@ -684,6 +685,13 @@ Google Cloud KMS. Only one of kms_key_self_link, rsa_encrypted_key and raw_key m
684685
},
685686
},
686687

688+
"numeric_id": {
689+
Type: schema.TypeString,
690+
ForceNew: true,
691+
Computed: true,
692+
Description: `The ID of the template in numeric format.`,
693+
},
694+
687695
"project": {
688696
Type: schema.TypeString,
689697
Optional: true,
@@ -1966,6 +1974,10 @@ func resourceComputeInstanceTemplateRead(d *schema.ResourceData, meta interface{
19661974
}
19671975
}
19681976

1977+
if err = d.Set("numeric_id", strconv.FormatUint(instanceTemplate.Id, 10)); err != nil {
1978+
return fmt.Errorf("Error setting numeric_id: %s", err)
1979+
}
1980+
19691981
{{ if ne $.TargetVersionName `ga` -}}
19701982
if instanceTemplate.Properties.PartnerMetadata != nil {
19711983
partnerMetadata, err := flattenPartnerMetadata(instanceTemplate.Properties.PartnerMetadata)

mmv1/third_party/terraform/website/docs/r/compute_instance_template.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,8 @@ exported:
799799

800800
* `creation_timestamp` - Creation timestamp in RFC3339 text format.
801801

802+
* `numeric_id` - numeric identifier of the resource.
803+
802804
* `metadata_fingerprint` - The unique fingerprint of the metadata.
803805

804806
* `self_link` - The URI of the created resource.

0 commit comments

Comments
 (0)