pulumi / pulumi-aws

An Amazon Web Services (AWS) Pulumi resource package, providing multi-language access to AWS
Apache License 2.0
459 stars 155 forks source link

PATCH 0044-Allow-creating-lambdas-without-code-related-properti.patch #3724

Open t0yv0 opened 6 months ago

t0yv0 commented 6 months ago

Reverts a bridge bug temporarily.

t0yv0 commented 4 months ago

Per https://github.com/pulumi/pulumi-aws/pull/3959 this creates friction in routine upstrem upgrades. Digging up some more information here.

t0yv0 commented 4 months ago

This has the back-history here: https://github.com/pulumi/pulumi-aws/pull/3420

When importing lambdas, we run afoul of ExactlyOneOf due to a bridge issue, so the patch replaces that with ConflictsWith.

t0yv0 commented 4 months ago

It looks really like a good example of https://github.com/pulumi/pulumi-terraform-bridge/issues/1949

This is harder to automatically fix in the bridge.. It is indeed something that needs lambda-specific thought. We cannot plausibly manufacture a value here:

│ Error: Invalid combination of arguments
│
│   with aws_lambda_function.test_lambda,
│   on generated.tf line 4:
│   (source code not available)
│
│ "filename": one of `filename,image_uri,s3_bucket` must be specified
╵
╷
│ Error: Invalid combination of arguments
│
│   with aws_lambda_function.test_lambda,
│   on generated.tf line 7:
│   (source code not available)
│
│ "image_uri": one of `filename,image_uri,s3_bucket` must be specified
╵
╷
│ Error: Invalid combination of arguments
│
│   with aws_lambda_function.test_lambda,
│   on generated.tf line 16:
│   (source code not available)
│
│ "s3_bucket": one of `filename,image_uri,s3_bucket` must be specified

I think once we figure out a good answer to https://github.com/pulumi/pulumi-aws/issues/3376 we can also revisit this patch.

VenelinMartinov commented 4 months ago

Two regression tests which are relevant here: TestSourceCodeHashImportedLambdaChecksCleanly and TestUpdateImportedLambda