1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
# Example
This is an example using the AWS SDK for Go to list ec2 instances that match provided tag name filter.
# Usage
The example uses the tag name provided, and lists all matching ec2 instances.
```sh
go run filter_ec2_by_tag.go <name_filter>
```
Output:
```
listing instances with tag vpn in: us-east-1
[{
Instances: [{
AmiLaunchIndex: 0,
Architecture: "x86_64",
BlockDeviceMappings: [{
DeviceName: "/dev/xvda",
Ebs: {
AttachTime: 2016-07-06 18:04:53 +0000 UTC,
DeleteOnTermination: true,
Status: "attached",
VolumeId: "vol-xxxx"
}
}],
...
```
|