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
질문됨 2년 전125회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠