Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Using Add-FnRef for parameter that requires an Int32 fails #66

Closed
embusalacchi opened this issue Feb 12, 2020 · 5 comments
Closed

Using Add-FnRef for parameter that requires an Int32 fails #66

embusalacchi opened this issue Feb 12, 2020 · 5 comments
Assignees
Labels

Comments

@embusalacchi
Copy link

I'm setting up an FSx cloudformation and when using the Add-FnRef to pass in the -StorageCapacity there is an error:

New-VSFSxFileSystem : Cannot process argument transformation on parameter 'StorageCapacity'. Cannot convert the "@{Ref=FileSystemSize}" value of type "Vaporshell.Function.Ref" to type "System.Int32".
At /Users/ebusalacchi/Documents/GitHub/aws/cloudformations/pti/fsx.ps1:125 char:26
-StorageCapacity (Add-FnRef -Ref "FileSystemSize") `

    (New-VSFSxFileSystem -LogicalId "FSX" `
        -DependsOn "FSxSecurityGroup","FSxKMSKey" `
        -FileSystemType "WINDOWS" `
        -KmsKeyId (Add-FnRef -Ref "FSX") `
        -StorageCapacity (Add-FnRef -Ref "FileSystemSize") `
        -SubnetIds (Add-FnImportValue -ValueToImport (Add-FnSub -String "`${VPCStackName}-PrivateSubnetAZ1")) `
        -SecurityGroupIds (Add-FnRef -Ref "FSxSecurityGroup") `
        -WindowsConfiguration @{
            ActiveDirectoryId = (Add-FnImportValue -ValueToImport (Add-FnSub -String "`${Environment}-ActiveDirectoryId"))
            ThroughputCapacity = (Add-FnRef -Ref "FileSystemThroughput")
            WeeklyMaintenanceStartTime = "1:12:30"  # Monday 07:30 ET
            DailyAutomaticBackupStartTime = "12:00" # 07:00AM ET
            AutomaticBackupRetentionDays = 30 
        }
    )

The param definition:

    (New-VaporParameter -LogicalId "FileSystemSize" `
        -Type "Number" `
        -Default 500 `
        -MinValue 300 `
        -MaxValue 65536 ),
@scrthq scrthq self-assigned this Feb 17, 2020
@scrthq scrthq added the bug label Feb 17, 2020
@scrthq
Copy link
Member

scrthq commented Feb 17, 2020

Hey @embusalacchi - Thanks for opening this up! I believe I know what the issue is, checking it out now and should hopefully have a fix for you today if it is what I believe it is. I'll keep you updated here!

scrthq added a commit that referenced this issue Feb 17, 2020
## 2.9.5 - 2020-02-17

* [Issue #66](#66)
    * Fixed: `Int`,`Double`, and `Boolean` parameters now accept CloudFormation Intrinsic Functions as parameter values.
* Miscellaneous
  * Brought Resource Type and Property Type functions up to current spec sheet.
@scrthq
Copy link
Member

scrthq commented Feb 17, 2020

Fix incoming shortly in version 2.9.5!

@scrthq
Copy link
Member

scrthq commented Feb 18, 2020

Fixed in v2.9.5! Please update and let me know if you are still having issues @embusalacchi 🙂

image

@scrthq scrthq closed this as completed Feb 18, 2020
@embusalacchi
Copy link
Author

This is fantastic - thank you for fixing this so quickly! Love the tool - it's made dealing with YAML much more tolerable.

@scrthq
Copy link
Member

scrthq commented Feb 18, 2020

I'm glad to hear!!! That's awesome :-)

Just an FYI as well - I'm ironing out the kinks to have weekly scheduled releases taking place so that the module itself stays up to date with the current CloudFormation specification sheet. Should see a lot less gap between new functionality in CloudFormation and VaporShell :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants