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 disabling lambda url cors error #229

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

qw-in
Copy link
Contributor

@qw-in qw-in commented Apr 12, 2024

Previously, disabling url.cors after it had been enabled would have no effect or throw an error, this attempts to fix that.

Reproduce:

  1. First deploy
new sst.aws.Function("Cors", {
  handler: "cors.handler",
  url: {
    cors: true,
  },
});
sst deploy
sst refresh # potentially unneeded
  1. Second deploy
new sst.aws.Function("Cors", {
  handler: "cors.handler",
  url: {
    cors: false,
  },
});
sst deploy
×  Failed
   Cors sst:aws:Function → Cors aws:lambda:FunctionUrl
   updating urn:pulumi:...::sst:aws:Function$aws:lambda/functionUrl:FunctionUrl::Cors: 1 error occurred:
   
   InvalidParameterValueException: You can't leave AllowOrigins as empty when Cors is enabled.

After this change, cors should be disabled successfully

@jayair jayair requested a review from fwang April 12, 2024 23:04
@qw-in qw-in changed the title Fix disablling lambda url cors error Fix disabling lambda url cors error Apr 15, 2024
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

Successfully merging this pull request may close these issues.

None yet

1 participant