Skip to content

Packer scripts to build AMIs with syslogs going to CloudWatch

Notifications You must be signed in to change notification settings

mark-greene/packer-awslogs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Packer-AwsLogs

Packer scripts to build AMI's with syslogs going to Cloudwatch.

Generic Ubuntu and Windows examples provided.

packer build -var 'aws_profile=default' windows.json
packer build -var 'aws_profile=default' ubuntu.json

Note: Packer for windows requires the winrm port 5986 open.

Resources

To manually install

Amazon Linux

# Configure CloudWatch logs
sudo yum -y install awslogs
sudo service awslogs start
sudo chkconfig awslogs on
# Edit /etc/awslogs/awslogs.conf and /etc/awslogs/awscli.conf
sudo service awslogs restart

Ubuntu

# Configure CloudWatch logs
curl https://s3.amazonaws.com//aws-cloudwatch/downloads/latest/awslogs-agent-setup.py -O
chmod +x ./awslogs-agent-setup.py
sudo ./awslogs-agent-setup.py -n -r us-east-1

Windows RDT with a SSH bastion

ssh -4 -N -L 3389:<instance ip>:3389 ubuntu@<bastion dns>

rdesktop localhost -u Administrator -p password -g 90%
# Configure CloudWatch logs
# Create  `C:\Program Files\Amazon\SSM\Plugins\awsCloudWatch\AWS.EC2.Windows.CloudWatch.json`
Restart-Service AmazonSSMAgent

About

Packer scripts to build AMIs with syslogs going to CloudWatch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published