Skip to content

Commit 0c92dad

Browse files
add output fields (#8649) (#15502)
Signed-off-by: Modular Magician <[email protected]>
1 parent 39462fe commit 0c92dad

File tree

5 files changed

+186
-0
lines changed

5 files changed

+186
-0
lines changed

.changelog/8649.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```release-note:enhancement
2+
cloudrunv2: Added the following output only fields to `google_cloud_run_v2_job` resource: `create_time`, `update_time`, `delete_time`, `expire_time`, `creator` and `last_modifier`.
3+
```
4+
```release-note:enhancement
5+
cloudrunv2: Added the following output only fields to `google_cloud_run_v2_service` resource: `create_time`, `update_time`, `delete_time`, `expire_time`, `creator` and `last_modifier`.
6+
```

google/services/cloudrunv2/resource_cloud_run_v2_job.go

+72
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,21 @@ A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to n
680680
},
681681
},
682682
},
683+
"create_time": {
684+
Type: schema.TypeString,
685+
Computed: true,
686+
Description: `The creation time.`,
687+
},
688+
"creator": {
689+
Type: schema.TypeString,
690+
Computed: true,
691+
Description: `Email address of the authenticated creator.`,
692+
},
693+
"delete_time": {
694+
Type: schema.TypeString,
695+
Computed: true,
696+
Description: `The deletion time.`,
697+
},
683698
"etag": {
684699
Type: schema.TypeString,
685700
Computed: true,
@@ -690,11 +705,21 @@ A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to n
690705
Computed: true,
691706
Description: `Number of executions created for this job.`,
692707
},
708+
"expire_time": {
709+
Type: schema.TypeString,
710+
Computed: true,
711+
Description: `For a deleted resource, the time after which it will be permamently deleted.`,
712+
},
693713
"generation": {
694714
Type: schema.TypeString,
695715
Computed: true,
696716
Description: `A number that monotonically increases every time the user modifies the desired state.`,
697717
},
718+
"last_modifier": {
719+
Type: schema.TypeString,
720+
Computed: true,
721+
Description: `Email address of the last authenticated modifier.`,
722+
},
698723
"latest_created_execution": {
699724
Type: schema.TypeList,
700725
Computed: true,
@@ -795,6 +820,11 @@ A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to n
795820
Computed: true,
796821
Description: `Server assigned unique identifier for the Execution. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.`,
797822
},
823+
"update_time": {
824+
Type: schema.TypeString,
825+
Computed: true,
826+
Description: `The last-modified time.`,
827+
},
798828
"project": {
799829
Type: schema.TypeString,
800830
Optional: true,
@@ -973,6 +1003,24 @@ func resourceCloudRunV2JobRead(d *schema.ResourceData, meta interface{}) error {
9731003
if err := d.Set("annotations", flattenCloudRunV2JobAnnotations(res["annotations"], d, config)); err != nil {
9741004
return fmt.Errorf("Error reading Job: %s", err)
9751005
}
1006+
if err := d.Set("create_time", flattenCloudRunV2JobCreateTime(res["createTime"], d, config)); err != nil {
1007+
return fmt.Errorf("Error reading Job: %s", err)
1008+
}
1009+
if err := d.Set("update_time", flattenCloudRunV2JobUpdateTime(res["updateTime"], d, config)); err != nil {
1010+
return fmt.Errorf("Error reading Job: %s", err)
1011+
}
1012+
if err := d.Set("delete_time", flattenCloudRunV2JobDeleteTime(res["deleteTime"], d, config)); err != nil {
1013+
return fmt.Errorf("Error reading Job: %s", err)
1014+
}
1015+
if err := d.Set("expire_time", flattenCloudRunV2JobExpireTime(res["expireTime"], d, config)); err != nil {
1016+
return fmt.Errorf("Error reading Job: %s", err)
1017+
}
1018+
if err := d.Set("creator", flattenCloudRunV2JobCreator(res["creator"], d, config)); err != nil {
1019+
return fmt.Errorf("Error reading Job: %s", err)
1020+
}
1021+
if err := d.Set("last_modifier", flattenCloudRunV2JobLastModifier(res["lastModifier"], d, config)); err != nil {
1022+
return fmt.Errorf("Error reading Job: %s", err)
1023+
}
9761024
if err := d.Set("client", flattenCloudRunV2JobClient(res["client"], d, config)); err != nil {
9771025
return fmt.Errorf("Error reading Job: %s", err)
9781026
}
@@ -1200,6 +1248,30 @@ func flattenCloudRunV2JobAnnotations(v interface{}, d *schema.ResourceData, conf
12001248
return v
12011249
}
12021250

1251+
func flattenCloudRunV2JobCreateTime(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1252+
return v
1253+
}
1254+
1255+
func flattenCloudRunV2JobUpdateTime(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1256+
return v
1257+
}
1258+
1259+
func flattenCloudRunV2JobDeleteTime(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1260+
return v
1261+
}
1262+
1263+
func flattenCloudRunV2JobExpireTime(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1264+
return v
1265+
}
1266+
1267+
func flattenCloudRunV2JobCreator(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1268+
return v
1269+
}
1270+
1271+
func flattenCloudRunV2JobLastModifier(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1272+
return v
1273+
}
1274+
12031275
func flattenCloudRunV2JobClient(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
12041276
return v
12051277
}

google/services/cloudrunv2/resource_cloud_run_v2_service.go

+72
Original file line numberDiff line numberDiff line change
@@ -803,16 +803,41 @@ A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to n
803803
},
804804
},
805805
},
806+
"create_time": {
807+
Type: schema.TypeString,
808+
Computed: true,
809+
Description: `The creation time.`,
810+
},
811+
"creator": {
812+
Type: schema.TypeString,
813+
Computed: true,
814+
Description: `Email address of the authenticated creator.`,
815+
},
816+
"delete_time": {
817+
Type: schema.TypeString,
818+
Computed: true,
819+
Description: `The deletion time.`,
820+
},
806821
"etag": {
807822
Type: schema.TypeString,
808823
Computed: true,
809824
Description: `A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.`,
810825
},
826+
"expire_time": {
827+
Type: schema.TypeString,
828+
Computed: true,
829+
Description: `For a deleted resource, the time after which it will be permamently deleted.`,
830+
},
811831
"generation": {
812832
Type: schema.TypeString,
813833
Computed: true,
814834
Description: `A number that monotonically increases every time the user modifies the desired state. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.`,
815835
},
836+
"last_modifier": {
837+
Type: schema.TypeString,
838+
Computed: true,
839+
Description: `Email address of the last authenticated modifier.`,
840+
},
816841
"latest_created_revision": {
817842
Type: schema.TypeString,
818843
Computed: true,
@@ -927,6 +952,11 @@ If reconciliation failed, trafficStatuses, observedGeneration, and latestReadyRe
927952
Computed: true,
928953
Description: `Server assigned unique identifier for the trigger. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.`,
929954
},
955+
"update_time": {
956+
Type: schema.TypeString,
957+
Computed: true,
958+
Description: `The last-modified time.`,
959+
},
930960
"uri": {
931961
Type: schema.TypeString,
932962
Computed: true,
@@ -1131,6 +1161,24 @@ func resourceCloudRunV2ServiceRead(d *schema.ResourceData, meta interface{}) err
11311161
if err := d.Set("annotations", flattenCloudRunV2ServiceAnnotations(res["annotations"], d, config)); err != nil {
11321162
return fmt.Errorf("Error reading Service: %s", err)
11331163
}
1164+
if err := d.Set("create_time", flattenCloudRunV2ServiceCreateTime(res["createTime"], d, config)); err != nil {
1165+
return fmt.Errorf("Error reading Service: %s", err)
1166+
}
1167+
if err := d.Set("update_time", flattenCloudRunV2ServiceUpdateTime(res["updateTime"], d, config)); err != nil {
1168+
return fmt.Errorf("Error reading Service: %s", err)
1169+
}
1170+
if err := d.Set("delete_time", flattenCloudRunV2ServiceDeleteTime(res["deleteTime"], d, config)); err != nil {
1171+
return fmt.Errorf("Error reading Service: %s", err)
1172+
}
1173+
if err := d.Set("expire_time", flattenCloudRunV2ServiceExpireTime(res["expireTime"], d, config)); err != nil {
1174+
return fmt.Errorf("Error reading Service: %s", err)
1175+
}
1176+
if err := d.Set("creator", flattenCloudRunV2ServiceCreator(res["creator"], d, config)); err != nil {
1177+
return fmt.Errorf("Error reading Service: %s", err)
1178+
}
1179+
if err := d.Set("last_modifier", flattenCloudRunV2ServiceLastModifier(res["lastModifier"], d, config)); err != nil {
1180+
return fmt.Errorf("Error reading Service: %s", err)
1181+
}
11341182
if err := d.Set("client", flattenCloudRunV2ServiceClient(res["client"], d, config)); err != nil {
11351183
return fmt.Errorf("Error reading Service: %s", err)
11361184
}
@@ -1392,6 +1440,30 @@ func flattenCloudRunV2ServiceAnnotations(v interface{}, d *schema.ResourceData,
13921440
return v
13931441
}
13941442

1443+
func flattenCloudRunV2ServiceCreateTime(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1444+
return v
1445+
}
1446+
1447+
func flattenCloudRunV2ServiceUpdateTime(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1448+
return v
1449+
}
1450+
1451+
func flattenCloudRunV2ServiceDeleteTime(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1452+
return v
1453+
}
1454+
1455+
func flattenCloudRunV2ServiceExpireTime(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1456+
return v
1457+
}
1458+
1459+
func flattenCloudRunV2ServiceCreator(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1460+
return v
1461+
}
1462+
1463+
func flattenCloudRunV2ServiceLastModifier(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1464+
return v
1465+
}
1466+
13951467
func flattenCloudRunV2ServiceClient(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
13961468
return v
13971469
}

website/docs/r/cloud_run_v2_job.html.markdown

+18
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,24 @@ In addition to the arguments listed above, the following computed attributes are
771771
* `generation` -
772772
A number that monotonically increases every time the user modifies the desired state.
773773

774+
* `create_time` -
775+
The creation time.
776+
777+
* `update_time` -
778+
The last-modified time.
779+
780+
* `delete_time` -
781+
The deletion time.
782+
783+
* `expire_time` -
784+
For a deleted resource, the time after which it will be permamently deleted.
785+
786+
* `creator` -
787+
Email address of the authenticated creator.
788+
789+
* `last_modifier` -
790+
Email address of the last authenticated modifier.
791+
774792
* `observed_generation` -
775793
The generation of this Job. See comments in reconciling for additional information on reconciliation process in Cloud Run.
776794

website/docs/r/cloud_run_v2_service.html.markdown

+18
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,24 @@ In addition to the arguments listed above, the following computed attributes are
891891
* `generation` -
892892
A number that monotonically increases every time the user modifies the desired state. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.
893893

894+
* `create_time` -
895+
The creation time.
896+
897+
* `update_time` -
898+
The last-modified time.
899+
900+
* `delete_time` -
901+
The deletion time.
902+
903+
* `expire_time` -
904+
For a deleted resource, the time after which it will be permamently deleted.
905+
906+
* `creator` -
907+
Email address of the authenticated creator.
908+
909+
* `last_modifier` -
910+
Email address of the last authenticated modifier.
911+
894912
* `observed_generation` -
895913
The generation of this Service currently serving traffic. See comments in reconciling for additional information on reconciliation process in Cloud Run. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.
896914

0 commit comments

Comments
 (0)