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

ERROR: Parameter only accepts the following types #35

Closed
webmin88 opened this issue Aug 28, 2018 · 5 comments
Closed

ERROR: Parameter only accepts the following types #35

webmin88 opened this issue Aug 28, 2018 · 5 comments
Assignees
Labels

Comments

@webmin88
Copy link

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.

@scrthq
Copy link
Member

scrthq commented Aug 28, 2018

@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 scrthq self-assigned this Aug 28, 2018
@scrthq scrthq added the bug label Aug 28, 2018
scrthq added a commit that referenced this issue Aug 28, 2018
scrthq added a commit that referenced this issue Aug 28, 2018
## 2.4.1

- Added `Vaporshell.Condition` to the acceptible types for standard resource parameters ([Issue #35](#35))
@scrthq
Copy link
Member

scrthq commented Aug 28, 2018

image

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!

@scrthq scrthq closed this as completed Aug 28, 2018
@webmin88
Copy link
Author

webmin88 commented Sep 2, 2018

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.

@scrthq
Copy link
Member

scrthq commented Sep 2, 2018

@webmin88 no worries!! Glad you're sorted!

@scrthq
Copy link
Member

scrthq commented Sep 2, 2018

Thanks for confirming!!

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