Created
June 1, 2015 08:02
-
-
Save lantrix/b72884d6b79725debb35 to your computer and use it in GitHub Desktop.
Count number of AWS Resource Types with specific Tag Value in Powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $tagKey="Stream" | |
| $tagValue="se" | |
| $data = (Get-EC2Tag -Filter @{name="tag:${tagKey}"; Value=$tagValue}) | |
| $gps = @() | |
| foreach ($t in $data.ResourceType | ? { $_.Key -eq $groupkey} ) { | |
| $gps += $t.Value | |
| } | |
| $gps | group | Sort Count -Descending | Select Count, Name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment