This action reads values from AWS SSM and send outputs to the S3 file.
You should add following AWS credentials as env variables to your action env. Please make sure that you add them as secret!
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
You can also use following action to configure AWS credentials:
https://github.com/aws-actions/configure-aws-credentials
on: [push]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
jobs:
sync-env-variables:
runs-on: ubuntu-latest
name: Sync env variables to S3 for ECS
steps:
- name: SSM to S3
id: ssmToS3
uses: SmartGiftEngineering/ssm-output-to-s3@0.1.1
with:
ssm-path: '/my-app/production/my-variable'
s3-bucket: 'my-config-bucket'
s3-file: 'my-service/production/env'
ssm-additional-paths: '/my-app/production/my-variable-2' # Optional
# Use the output from the `hello` step
- name: The S3 Path for the env file
run: echo "${{ steps.test-ssm-action.s3ObjectUrl }}"
The path of the SSM Parameter
The name of the S3 bucket
The S3 path for the output file
This is optional. If provided, the parameters are appended to the at the end of the file. You can define multiple paths separated by comma.