2

AWS has service named CodeDeploy which can deploy code to Auto Scaling (AS) group. For e.g. if your AS policy got triggered and it spun a new instance (which will use predefined instance image called AMI in AWS) CodeDeploy will push the code to the new instance from its recent revision from S3 or GitHub.

Is there any way we can do this in GCP so that you don't have to update instance template every time there is a code change or deployment?

2 Answers2

1

You can create custom image and use that custom image when creating instance group. Another option is to use Deterministic Instance template when creating instance group. In brief, you can define the startup-scripts as metadata when creating instance template.

Hope it helps!

N Singh
  • 438
  • 3
  • 10
  • doesn't even come closer to what I want – Prem Sompura Sep 02 '17 at 20:08
  • @PremSompura Check out this feature: [Updating Managed Instance Groups](https://cloud.google.com/compute/docs/instance-groups/updating-managed-instance-groups). However, this feature is in Alpha release and you have to request to be whitelisted in order to use this feature. Request form to be whitelisted is available [here](https://docs.google.com/a/google.com/forms/d/e/1FAIpQLScHTn-gmhtGVwWrsG4sEbcdOmhnc6OUn_xbthPtaLP_0JvLMg/viewform). – N Singh Sep 04 '17 at 20:09
0

In case anyone still has this question and to save you a bit of time, it is not possible to update an instance template, once created it can not be modified, as explained on GCP documentation.

Learned this the hard way, my self.