Detect and remediate cost waste | S02 E29 | Build On Weekly
This week, Rohini and Darko are joined by Steph, as we look at a way to detect potential unwanted costs and remediate them.We did this using AWS Config and some AWS Systems Manager magic
aws:executeAwsApi
, the better option was just to use aws:createTags
, as that is what we actually wanted! 🥳 This simple change has made it possible to create a new automation document that has the following contents:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
description: |-
This automation document tags Unused Elastic IPs so we can track them.
schemaVersion: '0.3'
assumeRole: '{{AutomationAssumeRole}}'
parameters:
Resources:
type: StringList
description: (Required) The allocation IDs of the Elastic IP Addresses to be tagged.
AutomationAssumeRole:
type: String
description: The role that allows Automation to execute the actions on your behalf.
Tags:
type: MapList
description: 'Tags to apply to the elastic IP addresses. Enter in teh following format: {"Key":"COST_ALERT","Value":"UnusedEip"}'
mainSteps:
- name: 'TagElasticIP'
action: 'aws:createTags'
inputs:
ResourceType: EC2
Tags: '{{Tags}}'
ResourceIds: '{{Resources}}'
Tags
parameter we use the following format: {"Key":"COST_ALERT","Value":"UnusedEip"}
. Huzzah!Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.