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

Detect changes to zipFile/code before deployment (aws.synthetics.Canary) #2022

Open nimbinatus opened 2 years ago

nimbinatus commented 2 years ago

Original question:

The aws.synthetics.Canary resource has an optional called zipFile that takes the code from a local path and deploys it. Can Pulumi detect changes to the code and deploy them as part of pulumi up?

Answer:

We typically mark input properties like this as accepting a Pulumi Archive, which is a handle to file contents which can natively handle identifying changes and triggering updates only when changes are present. We do this for aws.lambda.Function for example. We likely should do the same here. Likely worth opening and issue (or a PR!) for this. See https://github.com/pulumi/pulumi-aws/blob/master/provider/resources.go#L1788 for an example of how this is done for another resource.

Originally posted by @lukehoban in https://github.com/pulumi/pulumi/discussions/7683#discussioncomment-1089478

mikhailshilkov commented 2 years ago

@nimbinatus thank you for filing the issue. May I ask you for the next time to either use one of the existing issue templates, or mark your new issues with the needs-triage label? Unlabelled issues from Pulumians aren't currently highlighted in our triage queue. Thank you!

nimbinatus commented 2 years ago

I'll keep that in mind, but perhaps we need to find a way to update the Discussions system because this was an auto-created issue when I opened it via the Discussions UI?

mikhailshilkov commented 2 years ago

That's a great point, thank you for sharing! We should probably prioritize https://github.com/pulumi/home/issues/2157

stack72 commented 2 years ago

@nimbinatus are you asking for the ability to do what lambda does and pass in an asset rather than a path to the zip? or are you hoping for the ability to set either?