Last active
February 10, 2021 20:07
-
-
Save reubendevries-cta/9b1c4c303112c20cf6394201487f349f to your computer and use it in GitHub Desktop.
ssm.send_command()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importing 3rd party python modules | |
import boto3 | |
# aws instance id's | |
FAULTING_ENGINE_QA = "" | |
# global variables | |
S3_DEVOPS_ANSIBLE_PLAYBOOKS = "s3://playbook folder" | |
def lambda_handler(event, context): | |
ssm = boto3.client("ssm") | |
ssm.send_command( | |
InstanceIds=[ | |
FAULTING_ENGINE_QA | |
], | |
DocumentName="AWS-ApplyAnsiblePlaybooks", | |
Parameters={ | |
"SourceInfo" : [ | |
S3_DEVOPS_ANSIBLE_PLAYBOOKS | |
], | |
"InstallDependencies": [ | |
"True" | |
], | |
"PlaybookFile": [ | |
"stop_faulting_engines.yaml" | |
] | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment