Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPC Configuration: Incorrect type. Expected Aws_CF_Function #166

Open
phmasek opened this issue Nov 23, 2023 · 2 comments
Open

VPC Configuration: Incorrect type. Expected Aws_CF_Function #166

phmasek opened this issue Nov 23, 2023 · 2 comments

Comments

@phmasek
Copy link

phmasek commented Nov 23, 2023

I get an error when trying to setup the configuration for VPC.

vpc:
  subnetIds:
    - ${self:custom.mongodb.subnet_id.${self:provider.stage}} // <-- Incorrect type. Expected "CFIntrinsicFunctionBase64 | CFIntrinsicFunctionCIDR | CFIntrinsicFunctionFindInMap | CFIntrinsicFunctionGetAttribute | CFIntrinsicFunctionGetAvailabilityZones | CFIntrinsicFunctionImportValue | CFIntrinsicFunctionJoin | object(CFIntrinsicFunctionRef) | CFIntrinsicFunctionSelect | CFIntrinsicFunctionSplit | CFIntrinsicFunctionSub | CFIntrinsicFunctionCovertToJsonString".
  securityGroupIds:
    - ${self:custom.mongodb.security_group_id.${self:provider.stage}} // <-- Incorrect type. Expected "CFIntrinsicFunctionBase64 | CFIntrinsicFunctionCIDR | CFIntrinsicFunctionFindInMap | CFIntrinsicFunctionGetAttribute | CFIntrinsicFunctionGetAvailabilityZones | CFIntrinsicFunctionImportValue | CFIntrinsicFunctionJoin | object(CFIntrinsicFunctionRef) | CFIntrinsicFunctionSelect | CFIntrinsicFunctionSplit | CFIntrinsicFunctionSub | CFIntrinsicFunctionCovertToJsonString".

Official documentation only mentions using array of strings.
Not sure why these are set to expect Cloudformation functions? Is there some other way to configure this?

"AwsVpc": {
"properties": {
"securityGroupIds": {
"items": {
"$ref": "components/cf.functions.json#/Aws_CF_Function"
},
"type": "array"
},
"subnetIds": {
"items": {
"$ref": "components/cf.functions.json#/Aws_CF_Function"
},
"type": "array"
}
},
"type": "object",
"required": ["securityGroupIds", "subnetIds"]
},

@phmasek phmasek changed the title Incorrect type. Expected Aws_CF_Function VPC Configuration: Incorrect type. Expected Aws_CF_Function Nov 23, 2023
@adamghowiba
Copy link

This would be a huge help for us.

Facing this same issue, not sure how to work around it aside from just ignoring the error in the serverless.yml config.

I'm also just using an array of strings, nothing fancy

vpc:
    securityGroupIds:
      - sg-08ddc5de489de1870
    subnetIds:
      - subnet-0bd3103df9c6b72e7
      - subnet-0fda3d05946d16509
      - subnet-01ea0d8230da6b492

@phmasek
Copy link
Author

phmasek commented Mar 7, 2024

Not sure if it's helpful @adamghowiba, this is how I worked around this where the variable is a comma separated string.

image

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

No branches or pull requests

2 participants