gpt4 book ai didi

amazon-web-services - ONTAP 卷创建的 aws 属性验证失败

转载 作者:行者123 更新时间:2023-12-03 07:30:15 24 4
gpt4 key购买 nike

我正在尝试通过 Cloudformation 创建 AWS FSxN(ONTAP) 卷,在执行模板 stack 时我也会使用 Parameters失败并出现如下错误。

作为一个新手,我无法捕获这个问题,任何帮助或提示将不胜感激。

模板如下:

---
AWSTemplateFormatVersion: "2010-09-09"
Description: >
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:
Type: Number
Description: 'The size of the first volume.'
Default: '100'
SVMName:
Type: String
Description: 'Provide the name of the backup-plan'
Default: 'svm-0524816479dbbe473'
FSxVolType:
Type: String
Description: 'FSx Volume Type'
Default: 'ONTAP'

Resources:
VolumeName:
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"

VolumeName:
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"
...

错误:

2022-08-03 21:52:24 UTC+0530    VolumeName  CREATE_FAILED   Property validation failure: [Value of property {/OntapConfiguration} does not match type {Object}]

最佳答案

您应该尝试使用替换!Sub来替换您需要指定模板参数名称的模板中的ParameterVariable 资源逻辑 ID,例如使用 clode 花括号和美元符号 ${},您还需要更正缩进 > 并删除 -

更多信息可以在 AWS 文档 AWS Sub 中找到。

请尝试下面的工作...

---
Description: "This is Cloudformation template for Creating Multiple Volumes While using parameters."
Parameters:
FSxSVMiD:
Default: svm-0524816479dbbe473
Description: "Provide the SVM Name for FSxN"
Type: String
FSxVolType:
Default: 'ONTAP'
Type: String
FSxVolume01:
Default: DemoFSxVolume01
Description: "This is First Volume in the template Selection"
Type: String
FSxVolume02:
Default: DemoFsxVolume02
Description: "This is Second Volume in the template Selection"
Type: String
FSxVolumeSize:
Default: 1024
Type: Number
Resources:
AWSDemoVolume1:
Description: "This is a Demo Volume resource"
Type: 'AWS::FSx::Volume'
Properties:
Name: !Ref FSxVolume01
OntapConfiguration:
JunctionPath: !Sub "/${FSxVolume01}"
SizeInMegabytes: !Ref FSxVolumeSize
StorageEfficiencyEnabled: true
StorageVirtualMachineId: !Ref FSxSVMiD
VolumeType: !Ref FSxVolType
Tags:
- Key: "backup"
Value: "archival"
AWSDemoVolume2:
Description: "This is a Demo Volume resource"
Type: 'AWS::FSx::Volume'
Properties:
Name: !Ref FSxVolume02
OntapConfiguration:
JunctionPath: !Sub "/${FSxVolume02}"
SizeInMegabytes: !Ref FSxVolumeSize
StorageEfficiencyEnabled: true
StorageVirtualMachineId: !Ref FSxSVMiD
VolumeType: !Ref FSxVolType
Tags:
- Key: "backup"
Value: "archival"

关于amazon-web-services - ONTAP 卷创建的 aws 属性验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73224987/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com