Google Deployment Manager - Deploying a VPN (Forwarding Rule Problems)

485 views
Skip to first unread message

Charles Moore

unread,
Jan 5, 2016, 7:38:25 PM1/5/16
to gce-discussion
Hello,

Help here would be much appreciated, this is something I have been struggling with for awhile. I am trying to deploy a VPN using the Google Deployment Manager. From what I understand I need the following:

  • VpnTargetGateway
  • ForwardingRules
  • VpnTunnels
  • ReservedIP
I am having trouble with the ForwardingRules. This is where I specific my already created reserved IP address and assign it to my target gateway. Here is my code:

resources:
  - name: vmx-forwarding-rules
    type: compute.v1.forwardingRule
    properties:
      region: us-central1
      IPAddress: https://www.googleapis.com/compute/v1/projects/{{ env["project"] }/regions/us-central1/addresses/vmx-ip
      IPProtocol: "ESP"
      target: https://www.googleapis.com/compute/v1/projects/{{ env["project"] }/regions/us-central1/targetVpnGateways/vmx-vpn-gateway

Here is the error I receive:

 message: u"Unexpected response from resource of type compute.v1.forwardingRule: 400 {statusMessage=Bad Request, errors=[{message=Invalid value for field 'resource': ''.  A reserved IP should be specified for forwarding rule with target type TARGET_VPN_GATEWAY, domain=global, reason=invalid}]}">]>

Does anyone have any experience with this or know a better location to find help for Deployment Manager?

Thanks,

Charles

Kamran (Google Cloud Support)

unread,
Jan 6, 2016, 8:19:58 PM1/6/16
to gce-discussion

Hello Charles,

In order to create ForwardingRules, for IPAddress property specify the value as the following format:

IPAddress: 1.2.3.4

Where 1.2.3.4 is your static IP address.

Sincerely,

Charles Moore

unread,
Jan 7, 2016, 12:34:53 PM1/7/16
to gce-discussion
Hey Kamran,

The problem is that when I deploy a reserved IP address with Google Deployment Manager I will not know what the ip is unless I go into the developer console.

Kamran (Google Cloud Support)

unread,
Jan 7, 2016, 9:34:30 PM1/7/16
to gce-dis...@googlegroups.com

Hey Charles,

Let me know if this resolves your deployment issue?


resources:
- name: vmx-ip
  type: compute.v1.address
  properties:
    region: us-central1

- name: vmx-forwarding-rules
  type: compute.v1.forwardingRule
  properties:
    region: us-central1
    IPAddress: $(ref.vmx-ip.address)
    IPProtocol: "ESP"
    target: https://www.googleapis.com/compute/v1/projects/{{ env["project"] }}/regions/us-central1/targetVpnGateways/vmx-vpn-gateway



Sincerely,

Charles Moore

unread,
Jan 8, 2016, 5:08:43 PM1/8/16
to gce-discussion
Hey Kamran,

That did not work either, here is the error I receive now.

ERROR: (gcloud.deployment-manager.deployments.update) Error in Operation operation-1452290719752-528d9c8761f40-f707e0f5-553591ea: <ErrorValue
 errors: [<ErrorsValueListEntry
 code: u'CONDITION_NOT_MET'
 message: u'Referenced resource vmx-ip could not be found. At resource vmx-forwarding-esp.'>]>

Thanks for the help.

Charles

Kamran (Google Cloud Support)

unread,
Jan 9, 2016, 2:43:05 PM1/9/16
to gce-dis...@googlegroups.com

Charles,

You will need to define your static IP resources (vmx-ip) in the same YAML file which forwarding rule resources are specified, otherwise it won't find the reference to the IP resource (see the example in my last post).

You can also open a feature request on Compute Engine public issue tracker, if in future you prefer to define IPAddress parameters in the following format: 
IPAddress : https://www.googleapis.com/compute/v1/projects/{{ env["project"] }}/regions/us-central1/addresses/vmx-ip

Sincerely,

Charles Moore

unread,
Jan 11, 2016, 1:57:13 PM1/11/16
to gce-discussion
Thanks for the help Kamran, missed that you put the two in the same file there. I have it working now.
Reply all
Reply to author
Forward
0 new messages