https://pulumi.com logo
#python
Title
# python
w

worried-plastic-45846

06/23/2020, 3:39 PM
Hello, When provisioning a lambda from a zip file located in S3, and without a hash provided, pulumi will never update the layer. How can I force pulumi do delete and recreate a specific resource every time
pulumi up
runs?
f

future-barista-68134

06/23/2020, 6:46 PM
It depends.. Is the s3 bucket also being managed by Pulumi? What does the code look like?
w

worried-plastic-45846

06/24/2020, 8:06 AM
The S3 bucket is managed by another pulumi stack. What part of the code do you need ? Here's how I create the layer:
Copy code
# Create Lambda Layer
layer = lambda_.LayerVersion(
    resource_name="mylayer",
    layer_name="mylayer",
    compatible_runtimes=["python3.8"],
    description="Layer containing the dependencies for Lambda",
    s3_bucket=my_bucket_id,
    s3_key=f"{artifacts_path}/lambdalayer.zip",
)