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(AWS API Gateway): Support Fn::Split for vpcEndpointIds schema #9455

Merged
merged 1 commit into from May 11, 2021

Conversation

pgrzesik
Copy link
Contributor

Closes: #9453

@codecov
Copy link

codecov bot commented May 10, 2021

Codecov Report

Merging #9455 (ab04b36) into master (7361e04) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9455      +/-   ##
==========================================
+ Coverage   86.89%   86.91%   +0.02%     
==========================================
  Files         321      321              
  Lines       11980    11987       +7     
==========================================
+ Hits        10410    10419       +9     
+ Misses       1570     1568       -2     
Impacted Files Coverage Δ
lib/plugins/aws/provider.js 93.75% <ø> (ø)
lib/cli/handle-error.js 88.88% <0.00%> (ø)
lib/cli/resolve-local-serverless-path.js 100.00% <0.00%> (ø)
scripts/serverless.js 49.80% <0.00%> (+0.19%) ⬆️
lib/utils/telemetry/generatePayload.js 93.54% <0.00%> (+0.44%) ⬆️
lib/Serverless.js 91.51% <0.00%> (+0.66%) ⬆️

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 7361e04...ab04b36. Read the comment docs.

@pgrzesik pgrzesik requested a review from medikoo May 10, 2021 18:41
type: 'array',
items: { $ref: '#/definitions/awsCfInstruction' },
},
{ $ref: '#/definitions/awsCfSplit' },
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not include awsCfSplit as part of AWS CF instructions set?

Copy link
Contributor Author

@pgrzesik pgrzesik May 11, 2021

Choose a reason for hiding this comment

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

I was thinking about it, but to be honest, awsCfInstruction is a little bit different as in most cases the supported functions resolve to a single identifier, where the Fn::Split produces an array/list of identifiers/values. For example, in this case we don't want to accept Fn::Split as an item in array because that would result in invalid value for the VpcEndpointIds property (item in an array would become a nested array after Fn::Split)

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, yes it makes sense then to not include it.

But now I wonder whether it'll not be wise to introduce something as awsCfArrayInstruction that will be an alias to above.

As that construct feels pretty generic and having that, we may agree to use it for every array property where we allow CF intrinsic functions.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On a second though, the current awsCfInstruction might be a bit misleading as it doesn't include Fn::Split, which is also a cfInstruction, but it's often not supported in the same places as the current definitions in cfInstruction - maybe we could rename the awsCfInstruction to awsCfInstructionSingleResult to be more explicit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I was writing the above comment without seeing your response - I like the proposed idea 👍 I think it will be useful as I think we might have a few other places where we don't support Fn::Split by omission in schema

@pgrzesik pgrzesik force-pushed the fix-vpc-endpoints-ids-split-syntax branch from 81f0aa1 to ab04b36 Compare May 11, 2021 07:32
@pgrzesik pgrzesik requested a review from medikoo May 11, 2021 07:44
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.

Looks great 👍

@pgrzesik pgrzesik merged commit 56f8587 into master May 11, 2021
@pgrzesik pgrzesik deleted the fix-vpc-endpoints-ids-split-syntax branch May 11, 2021 07:47
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.

Fn::Split : vpcEndpointIds should be an array
2 participants