Google部署管理器 - 转发规则(错误)

时间:2016-01-06 23:30:24

标签: google-compute-engine google-cloud-platform

这里的帮助将非常感激,这是我一直在努力的事情。我正在尝试使用Google Deployment Manager部署VPN。据我所知,我需要以下内容:

VpnTargetGateway
ForwardingRules
VpnTunnels
ReservedIP

我在使用ForwardingRules时遇到了麻烦。这是我指定已创建的保留IP地址并将其分配给目标网关的地方。这是我的代码:

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

以下是我收到的错误:

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}]}">]>

有没有人有这方面的经验或知道更好的位置来寻求Deployment Manager的帮助?

由于

1 个答案:

答案 0 :(得分:1)

在YAML配置中尝试此操作:

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