Skip to main content

pass in a encrypted file and kms key id, the package will decrypt the data, and upload the contents to aws ssm.

Project description

ssm_mass_uploader

Upload multiple screts to AWS SSM Parameter store from single file. Essentially you just add json objects to the 'secrets' array in the secrets_to_upload.json

Usage

For parameter options see boto 3 put parameter docs

Encrypting the file locally

Windows

aws kms encrypt --key-id {kms_id_id} --plaintext fileb://{file_to_encrypt} --query CiphertextBlob > encrypted_file.base64 go into the file and remove the quotes certutil -decode encrypted_file.base64 encrypted_file

Note: The base64 data is base64 of your encrypted data, not your actual data.

Linux/Mac

aws kms encrypt --key-id {kms_id_id} --plaintext fileb://{file_to_encrypt} --query CiphertextBlob | base64 --decode > encrypted_file

Example:

-f file path -k kms_id --p aws profile --r region

example 1: python3 ssm_mass_uploader-main/upload_ssm.py -k $kms_id -f encrypted_file

json to put in 'secrets_to_upload'

Note: Tags are not required, but if you do include them, then the key values are required

{
  "Name": "String [REQUIRED]",
  "Description": "String [NOT REQUIRED]",
  "Value": "String [REQUIRED]",
  "Type": "String'|'StringList'|'SecureString [REQUIRED]",
  "KeyId": "String [NOT REQUIRED]",
  "Overwrite": "BOOLEAN [NOT REQUIRED]",
  "AllowedPattern": "String [NOT REQUIRED]",
  "Tags": [
    {
      "Key": "String [REQUIRED]",
      "Value": "String [REQUIRED]"
    }
  ],
  "Tier": "'Standard'|'Advanced'|'Intelligent-Tiering' [NOT REQUIRED]",
  "Policies": "String [NOT REQUIRED]",
  "DataType": "String [NOT REQUIRED]"
}

Examples

Example Secrets

Basic Examples

{
  "secrets": [
    {
      "Name": "/this/is/super/secret",
      "Value": "shhhh",
      "Type": "String"
    }
  ]
}
{
  "secrets": [
    {
      "Name": "/this/is/super/secret",
      "Value": "shhhh",
      "Type": "SecureString"
    }
  ]
}

Example with Tags

{
  "secrets": [
    {
      "Name": "/this/is/super/secret",
      "Value": "shhhh",
      "Type": "String"
    },
    {
      "Name": "/this/is/another/secret",
      "Value": "hmmmm",
      "Type": "SecureString",
      "Tags": [
        {
          "Key": "Project Name",
          "Value": "Project X"
        }
      ]
    }
  ]
}

Example allowing overwrites, secure string, and tags

Note: You cannot used Overwrite and tags in the same call. You should either add tags on first creation, or add / remove tags later on.

{
  "secrets": [
    {
      "Name": "/this/is/super/secret",
      "Value": "new secret",
      "Type": "String",
      "Overwrite": true
    },
    {
      "Name": "/this/is/another/secret",
      "Value": "hmmmm",
      "Type": "SecureString",
      "Tags": [
        {
          "Key": "Project Name",
          "Value": "Project X"
        }
      ]
    }
  ]
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssm_mass_uploader-0.0.3.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssm_mass_uploader-0.0.3-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ssm_mass_uploader-0.0.3.tar.gz.

File metadata

  • Download URL: ssm_mass_uploader-0.0.3.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for ssm_mass_uploader-0.0.3.tar.gz
Algorithm Hash digest
SHA256 06ddfc04cf6fc9e20bc11b0a7e5f5e675e6af5699b9a6b1b39b9d46eb283949e
MD5 c081cd1f503cd2419f3547cc83f8f7f5
BLAKE2b-256 ab393cf07b7a9bee506859ede3d29cbbe07a9ba1c84140ecf1b7ecf992b8e0db

See more details on using hashes here.

File details

Details for the file ssm_mass_uploader-0.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: ssm_mass_uploader-0.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for ssm_mass_uploader-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9774abc20853f43afa2efa7caed92fc04dd3f0c18c128ea054d14c2c87ccc322
MD5 92152f76aaf77317b8a88b1fa97fa25f
BLAKE2b-256 e9cc092dd5d62577fa4281e1e7acc4eb7bd67c93a115ea6f729868f0f84f099f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page