Skip to content

Commit

Permalink
Add route_rules to UrlMap for Traffic Director
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
Ty Larrabee authored and modular-magician committed Dec 4, 2019
1 parent 3e3d4d0 commit 27c778e
Show file tree
Hide file tree
Showing 5 changed files with 4,882 additions and 167 deletions.
18 changes: 18 additions & 0 deletions google/resource_compute_target_tcp_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ the backend, either NONE or PROXY_V1. The default is NONE.`,
Computed: true,
Description: `The unique identifier for the resource.`,
},
"proxy_id": {
Type: schema.TypeInt,
Computed: true,
Description: `The unique identifier for the resource.`,
},
"project": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -186,6 +191,9 @@ func resourceComputeTargetTcpProxyRead(d *schema.ResourceData, meta interface{})
return fmt.Errorf("Error reading TargetTcpProxy: %s", err)
}

if err := d.Set("proxy_id", flattenComputeTargetTcpProxyProxyId(res["id"], d)); err != nil {
return fmt.Errorf("Error reading TargetTcpProxy: %s", err)
}
if err := d.Set("creation_timestamp", flattenComputeTargetTcpProxyCreationTimestamp(res["creationTimestamp"], d)); err != nil {
return fmt.Errorf("Error reading TargetTcpProxy: %s", err)
}
Expand Down Expand Up @@ -336,6 +344,16 @@ func resourceComputeTargetTcpProxyImport(d *schema.ResourceData, meta interface{
return []*schema.ResourceData{d}, nil
}

func flattenComputeTargetTcpProxyProxyId(v interface{}, d *schema.ResourceData) interface{} {
// Handles the string fixed64 format
if strVal, ok := v.(string); ok {
if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil {
return intVal
} // let terraform core handle it if we can't convert the string to an int.
}
return v
}

func flattenComputeTargetTcpProxyCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} {
return v
}
Expand Down
Loading

0 comments on commit 27c778e

Please sign in to comment.