Fix Version Latest Lambda Code#106
Conversation
|
@greptile |
Greptile SummaryThis PR fixes stale Lambda code for customer stacks deployed with
Confidence Score: 5/5Safe to merge. The sed rewrite is correctly scoped to the literal The core mechanism — single-quoted sed pattern inside the Makefile recipe — correctly passes the literal string No files require special attention. Important Files Changed
Reviews (5): Last reviewed commit: "some minor make updates" | Re-trigger Greptile |
qiuz-cz
left a comment
There was a problem hiding this comment.
Looked over with @khill2018 LGTM
Description of the change
Fixes CP-41833. Customer stacks deployed with
Version=latestwere running with frozen Lambda code because CloudFormation comparesCodeUrias a string andlatest/services/discovery.zipnever changed across releases. Template changes that referenced new Lambda response attributes (e.g.BillingReportFormatfrom CP-40732) then failed customerupdate-stackwithVendor response doesn't contain <attr> attributeand rolled back.What changed
Makefile (
copy-to-s3) — All text files (CFN templates, SAM app templates, IAM policy JSON) are now piped throughsed 's|${Version}|v1.0.<N>|g'before upload, where<N>is the current build's git rev count; zip files are copied unchanged. The deploy target uploads to both the versioned path (v1.0.<N>/) andlatest/. Both copies have the semver baked into${Version}references — versioned was already path-locked to that semver, so its resolved CodeUri is identical; the load-bearing change is thatlatest/now points at versioned S3 paths for inner templates and Lambda zips, so the resolved CodeUri Key differs each release and CFN refreshes the Lambda.services/discovery/template.yamlandservices/connected_account{,_dev}.yaml—Versionproperties on theCustom::DiscoveryandCustom::NotifyCloudZeroresources changed from hardcoded literals ('20230523'and'1') to!Sub ${Version}, which sed then resolves at build time. All three files retain theirVersionCFN parameter with defaultlatest, so the source templates remain valid for direct stack deploys as well.