initialised-localstack icon indicating copy to clipboard operation
initialised-localstack copied to clipboard

I did not figure out how SSM works with this image. I am not sure if I missed anything.

Open allentian opened this issue 6 years ago • 0 comments

I created the docker-composer.yml:

version: "2.3"

services:
  localstack:
    image: markglh/initialised-localstack:latest
    environment:
      - "SERVICES=${LOCALSTACK_SERVICES:-ssm}"
      - "DEFAULT_REGION=${AWS_REGION:-ap-southeast-2}"
      - "HOSTNAME=${LOCALSTACK_HOSTNAME:-localhost}"
      - "HOSTNAME_EXTERNAL=${LOCALSTACK_HOSTNAME_EXTERNAL:-localhost}"
      - "USE_SSL=false"
      #- "DATA_DIR=${LOCALSTACK_DATA_DIR:-/tmp/localstack/data}" # uncomment if you want to persist data between runs
    volumes:
      - ./scripts:/opt/bootstrap/scripts
    ports:
      - "4567-4583:4567-4583"
      - "8080:8080"

Created file scripts/init.sh

#!/bin/bash

awslocal ssm put-parameter --name "welcome" --type "String" --value "helloWorld"

I run command in one tab

docker-compose up

In another tab I run the following commands:

allentian:~/mklocalstack$ aws ssm get-parameter --name "welcome" --endpoint-url=http://localhost:4583
An error occurred (ParameterNotFound) when calling the GetParameter operation: Parameter welcome not found.
allentian:~/mklocalstack$ aws ssm put-parameter --name "welcome" --type "String" --value "helloWorld" --endpoint-url=http://localhost:4583
allentian:~/mklocalstack$ aws ssm get-parameter --name "welcome" --endpoint-url=http://localhost:4583 
{
    "Parameter": {
        "Version": 1, 
        "Type": "String", 
        "Name": "welcome", 
        "Value": "helloWorld"
    }
}

From the above, we know ssm command in init.sh does not work correctly. I have to run command outside of container to set it up and get its value successfully.
Can you help me figure out why ssm command in init.sh does not work? Actually if I put any other commands such as kinesis, S3 or dynamodb in init.sh, it works very well. Only ssm command does not work. I appreciate any suggestion or help. Thanks.

allentian avatar Aug 07 '18 14:08 allentian