- Newest
- Most votes
- Most comments
Hi, I see some errors in your CF YAML
You set the CoolingPeriod to 0. Per AWS documentation, the valid range for the cooling period is 2 to 183 days. If you want the default NetApp behavior, it's usually best to omit the CoolingPeriod line entirely and let the AUTO policy handle it, or set it to at least 2, see -> https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-fsx-volume-tieringpolicy.html#aws-properties-fsx-volume-tieringpolicy-properties
String vs. List: In code, the "-" before "!ImportValue" told AWS to expect an array. But the 'StorageVirtualMachineId' property requires a single "string". I think you need to code it like:
StorageVirtualMachineId: !ImportValue "svm-04c2e2830ff42097e"
As far as you already exported "svm-04c2e2830ff42097e" as Output in your former CF ... if "svm-04c2e2830ff42097e" is just the ID you simply need to handover the ID as string like:
StorageVirtualMachineId: "svm-04c2e2830ff42097e"
Size Constraint: FSx for ONTAP volumes typically require a minimum size of 1024 MiB (1 GiB). Your requested 150 MiB might trigger an "Invalid Parameter" error. Logical References: In your Outputs, you tried to !Ref things that weren't defined in the Resources section. I updated the output to return the ID of the volume you are actually creating.
Outputs:
VolumeId:
Description: "The ID of the newly created FSx Volume"
Value: !Ref AWSDemoVolume
In sum I think the following should work:
AWSTemplateFormatVersion: '2010-09-09'
Description: "Create FSx for ONTAP Volume based on existing SVM"
Resources:
AWSDemoVolume:
Type: "AWS::FSx::Volume"
Properties:
Name: "AWSBackupDemovol001"
VolumeType: "ONTAP"
OntapConfiguration:
# Pass the SVM ID directly as a string
StorageVirtualMachineId: "svm-04c2e2830ff42097e"
SizeInMegabytes: 1024 # Note: Minimum size for ONTAP volumes is usually 1024 MiB
JunctionPath: "/AWSBackupDemovol001"
StorageEfficiencyEnabled: true
TieringPolicy:
Name: "AUTO"
# CoolingPeriod is only valid for SNAPSHOT_ONLY and AUTO policies (2-183 days).
# If you want it immediate, set it to the minimum (2) or omit for default.
CoolingPeriod: 31
Tags:
- Key: "Backup_Tag"
Value: "backup"
- Key: "Created_By"
Value: "Cloud Micron"
Outputs:
VolumeId:
Description: "The ID of the newly created FSx Volume"
Value: !Ref AWSDemoVolume
There is catch in the template below where as per documentation it says clearly that it needs string thus you don't required !ImportValue here. just remove that.
Secondly, there is also another problem in the below code as you defined the CoolingPeriod: 0 which is not correct as value can not be zero either it should be minimum 2 or greater.
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 3 years ago
