aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.04k stars 323 forks source link

Cloud formation ssm distributor package issue #363

Open kdineshreddy009 opened 3 years ago

kdineshreddy009 commented 3 years ago

Hi, i am trying to install a distributor package by having inside a CF template. While the RUN job is triggering, seeing below errors in RUN command output

Log:
Initiating dd_agent_linux_7 7.0.0 install

Plugin aws:runShellScript ResultStatus Failed

install output: Running sh install.sh

is not number. Use a numeric value for this tag

resources from CF: https://www.codepile.net/pile/7AD7GqEn

SSMDocument:
    Type: AWS::SSM::Document
    Properties:
      DocumentType: Command
      Content:
        schemaVersion: '2.2'
        description: "dd install Document"
        mainSteps:
        - action: aws:configurePackage
          name: configurePackage
          inputs:
            name: dd_agent_linux_7
            action: Install
            additionalArguments:
              SSM_API_KEY: "dummyapitoken"
              SSM_ENV: "lab"
              SSM_SERVICE_NAME: "testingAgentService"
              SSM_TIER: "4"
              SSM_APM_ENABLED: "true"
              SSM_VARIANT: "blank"

->seems like parameters were not getting passed ->why Plugin aws:runShellScript ResultStatus Failed happening ?

hencrice commented 1 year ago

I'm observing a similar issue. The arguments provided in the additionalArguments do not seem to be passed to the install.sh or update.sh. My SSM document looks like the following:

---
schemaVersion: "2.2"
description: "An SSM document for installing, updating and configuring my package."
mainSteps:
- inputs:
    action: "Install"
    onFailure: "exit"
  name: "configureDocker"
  action: "aws:configureDocker"
- inputs:
    installationType: "In-place update"
    name: "arn:aws:ssm:us-west-2:012345678912:document/my-document"
    onFailure: "exit"
    action: "Install"
    additionalArguments:
      SSM_ECR_ENDPOINT: "012345678912.dkr.ecr.us-west-2.amazonaws.com"
  name: "installUpdateMyPackage"
  action: "aws:configurePackage"

The SSM_ECR_ENDPOINT does not exist as an environment variable when install.sh or update.sh is run.