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

fix(Config Schema): Expand allowable types for vpc config #8283

Merged
merged 1 commit into from Sep 24, 2020
Merged

fix(Config Schema): Expand allowable types for vpc config #8283

merged 1 commit into from Sep 24, 2020

Conversation

devpow112
Copy link
Contributor

@devpow112 devpow112 commented Sep 24, 2020

This enables the use of Ref, Fn::Join, Fn::Sub , Fn::Import and Fn::GetAtt when defining the vpc.subnetIds and vpc.securityGroupIds

Closes: #8282

@devpow112
Copy link
Contributor Author

devpow112 commented Sep 24, 2020

I didn't include Fn::GetAtt as it did not look to be a valid use case for the vpc config portion.

Added Fn::GetAtt see #8283 (comment)

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2020

Codecov Report

Merging #8283 into master will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8283      +/-   ##
==========================================
- Coverage   88.19%   88.18%   -0.01%     
==========================================
  Files         250      250              
  Lines        9400     9398       -2     
==========================================
- Hits         8290     8288       -2     
  Misses       1110     1110              
Impacted Files Coverage Δ
lib/plugins/aws/provider/awsProvider.js 93.18% <ø> (ø)
lib/plugins/aws/utils/findReferences.js 100.00% <0.00%> (ø)
...aws/package/compile/events/alexaSmartHome/index.js 100.00% <0.00%> (ø)
lib/classes/PluginManager.js 96.56% <0.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2fdeb51...a86529b. Read the comment docs.

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devpow112 great thanks for that! Still I proposed simpler approach, let me know what you think

Comment on lines 274 to 282
awsLambdaVpcConfigItems: {
oneOf: [
{ type: 'string' },
{ $ref: '#/definitions/awsCfRef' },
{ $ref: '#/definitions/awsCfJoin' },
{ $ref: '#/definitions/awsCfSub' },
{ $ref: '#/definitions/awsCfImport' },
],
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically it differs from awsCfInstruction, only by fact of not including support for Fn::GetAtt, it feels dubious and it doesn't feel as VPC config specific.

I think maintaince wise it'll be better to just rely on awsCfInstruction, also I think we can't be 100% sure, that there's no use case, where Fn::GetAtt can be used for VPC resolution (although I agree, it feels unlikely)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I'll switch it to use the awsCfInstruction

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in a86529b

This enables the use of Ref, Fn::Join, Fn::Sub, Fn::Import and Fn::GetAtt when
defining the vpc.subnetIds and vpc.securityGroupIds.
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @devpow112 !

@medikoo medikoo merged commit e75e998 into serverless:master Sep 24, 2020
@devpow112 devpow112 deleted the depowell/fix-config-schema-vpc-config branch September 24, 2020 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vpc.securityGroupIds and vpc.subnetIds only allow string, warn on Ref
3 participants