Skip to content

Instantly share code, notes, and snippets.

@reubendevries-cta
Last active February 10, 2021 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reubendevries-cta/9b1c4c303112c20cf6394201487f349f to your computer and use it in GitHub Desktop.
Save reubendevries-cta/9b1c4c303112c20cf6394201487f349f to your computer and use it in GitHub Desktop.
ssm.send_command()
# 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