100 Days of AWS — Day 21- AWS System Manager — Part 2

  • AWS Systems Manager State Manager is a secure and scalable configuration management service that automates the process of keeping your Amazon EC2 and hybrid infrastructure in a state that you define.
  • One of the use case I found out of AWS System Manager State Manager is to run the command on a scheduled basis(eg: SnapShot Creation)
  • Go To Node Management → State Manager → Create association
  • Under Provide association details give some name and under Document name search for AWS-CreateSnapshot
  • In the Provide associations details give name, under Document name search for
  • Fill all the details like instance id, schedule, arn etc. Click on Create Associations.
  • But I believe there is a much better way to achieve this using data life cycle manager. Check the below blog for more info
  • passwords
  • database strings
  • license codes
  • If you want to retreieve the secret via commandline
aws ssm get-parameters --names "my-test-parameter"{"Parameters": [{"Name": "my-test-parameter","Type": "String","Value": "abc123","Version": 1,"LastModifiedDate": "2022-04-25T15:29:52.540000-07:00","ARN": "arn:aws:ssm:us-west-2:XXXXXXX:parameter/my-test-parameter","DataType": "text"}],"InvalidParameters": []}
  • To store the secret string, under Type select SecureString. Under KMS key either select the AWS provided key or you can use your own key.
  • To get the secret via command line, this time you need to use — with-decryption flag
aws ssm get-parameters --names "my-secure-secret" --with-decryption{"Parameters": [{"Name": "my-secure-secret","Type": "SecureString","Value": "abc123","Version": 1,"LastModifiedDate": "2022-04-25T15:33:41.781000-07:00","ARN": "arn:aws:ssm:us-west-2:XXXXX:parameter/my-secure-secret","DataType": "text"}],"InvalidParameters": []}
  • To create the secret via command line
aws ssm put-parameter --name "secret-password" --value 'abc123' --type SecureString --key-id arn:aws:kms:us-west-2:XXXXX:key/XXXXX{"Version": 1,"Tier": "Standard"}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store