File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ # Import AWS credentials
2+ . ./ credentials.ps1
3+
4+ Set-AWSCredential - AccessKey $AWSAccessKey - SecretKey $AWSSecretKey
5+
6+ # $regions = @("us-east-1","us-west-1")
7+ $regions = @ ((Get-AWSRegion ).Region)
8+ $urlprefix = " http://"
9+
10+ $instances = @ ()
11+
12+ $regions | ForEach-Object {
13+ $regioninstances = (Get-EC2Instance - Region $_ ).Instances
14+ if ($regioninstances -ne $null ) {
15+ $instances += (Get-EC2Instance - Region $_ ).Instances
16+ }
17+ }
18+
19+ $sessions = @ ()
20+ $instances | ForEach-Object {
21+ $sessions += New-Object PSObject - Property @ {
22+ ' Name' = $_.Tags.Value ;
23+ ' IP' = $_.PublicIpAddress ;
24+ ' URL' = " $ ( $urlprefix ) $ ( $_.PublicIpAddress ) " ;
25+ }
26+ }
27+
28+ $sessions | Sort-Object - Property IP | Select-Object - Property Name, IP, URL
You can’t perform that action at this time.
0 commit comments