Skip to content

Commit

Permalink
Add note about metadata startup script import (hashicorp#1112)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and rileykarson committed Sep 3, 2019
1 parent 48060e6 commit d2287e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions google-beta/resource_compute_vpn_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func resourceComputeVpnGatewayRead(d *schema.ResourceData, meta interface{}) err
if err := d.Set("name", flattenComputeVpnGatewayName(res["name"], d)); err != nil {
return fmt.Errorf("Error reading VpnGateway: %s", err)
}
if err := d.Set("gateway_id", flattenComputeVpnGatewayGateway_id(res["id"], d)); err != nil {
if err := d.Set("gateway_id", flattenComputeVpnGatewayGatewayId(res["id"], d)); err != nil {
return fmt.Errorf("Error reading VpnGateway: %s", err)
}
if err := d.Set("network", flattenComputeVpnGatewayNetwork(res["network"], d)); err != nil {
Expand Down Expand Up @@ -276,7 +276,7 @@ func flattenComputeVpnGatewayName(v interface{}, d *schema.ResourceData) interfa
return v
}

func flattenComputeVpnGatewayGateway_id(v interface{}, d *schema.ResourceData) interface{} {
func flattenComputeVpnGatewayGatewayId(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 {
Expand Down
4 changes: 2 additions & 2 deletions google-beta/resource_compute_vpn_tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func resourceComputeVpnTunnelRead(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error reading VpnTunnel: %s", err)
}

if err := d.Set("tunnel_id", flattenComputeVpnTunnelTunnel_id(res["id"], d)); err != nil {
if err := d.Set("tunnel_id", flattenComputeVpnTunnelTunnelId(res["id"], d)); err != nil {
return fmt.Errorf("Error reading VpnTunnel: %s", err)
}
if err := d.Set("creation_timestamp", flattenComputeVpnTunnelCreationTimestamp(res["creationTimestamp"], d)); err != nil {
Expand Down Expand Up @@ -683,7 +683,7 @@ func resourceComputeVpnTunnelImport(d *schema.ResourceData, meta interface{}) ([
return []*schema.ResourceData{d}, nil
}

func flattenComputeVpnTunnelTunnel_id(v interface{}, d *schema.ResourceData) interface{} {
func flattenComputeVpnTunnelTunnelId(v interface{}, d *schema.ResourceData) interface{} {
return v
}

Expand Down
4 changes: 4 additions & 0 deletions website/docs/r/compute_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ The following arguments are supported:
within the instance. Ssh keys attached in the Cloud Console will be removed.
Add them to your config in order to keep them attached to your instance.

-> On import, `metadata_startup_script` will be set while
`metadata.startup-script` will not be. You'll need to match
`metadata_startup_script` to your `startup-script` value.

* `metadata_startup_script` - (Optional) An alternative to using the
startup-script metadata key, except this one forces the instance to be
recreated (thus re-running the script) if it is changed. This replaces the
Expand Down

0 comments on commit d2287e9

Please sign in to comment.