Skip to content

Instantly share code, notes, and snippets.

View MichaelScovell's full-sized avatar

Michael Scovell MichaelScovell

View GitHub Profile
@MichaelScovell
MichaelScovell / modify-ec2-imdsv2.sh
Created April 19, 2021 12:00
modify-ec2-imdsv2.sh
#!/bin/bash
#Script that will configure existing EC2 instances to IMDSV2
#Create variable for instance ID
instanceID=$1
#Check to ensure that the instance is not blank
if [[ -n $instanceID ]];
then
#Add IMDSV2
@MichaelScovell
MichaelScovell / disable-ec2-imds.sh
Created April 19, 2021 12:03
disable-ec2-imds.sh
#!/bin/bash
# Script that will disable the metadata for the given instance.
#Create variable for instance ID
instanceID=$1
#Check to ensure that the instance is not blank
if [[ -n $instanceID ]];
then
#Remove EC2 IMDS
@MichaelScovell
MichaelScovell / restore-metadata.sh
Created April 19, 2021 12:04
restore-metadata.sh
#!/bin/bash
# Script that will restore the metadata for the given instance.
#Create variable for instance ID
instanceID=$1
#Check to ensure that the instance is not blank
if [[ -n $instanceID ]];
then
#Restore Metadata