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

Lambda Function URLs #24053

Merged
merged 21 commits into from
Apr 7, 2022
Merged

Lambda Function URLs #24053

merged 21 commits into from
Apr 7, 2022

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Apr 6, 2022

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #24050.

TODO

AWS Commercial

% make testacc TESTS=TestAccLambdaFunctionURL PKG=lambda ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 2 -run='TestAccLambdaFunctionURL'  -timeout 180m
=== RUN   TestAccLambdaFunctionURLDataSource_basic
=== PAUSE TestAccLambdaFunctionURLDataSource_basic
=== RUN   TestAccLambdaFunctionURL_basic
=== PAUSE TestAccLambdaFunctionURL_basic
=== RUN   TestAccLambdaFunctionURL_Cors
=== PAUSE TestAccLambdaFunctionURL_Cors
=== RUN   TestAccLambdaFunctionURL_Alias
=== PAUSE TestAccLambdaFunctionURL_Alias
=== CONT  TestAccLambdaFunctionURLDataSource_basic
=== CONT  TestAccLambdaFunctionURL_Cors
--- PASS: TestAccLambdaFunctionURLDataSource_basic (53.51s)
=== CONT  TestAccLambdaFunctionURL_basic
--- PASS: TestAccLambdaFunctionURL_Cors (67.94s)
=== CONT  TestAccLambdaFunctionURL_Alias
--- PASS: TestAccLambdaFunctionURL_basic (38.30s)
--- PASS: TestAccLambdaFunctionURL_Alias (45.45s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	123.047s

AWS GovCloud

% make testacc TESTS=TestAccLambdaFunctionURL PKG=lambda ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 2 -run='TestAccLambdaFunctionURL'  -timeout 180m
=== RUN   TestAccLambdaFunctionURLDataSource_basic
=== PAUSE TestAccLambdaFunctionURLDataSource_basic
=== RUN   TestAccLambdaFunctionURL_basic
=== PAUSE TestAccLambdaFunctionURL_basic
=== RUN   TestAccLambdaFunctionURL_Cors
=== PAUSE TestAccLambdaFunctionURL_Cors
=== RUN   TestAccLambdaFunctionURL_Alias
=== PAUSE TestAccLambdaFunctionURL_Alias
=== CONT  TestAccLambdaFunctionURLDataSource_basic
=== CONT  TestAccLambdaFunctionURL_Cors
=== CONT  TestAccLambdaFunctionURLDataSource_basic
    function_url_test.go:21: Lambda Function URLs are not supported in aws-us-gov partition
--- SKIP: TestAccLambdaFunctionURLDataSource_basic (1.84s)
=== CONT  TestAccLambdaFunctionURL_Cors
    function_url_test.go:21: Lambda Function URLs are not supported in aws-us-gov partition
=== CONT  TestAccLambdaFunctionURL_Alias
--- SKIP: TestAccLambdaFunctionURL_Cors (1.84s)
=== CONT  TestAccLambdaFunctionURL_basic
=== CONT  TestAccLambdaFunctionURL_Alias
    function_url_test.go:21: Lambda Function URLs are not supported in aws-us-gov partition
=== CONT  TestAccLambdaFunctionURL_basic
    function_url_test.go:21: Lambda Function URLs are not supported in aws-us-gov partition
--- SKIP: TestAccLambdaFunctionURL_Alias (0.00s)
--- SKIP: TestAccLambdaFunctionURL_basic (0.00s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	9.231s

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/lambda Issues and PRs that pertain to the lambda service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 6, 2022
@ewbankkit ewbankkit changed the title Lambda Function URLs [WIP] Lambda Function URLs Apr 6, 2022
@ewbankkit ewbankkit marked this pull request as ready for review April 6, 2022 21:03
@ewbankkit ewbankkit changed the title [WIP] Lambda Function URLs Lambda Function URLs Apr 7, 2022
@ewbankkit
Copy link
Contributor Author

@bnusunny Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit b5be582 into main Apr 7, 2022
@ewbankkit ewbankkit deleted the f-aws_lambda_function_url branch April 7, 2022 16:01
@github-actions github-actions bot added this to the v4.9.0 milestone Apr 7, 2022
github-actions bot pushed a commit that referenced this pull request Apr 7, 2022
@github-actions
Copy link

github-actions bot commented Apr 7, 2022

This functionality has been released in v4.9.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@guanzo
Copy link

guanzo commented Apr 7, 2022

From announcement to PR to release in 24 hours. Amazing. Helps that weekly releases are on Thursday too!

Edit: I'm getting this error message but the url creation still succeeds. Tried a few cycles of delete/create and it's consistent.

│ Error: error adding Lambda Function URL (saturn-staging-log-ingestor) permission ResourceConflictException: The statement id (FunctionURLAllowPublicAccess) provided already exists. Please provide a new statement id, or remove the existing statement.
│ {
│   RespMetadata: {
│     StatusCode: 409,
│     RequestID: "9a532815-6b03-48f7-8a64-a1bc08b0e1e7"
│   },
│   Message_: "The statement id (FunctionURLAllowPublicAccess) provided already exists. Please provide a new statement id, or remove the existing statement.",
│   Type: "User"
│ }
│
│   with aws_lambda_function_url.log_ingestor,
│   on lambda.tf line 40, in resource "aws_lambda_function_url" "log_ingestor":
│   40: resource "aws_lambda_function_url" "log_ingestor" {
resource "aws_lambda_function_url" "log_ingestor" {
  function_name      = aws_lambda_function.log_ingestor.function_name
  authorization_type = "NONE"

  cors {
    allow_credentials = true
    allow_origins     = ["*"]
    allow_methods     = ["POST"]
    max_age           = 86400
  }
}

@bnusunny
Copy link
Contributor

bnusunny commented Apr 8, 2022

@guanzo I couldn't reproduce your issue. Could you please open an issue if you still see this problem?

@guanzo
Copy link

guanzo commented Apr 8, 2022

@bnusunny I manually deleted the statement, after that I couldn't reproduce anymore. 🤷

@github-actions
Copy link

github-actions bot commented May 9, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/lambda Issues and PRs that pertain to the lambda service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New feature: Lambda Function URLs
4 participants