-
Notifications
You must be signed in to change notification settings - Fork 4k
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
chore(lambda): resolve unable to reference AuthType from FunctionUrl #31590
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
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 for your PR! I've added only a small comment.
if (fnUrl.authType === lambda.FunctionUrlAuthType.NONE) { | ||
; // ok | ||
} else { | ||
throw new Error('AuthType must be NONE'); | ||
} |
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.
I think it is better to use jest expect()
.
if (fnUrl.authType === lambda.FunctionUrlAuthType.NONE) { | |
; // ok | |
} else { | |
throw new Error('AuthType must be NONE'); | |
} | |
expect(fnUrl.authType).toBe(lambda.FunctionUrlAuthType.NONE); |
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.
Agreed. Also, I believe this PR should be a fix
not a chore
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.
Since there is no change in the resource being created, I don't think this fix needs an integ test, but if the maintainer thinks it does, I'll change it to a fix.
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.
Thanks!
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.
Thanks @watany-dev for the contribution. Overall LGTM.
Just to make sure this change doesn't break anything, could you please rerun the existing integ test and try to deploy the stack manually and make sure the template is deploying successfully. Also validate if there is any change in the snapshot required. I hope it doesn't.
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
I reran the integration test and confirmed it was successful. Since the test contents haven't changed, I reverted the fix back to chore. |
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.
Not sure why the difference in this feature_flag file is shown here. Could we remove this as i hope it is not related to this change?
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.
sorry. reverted.
Please add a comment to request for exemption of integ test with justification. |
Thanks for confirming. Also please update in the |
@godwingrs22 |
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.
Thanks @watany-dev for the contribution.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Reason for this change
I will resolve this issue: #31339 (comment). In the current FunctionURL implementation, there is no way to access AuthType, and therefore, when writing logic that depends on AuthType, there is no method to reference it.
Description of changes
I will fix the construct to allow access to functionurl.AuthType
Description of how you validated changes
adding unittest and integ-test re-run.
Reason for Exemption:
The fix introduces no changes to the resources being created.
Clarification Request:
This fix only makes the internal property authType of the L2 Construct publicly accessible, and does not introduce any differences in the created resources.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license