title: "Expecting property name enclosed in double quotes" with AWS cli on Jenkins Pipeline
body: <p>I am getting an error message </p>
  
  <blockquote>
    <p>Expecting property name enclosed in double quotes: line 1 column 3 (char 2)</p>
  </blockquote>
  
  <p>while running AWS CLI on Jenkins pipeline to create task definition for EC2 container service. The interesting thing is this script is able to run in command line without any error.</p>
  
  <pre><code>aws ecs register-task-definition --family ${FAMILY} --container-definitions "[{\"name\":\"wildfly\",\"image\":\"${REPOSITORY}\",\"memory\":3024,\"essential\":true,\"portMappings\":[{\"containerPort\":8080,\"hostPort\":8080,\"protocol\":\"tcp\"}]}]"` 
  </code></pre>
  
  <p>This is the complete error message</p>
  
  <blockquote>
  <pre><code>aws ecs register-task-definition --family wildfly2-b47 --container-definitions [{name:wildfly, image:****/backend:b47, memory:3024, essential:true, portMappings:[{containerPort:8080, hostPort:8080, protocol:tcp}]}]
  </code></pre>
    
    <p>Expecting property name enclosed in double quotes: line 1 column 3
    (char 2)</p>
  </blockquote>
  
  <p>This the jenkins stage code</p>
  
  <pre class="lang-java prettyprint-override"><code>    stage('Deploy')
          withCredentials([string(credentialsId: 'ecr-repository', variable: 'repo'), 
          [$class: 'AmazonWebServicesCredentialsBinding', 
          accessKeyVariable: 'AWS_ACCESS_KEY_ID', 
          credentialsId: 'ecr-credentials', 
          secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
              sh '''
              bash
              set -x
              export AWS_DEFAULT_REGION=us-west-2
              CLUSTER="default"
              VERSION=b${BUILD_NUMBER}
              FAMILY=nxpmp2-${VERSION}
              SERVICE="backend"
              REPOSITORY=${repo}/backend:${VERSION}
              #Register the task definition in the repository
              aws ecs register-task-definition --family ${FAMILY} --container-definitions "[{"name": "wildfly", "image": ${REPOSITORY}, "memory": 3024, "essential": true, "portMappings": [{"containerPort": 8080, "hostPort": 8080, "protocol": "tcp" } ] }]"
              #Update the Service
              #aws ecs update-service --cluster ${CLUSTER} --region ${AWS_DEFAULT_REGION} --service ${SERVICE} --task-definition ${FAMILY}
  --desired-count 1
              '''
          }
  </code></pre>
  
  <p>Please help me on this</p>