Skip to content
play

GitHub Action

AWS SSM parameters to S3

v0.0.6-beta Latest version

AWS SSM parameters to S3

play

AWS SSM parameters to S3

Sync SSM parameters to S3 bucket

Installation

Copy and paste the following snippet into your .yml file.

              

- name: AWS SSM parameters to S3

uses: SmartGiftEngineering/ssm-output-to-s3@v0.0.6-beta

Learn more about this action in SmartGiftEngineering/ssm-output-to-s3

Choose a version

SSM Output to S3 Action

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

Sample

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 }}"

Inputs

ssm-path

The path of the SSM Parameter

s3-bucket

The name of the S3 bucket

s3-file

The S3 path for the output file

ssm-additional-paths

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.