1
votes

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 specify 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

1

1 Answers

0
votes

Try this in your YAML configuration:

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