This repository is used to simplify the process of cloning the SSM documents across the AWS regions.

Overview

SSM Cloner

Introduction


  • This module is created in order to simplify the process of copying the SSM documents from one region to another regions.

  • As an organisation or team can have multiple regions in which they operate. And in order to replicate the SSM documents from one region to another.

  • It becomes a tedious task if you are developing or if you need to update a document and replicate the change across the regions.

  • To resolve this issue, ssm-cloner comes for your help.

  • Just execute this module and pass on the parameters and it will clone the documents for you.

  • You can also use it to unclone or create new version for your documents.

Pre-requisites


  • AWS CLI should be installed on the system. For installing AWS CLI, visit the link: Install AWS CLI

  • Python should be installed. For installing Python, visit this link: Installing Python

  • Python package boto3 should be installed.

    pip3 install boto3 #(Linux)
    or
    pip install boto3 #(Windows)

How to setup environment


  1. For using it with AWS IAM users, set up the default profile using aws configure. The project will execute in that account.

  2. For AWS SSO users, copy and paste the temporary credentials in the terminal in which you want to execute the script.

  3. For IAM Role, this feature will be supported in future.

Execution Types


  1. Execute from command line as command line program

  2. Use it as a module - PENDING

  3. Use it as a installer - PENDING

Minimal Permission


  • In order to run the program, your user needs to have the sufficient permission.

  • Below is the permissions that is required for the program to run.

    {
      "Version": "2012-10-17",
      "Statement": [
          {
              "Sid": "VisualEditor0",
              "Effect": "Allow",
              "Action": [
                  "ssm:GetDocument",
                  "ssm:ListDocuments",
                  "ssm:DeleteDocument",
                  "ssm:CreateDocument"
              ],
              "Resource": "*"
          }
       ]
    }

Execution Steps


  1. Clone the repo in your system

  2. Go to the directory where the repo is cloned

  3. Open the terminal in the directory and run the below commands.

  4. Execute the program using below syntax (For Linux):

     #For Cloning (Linux)
     python3 ssm_cloner.py -c -d <doc_name> -sr <source_region> -dr <command_separated_destination_regions>
    
     #For Uncloning (Linux)
     python3 ssm_cloner.py -uc -d <doc_name> -sr <source_region> -dr <command_separated_destination_regions>
  5. For windows, follow the below syntax:

     #For Cloning (Windows)
     python ssm_cloner.py -c -d <doc_name> -sr <source_region> -dr <command_separated_destination_regions>
    
     #For Uncloning (Windows)
     python ssm_cloner.py -uc -d <doc_name> -sr <source_region> -dr <command_separated_destination_regions>

Command Line Parameters Description


  1. -d / --doc-name (Required): This parameter is used to define the document name that needs to be cloned.

  2. -sr / --source-region (Required): This parameter is used to define the source region from which the main document will be fetched

    • Type: string
    • Example: us-east-1
  1. -dr / --destination-regions (Required): This parameter is used to define the destination regions to which the cloned documents will be created.

    • Type: Command Separated values
    • Example: us-east-1,us-east-2,us-west-1
  1. -c / --clone (Required): This parameter is used to specify program to clone the document. This parameter cannot be used together with "-uc / --unclone" parameter.

    • Type: None
    • Example: -c or --clone
    • Usage:
      python3 ssm_cloner.py -c #(Short hand parameter)
      
      # OR
      
      python3 ssm_cloner.py --clone #(Descriptive parameter)
  1. -uc / --unclone (Required): This parameter is used to specify program to unclone the document. This parameter cannot be used together with "-c or --clone" parameter.

    • Type: None
    • Example: -uc or --unclone
    • Usage:
      python3 ssm_cloner.py -uc #(Short hand parameter)
      
      #OR
      
      python3 ssm_cloner.py --unclone #(Descriptive parameter)

Roadmap


  • Add the functionality to make the program, a module
  • Add the functionality to execute the program across the accounts/region
  • Support for gov cloud

Links


You might also like...
Project template for using aws-cdk, Chalice and React in concert, including RDS Postgresql and AWS Cognito

What is This? This repository is an opinonated project template for using aws-cdk, Chalice and React in concert. Where aws-cdk and Chalice are in Pyth

POC de uma AWS lambda que executa a consulta de preços de criptomoedas, e é implantada na AWS usando Github actions.
POC de uma AWS lambda que executa a consulta de preços de criptomoedas, e é implantada na AWS usando Github actions.

Cryptocurrency Prices Overview Instalação Repositório Configuração CI/CD Roadmap Testes Overview A ideia deste projeto é aplicar o conteúdo estudado s

Python + AWS Lambda Hands OnPython + AWS Lambda Hands On
Python + AWS Lambda Hands OnPython + AWS Lambda Hands On

Python + AWS Lambda Hands On Python Criada em 1990, por Guido Van Rossum. "Bala de prata" (quase). Muito utilizado em: Automatizações - Selenium, Beau

Unauthenticated enumeration of services, roles, and users in an AWS account or in every AWS account in existence.

Quiet Riot 🎶 C'mon, Feel The Noise 🎶 An enumeration tool for scalable, unauthenticated validation of AWS principals; including AWS Acccount IDs, roo

AWS Blog post code for running feature-extraction on images using AWS Batch and Cloud Development Kit (CDK).

Batch processing with AWS Batch and CDK Welcome This repository demostrates provisioning the necessary infrastructure for running a job on AWS Batch u

Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

AWS-serverless-starter - AWS Lambda serverless stack via Serverless framework
AWS-serverless-starter - AWS Lambda serverless stack via Serverless framework

Serverless app via AWS Lambda, ApiGateway and Serverless framework Configuration

Aws-cidr-finder - A Python CLI tool for finding unused CIDR blocks in AWS VPCs

aws-cidr-finder Overview An Example Installation Configuration Contributing Over

AWS CloudSaga - Simulate security events in AWS

AWS CloudSaga - Simulate security events in AWS AWS CloudSaga is for customers to test security controls and alerts within their Amazon Web Services (

Owner
null
DIAL(Did I Alert Lambda?) is a centralised security misconfiguration detection framework which completely runs on AWS Managed services like AWS API Gateway, AWS Event Bridge & AWS Lambda

DIAL(Did I Alert Lambda?) is a centralised security misconfiguration detection framework which completely runs on AWS Managed services like AWS API Gateway, AWS Event Bridge & AWS Lambda

CRED 71 Dec 29, 2022
Automated AWS account hardening with AWS Control Tower and AWS Step Functions

Automate activities in Control Tower provisioned AWS accounts Table of contents Introduction Architecture Prerequisites Tools and services Usage Clean

AWS Samples 20 Dec 7, 2022
Morpheus is a telegram bot that helps to simplify the process of making custom telegram stickers.

?? Morpheus is a telegram bot that helps to simplify the process of making custom telegram stickers. As you may know, Telegram's official Sti

Abhijith K S 1 Dec 14, 2022
This repository are used to give class about AWS

AWSTraining This repository are used to give class about AWS by Marco Antonio Pereira Linkedin: https://www.linkedin.com/in/marcoap To see the types o

Marco Antonio Pereira 6 Nov 23, 2022
Automatically compile an AWS Service Control Policy that ONLY allows AWS services that are compliant with your preferred compliance frameworks.

aws-allowlister Automatically compile an AWS Service Control Policy that ONLY allows AWS services that are compliant with your preferred compliance fr

Salesforce 189 Dec 8, 2022
SSH-Restricted deploys an SSH compliance rule (AWS Config) with auto-remediation via AWS Lambda if SSH access is public.

SSH-Restricted SSH-Restricted deploys an SSH compliance rule with auto-remediation via AWS Lambda if SSH access is public. SSH-Auto-Restricted checks

Adrian Hornsby 30 Nov 8, 2022
AWS Auto Inventory allows you to quickly and easily generate inventory reports of your AWS resources.

Photo by Denny Müller on Unsplash AWS Automated Inventory ( aws-auto-inventory ) Automates creation of detailed inventories from AWS resources. Table

AWS Samples 123 Dec 26, 2022
A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier

A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier

Amazon Web Services - Labs 1.9k Jan 7, 2023
aws-lambda-scheduler lets you call any existing AWS Lambda Function you have in a future time.

aws-lambda-scheduler aws-lambda-scheduler lets you call any existing AWS Lambda Function you have in the future. This functionality is achieved by dyn

Oğuzhan Yılmaz 57 Dec 17, 2022