-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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): validate resourcePolicy is array #8051
fix(Config Schema): validate resourcePolicy is array #8051
Conversation
I don't love that the test takes so long to run but I don't know a faster way to do it; based on tests in #7335. If there is a better way to test this I'd be happy to make the change. |
Codecov Report
@@ Coverage Diff @@
## master #8051 +/- ##
==========================================
+ Coverage 88.36% 88.37% +0.01%
==========================================
Files 248 248
Lines 9446 9446
==========================================
+ Hits 8347 8348 +1
+ Misses 1099 1098 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@glb Great thanks for that!
Still please see my comment about testing, I think value of such tests is neglible, while maintanance cost becomes significant
e63a48c
to
954a060
Compare
In the AWS provider, the `resourcePolicy` must be an array. If you paste a resource policy from the console, your stack will fail to create.
954a060
to
f8c1f28
Compare
Thanks @medikoo ! I have updated, rebased, and done manual testing with invalid and valid values for serverless.ymlservice: test
provider:
name: aws
resourcePolicy:
- test Output: Serverless: Configuration error at 'provider.resourcePolicy[0]': should be object serverless.ymlservice: test
provider:
name: aws
resourcePolicy: {} Output: Serverless: Configuration error at 'provider.resourcePolicy': should be array serverless.ymlservice: test
provider:
name: aws
resourcePolicy:
- Effect: Allow
Principal: "*"
Action: "*"
Resource: "*" Output: no error (though arguably that's a terrible resource policy. 😆 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @glb !
In the AWS provider, the
resourcePolicy
must be an array. If you paste a resource policy from the console, your stack will fail to create.Closes: #7795
Addresses: #8018