This container can be used to easily create an environment file using key-value pairs from an Amazon DynamoDB table.
DYNAMODB_TABLE required
DYNAMODB_REGION (default: us-east-1)
KEY_ATTRIBUTE (default: Variable)
VALUE_ATTRIBUTE (default: Value)
OUTPUT_FILE (default: environment)
/output folder which should be mapped to your host.The easiest way to configure permissions is by using an IAM instance role, and granting the instance running the container the ability to Scan the specified DynamoDB table. If that is not possible, then you can provide your credentials using the following environment variables:
AWS_ACCESS_KEYAWS_SECRET_KEYThis is best used as a ExecStartPre call to build an environment file that can be used with an --env-file parameter to another container.
# some-application.service
[Unit]
Description=My Application Container
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
# This will write the environment file to `/etc/container_environments/%p`
ExecStartPre=/usr/bin/docker run --rm=true \
--volume /etc/container_environments:/output \
-e DYNAMODB_TABLE=MyAppEnvironmentVars \
-e DYNAMODB_REGION=us-east-1 \
-e OUTPUT_FILE=%p \
webdestroya/dynamodb-to-envfile
ExecStartPre=/usr/bin/docker pull myapplication:latest
ExecStart=/usr/bin/docker run --name %p \
--env-file /etc/container_environments/%p \
myapplication \
ExecStop=/usr/bin/docker stop %p
[Install]
WantedBy=multi-user.target
Content type
Image
Digest
sha256:72f087f88…
Size
20.3 MB
Last updated
over 11 years ago
docker pull webdestroya/dynamodb-to-envfile