Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about metadata startup script import #1112

Merged
merged 1 commit into from
Sep 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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