Automation using lambda for change instance type of EC2 instance (AWS) | Change RAM & CPU Automation

preview_player
Показать описание
Automation using lambda for change instance type of EC2 instance (AWS) | Change RAM & CPU Automation

Code in lambda function:

import json
import boto3
import time

def lambda_handler(event, context):

# Insert your Instance ID here
my_instance = 'Your instance id '

# Stop the instance

# Change the instance type

# Start the instance

return {
'statusCode': 200,
}
import json
import boto3
import time

def lambda_handler(event, context):

# Insert your Instance ID here
my_instance = 'i-0ca63993e8b634096'

# Stop the instance

# Change the instance type

# Start the instance

return {
'statusCode': 200,
}

#Automation
#Lambda
#Cloudwatch
#instance type change
#How to change instance type automatically
Рекомендации по теме
Комментарии
Автор

Grt thanks for sharing. Plz upload more vedios.

karamjeetdalal
Автор

If the instance is attached to autoscaling group, it will launch new instance, how to avoid that with automation

AdityaDeshpande-fv
Автор

Hi CTS,

I logged into the AWS console with the root user. I am getting the below error when I am trying to create a policy with the 4 permissions you mentioned in the video.
"This policy defines some actions, resources, or conditions that do not provide permissions. To grant access, policies must have an action that has an applicable resource or condition. For details, choose Show remaining Learn more."

Am I missing anything here?

srinivasareddy
Автор

can switch to P instance family or G instance family?

ahmadulukin