install code deploy agent in disabled mode(pre-baking in AMI)

0

I would like to install code-deploy-agent on windows in disabled mode but I couldn't find any argument in the MSI package. I tried to search on the registry for a specific flag regarding registration.

We are trying to install code-deploy agent in an AMI but after the ec2 instance is created it complains about the instance-id.

Set-Service : Service 'CodeDeploy Host Agent Service (codedeployagent)' cannot be started due to the following error: 
Cannot start service codedeployagent on computer '.'.
At 
C:\Windows\system32\config\systemprofile\AppData\Local\Temp\Amazon\EC2-Windows\Launch\InvokeUserData\UserScript.ps1:35 
char:1
+ Set-Service -Name 'codedeployagent' -StartupType 'automatic' -Status  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Set-Service], 
ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.SetServiceCommand
Set-Service : Service 'CodeDeploy Host Agent Service (codedeployagent)' cannot be started due to the following error:
Cannot start service codedeployagent on computer '.'.
At
C:\Windows\system32\config\systemprofile\AppData\Local\Temp\Amazon\EC2-Windows\Launch\InvokeUserData\UserScript.ps1:35
char:1
+ Set-Service -Name 'codedeployagent' -StartupType 'automatic' -Status  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Set-Service], Se
   rviceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.SetServiceCommand
asked 2 years ago118 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions