This repository has been archived by the owner on Oct 21, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
ERROR: Parameter only accepts the following types #35
Labels
Comments
@webmin88 thanks for opening this up and including replication details! 100% makes sense and should be an easy fix, I'll try and get an updated version out by tonight! Thanks, Brandon!! |
scrthq
added a commit
that referenced
this issue
Aug 28, 2018
v2.4.1 with fix out now on PS Gallery! Confirmed fixed per above screenshot. Update when you can then let me know if all is gravy for you! |
I know it's been a few days, but I just wanted to let you know your fix worked and this issue can be closed. Thanks for the quick response. |
@webmin88 no worries!! Glad you're sorted! |
Thanks for confirming!! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'll use New-VSEC2Route as the example but I suspect the issue pervades into other Cmdlets. In parameters like -GatewayId, -NatGatewayId, etc Adding a conditional value to those parameters are rejected because they are not type System.String or VaporShell.Function. Examples below:
$subnetRoute = New-VSEC2Route -LogicalId PublicRouteAZ3 -DestinationCidrBlock 0.0.0.0/0 -GatewayId ((Add-ConIf -ConditionName GatewayTypeIsGateway -ValueIfTrue (Add-FnRef -Ref PublicRouteEndpointId) -ValueIfFalse (Add-FnRef -Ref "$_AWSNoValue"))) -RouteTableId (Add-FnRef -Ref SubnetAZ3RouteTable)
command results in:
New-VSEC2Route : This parameter only accepts the following types: System.String, Vaporshell.Function. The current types of the value are:
Vaporshell.Condition.If, Vaporshell.Condition, System.Management.Automation.PSCustomObject, System.Object.
I'd like to see the parameter accept conditional values so the resulting CloudFormation can look like:
"PublicRouteAZ3": {
"Properties": {
"DestinationCidrBlock": "0.0.0.0/0",
"RouteTableId": {"Fn::Ref": "SubnetAZ3RouteTable"},
"GatewayId": {
"Fn::If": [
"GatewayTypeIsGateway",
{"Fn:Ref": "PublicRouteEndpointId"},
{"Fn::Ref": "AWS::NoValue"}
]
}
}
}
Please let me know if I can provide any additional details.
The text was updated successfully, but these errors were encountered: