Finding Outdated Instance Types

Length: 00:11:35

Lesson Summary:

In this lesson, we'll create a custom AWS Config rule to find outdated EC2 instance types. Moving off these old instance types can help us reduce costs and improve performance.

Create a Lambda Function

  1. Create a role called "LambdaCheckInstanceTypeRole" and specify AWS Config Rules permissions as the policy template.

  2. Create the Lambda function CheckInstanceType. Note the ARN for the next steps.

Create an AWS Config Rule

  1. In the AWS Config console, select Rules, then click the Add rule button.
  2. Next, click Add custom rule.
    • Name: DesiredInstanceTypes.
    • Description: Checks that all EC2 instances are of the type specified.
    • AWS Lambda function ARN: (Copy and paste from the Lambda Console. It should look something like this: arn:aws:lambda:us-east-1:123456789012:function:CheckInstanceType)
    • Trigger type: Configuration changes
    • Scope of changes: Resources
    • Resources: EC2: Instance
    • Rule parameters:
      • Key: desiredInstanceType
      • Value: t2.micro, or a comma-separated list (e.g, t2.micro,t3.micro). Note: Any values not in this list will evaluate to noncompliant.
  3. Click Save.

References

Example Events for AWS Config: https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules_example-events.html


This lesson is only available to Linux Academy members.

Sign Up To View This Lesson
Or Log In

Looking For Team Training?

Learn More