copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

How to migrate resources created with the old copilot version

Open rhoboro opened this issue 4 years ago • 4 comments

I am running an application and pipeline that I created with copilot-1.0.0. I need to upgrade the Node.js version of lambda from v10 to v12, how do I do that? I couldn't find any documentation on migration and found this issue #2235 , but I'm not using copilot deploy because I don't do manual operations.

copilot is a great tool and I want to use it in the future. It would be nice to have some documentation for migration.

rhoboro avatar May 21 '21 06:05 rhoboro

Hi @rhoboro !

Sorry this is not well documented 🙇 We need to update your buildspec.yml so that you can migrate your Lambda runtimes to nodejsv12.

  1. Can you download the latest version of copilot
  2. Back up the old buildspec just in case mv copilot/buildspec.yml copilot/buildspec.bkup.yml
  3. Run copilot pipeline init again, this will only create a new buildspec.yml file and skip updating the pipeline.yml file.
  4. Delete the backup rm copilot/buildspec.bkup.yml
  5. Commit and push the changes: git add copilot/buildspec.yml && git commit -m "update buildspec to v1.7.0" && git push

The pipeline should be able to now update your Lambda functions to Nodejsv12

efekarakus avatar May 21 '21 12:05 efekarakus

@efekarakus Thank you for the quick reply. The steps you wrote worked well for me!! Thanks to you, I can continue to use copilot in the future 😄

I would appreciate it if you could document this procedure, or you can close this issue.

rhoboro avatar May 24 '21 11:05 rhoboro

@efekarakus it seems these steps don't necessarily work on all the resources generated. In my case, the CertificateValidationFunction, CustomDomainFunction, and DNSDelegationFunction were not upgraded to the latest node version. All other functions were successfully upgraded.

h5aaimtron avatar Sep 16 '22 23:09 h5aaimtron

Hello @h5aaimtron. Those custom resources are in the environment stack. Are you using pipeline for environment deployment? If not you can update Copilot CLI to the latest version and then do env deploy to deploy the environment again.

iamhopaul123 avatar Sep 16 '22 23:09 iamhopaul123

This issue is stale because it has been open 60 days with no response activity. Remove the stale label, add a comment, or this will be closed in 14 days.

github-actions[bot] avatar Nov 04 '23 00:11 github-actions[bot]

This issue is closed due to inactivity. Feel free to reopen the issue if you have any further questions!

github-actions[bot] avatar Nov 18 '23 00:11 github-actions[bot]