You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

创建AWS FSx for NetApp ONTAP卷时CloudFormation属性验证失败

问题排查与修复方案

核心错误原因

报错提示OntapConfiguration属性类型不匹配,是因为你把这个属性写成了数组(加了-符号),但AWS CloudFormation要求OntapConfiguration必须是对象类型,不能用数组符号。

另外还有两个次要问题也会导致执行失败:

  • 两个卷资源的逻辑ID重复(都叫VolumeName),CloudFormation要求每个资源必须有唯一的逻辑名称
  • Volume2Size的描述写错了,写成了“第一个卷的大小”,容易混淆;且它的默认值用了字符串'100',和参数类型Number不匹配

修复后的完整模板

---
AWSTemplateFormatVersion: "2010-09-09"
Description: "AWS CloudFormation to create multiple ONTAP volumes."

Parameters:
  VolumeName1:
    Type: String
    Description: 'The name of the first volume.'
    Default: 'testVol001'
  Volume1Size:
    Description: 'The size of the first volume.'
    Type: Number
    Default: 100
  VolumeName2:
    Type: String
    Description: 'The name of the second volume.'
    Default: 'testVol002'
  Volume2Size:
    Description: 'The size of the second volume.'
    Type: Number
    Default: 100
  SVMName:
    Type: String
    Description: 'Provide the name of the Storage Virtual Machine'
    Default: 'svm-0524816479dbbe473'
  FSxVolType:
    Type: String
    Description: 'FSx Volume Type'
    Default: 'ONTAP'
    
Resources:
  Volume1:
    Type: "AWS::FSx::Volume"
    Properties:
      Name: !Ref VolumeName1
      OntapConfiguration:
        JunctionPath: !Ref VolumeName1
        SizeInMegabytes: !Ref Volume1Size
        StorageEfficiencyEnabled: true
        StorageVirtualMachineId: !Ref SVMName
        VolumeType: !Ref FSxVolType
      Tags:
      - Key: "archival"
        Value: "backup"
        
  Volume2:
    Type: "AWS::FSx::Volume"
    Properties:
      Name: !Ref VolumeName2
      OntapConfiguration:
        JunctionPath: !Ref VolumeName2
        SizeInMegabytes: !Ref Volume2Size
        StorageEfficiencyEnabled: true
        StorageVirtualMachineId: !Ref SVMName
        VolumeType: !Ref FSxVolType
      Tags:
      - Key: "archival"
        Value: "backup"

关键修复点说明

  • 移除了OntapConfiguration下的-符号,把它从数组改成对象格式,符合CloudFormation对该属性的类型要求
  • 将两个卷资源的逻辑ID分别改为Volume1和Volume2,确保唯一性
  • 修正了Volume2Size的描述文本,并把默认值从字符串'100'改为数字100,和参数类型保持一致
  • 调整了Description的格式,去掉了多余的嵌套标签

内容的提问来源于stack exchange,提问作者micron cloud

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.24 04:24:46