Skip to content

Instantly share code, notes, and snippets.

@chandradeoarya
Created June 9, 2022 05:09
Show Gist options
  • Save chandradeoarya/6712178830c8e7700a02fd6f81630838 to your computer and use it in GitHub Desktop.
Save chandradeoarya/6712178830c8e7700a02fd6f81630838 to your computer and use it in GitHub Desktop.
SSM Run command YAML template which will install Apache on an EC2 instance
---
schemaVersion: '2.2'
description: YAML template which will install Apache on an EC2 instance
parameters:
InitialWebText:
type: "String"
description: "Initial message"
default: "Welcome to instance "
mainSteps:
- action: aws:runShellScript
name: configureApache
inputs:
runCommand:
- 'sudo yum update -y'
- 'sudo yum install -y httpd'
- 'sudo systemctl start httpd.service'
- 'sudo systemctl enable httpd.service'
- 'echo "{{InitialWebText}} $(hostname -f) , running Apache, installed with AWS Systems Manager" > /var/www/html/index.html'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment