Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon cloudformation 当存储类型为io1时在cloudformation中使用Iops属性,当存储类型为gp2时不使用Iops属性_Amazon Cloudformation_Rds - Fatal编程技术网

Amazon cloudformation 当存储类型为io1时在cloudformation中使用Iops属性,当存储类型为gp2时不使用Iops属性

Amazon cloudformation 当存储类型为io1时在cloudformation中使用Iops属性,当存储类型为gp2时不使用Iops属性,amazon-cloudformation,rds,Amazon Cloudformation,Rds,我创建了一个模板来使用Cloudformation配置RDS。创建RDS时,我们有两个选项io1和gp2。使用gp2时,我们不需要定义iops,但使用io1时,我们需要定义iops。 我可以使用io1,但gp2显示错误:- 遇到属性Iops的非数字值 我的模板片段 StorageType: Description: choose the storage type gp2 for 'General purpose SSD' & io1 for 'IOPS SSD'.

我创建了一个模板来使用Cloudformation配置RDS。创建RDS时,我们有两个选项io1和gp2。使用gp2时,我们不需要定义iops,但使用io1时,我们需要定义iops。 我可以使用io1,但gp2显示错误:-

遇到属性Iops的非数字值

我的模板片段

  StorageType:

    Description: choose the storage type gp2 for 'General purpose SSD' & io1 for 'IOPS SSD'. 

    Default: "gp2"

    Type: String

    AllowedValues: ["gp2","io1"]

  Conditions:

      iops: !Equals [!Ref StorageType, "io1"]

      gp2: !Equals [!Ref StorageType, "gp2"]

提前感谢

正确的语法是:

Iops: !If [iops, !Ref iops, !Ref "AWS::NoValue"]
文件:

Iops: !If [iops, !Ref iops, !Ref "AWS::NoValue"]