diff --git a/src/aws/__init__.py b/src/aws/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/aws/aws-ssm-parameters.json b/src/aws/aws-ssm-parameters.json new file mode 100644 index 0000000..68c7092 --- /dev/null +++ b/src/aws/aws-ssm-parameters.json @@ -0,0 +1,16 @@ +{ + "Parameters": [ + { + "Name": "Steve Rogers", + "Value": "Captain America", + "Type": "String", + "Description": "Sentinel of Liberty, Avenger" + }, + { + "Name": "Peter Parker", + "Value": "Spider-Man", + "Type": "String", + "Description": "Friendly Neighborhood, Avenger" + } + ] +} \ No newline at end of file diff --git a/src/aws/aws-ssm-put-param-example.py b/src/aws/aws-ssm-put-param-example.py new file mode 100644 index 0000000..86b4481 --- /dev/null +++ b/src/aws/aws-ssm-put-param-example.py @@ -0,0 +1,15 @@ +import json + +with open("./aws-ssm-parameters.json") as file: + data = json.load(file) + for item in data["Parameters"]: + cmd = f'aws ssm put-parameter --name "{item['Name']}" \ + --description "{item['Description']}" --value "{item['Value']}" \ + --type "{item['Type']}" --overwrite' + print(f'Executing AWS SSM command: {cmd}') + # Execute the command to put the data in AWS Parameter Store + # It is commented out in the example, but in order to execute + # the following lines, AWS CLI must be installed first! + # https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html + # import os + # os.system(cmd) \ No newline at end of file