Cloudformation AWS:使用参数将IP地址分配给CustomerGateway

问题描述 投票:0回答:1

我正在设计cloudformation模板,但是我需要将源IP定义为参数

我试图将参数定义为字符串,但是会产生以下错误:

Value (${MyCustomerGateway}) for parameter ipAddress is invalid. Invalid Format. (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterValue; Request ID: 4de02112-fb1f-47a1-931c-97727568df99)

这是模板的片段:

Parameters:
  MyCustomerGateway:
    Description: IpAddress.
    Default: 0.0.0.0
    Type: String  

Resources:
  CustomerGateway_1:
    Type: 'AWS::EC2::CustomerGateway'
    Properties:
      Type: ipsec.1
      BgpAsn: 3352
      IpAddress: ${MyCustomerGateway} 
      Tags:
        - Key: Name
          Value: CustomerGateway_1

IP转换是否有特殊数据?

我不确定哪种方法正确

amazon-web-services amazon-ec2 amazon-cloudformation ip-address ipsec
1个回答
0
投票

IpAddress: ${MyCustomerGateway}更改为IpAddress: !Ref myCustomerGateway

© www.soinside.com 2019 - 2024. All rights reserved.