File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,15 @@ func main() {
3030 file = os .Getenv ("TI_TFSTATE" )
3131 }
3232
33+ // check for a file named terraform.tfstate in the pwd
34+ if file == "" {
35+ fn := "terraform.tfstate"
36+ _ , err := os .Stat (fn )
37+ if err == nil {
38+ file = fn
39+ }
40+ }
41+
3342 if file == "" {
3443 fmt .Printf ("Usage: %s [options] path\n " , os .Args [0 ])
3544 os .Exit (1 )
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ var keyNames []string
1919func init () {
2020 keyNames = []string {
2121 "ipv4_address" , // DO
22- "public_ip" , // AWS
23- "private_ip" , // AWS
22+ "public_ip" , // AWS
23+ "private_ip" , // AWS
2424 }
2525}
2626
@@ -76,7 +76,7 @@ func (s resourceState) isSupported() bool {
7676
7777// Address returns the IP address of this resource.
7878func (s resourceState ) Address () string {
79- for _ , key := range ( keyNames ) {
79+ for _ , key := range keyNames {
8080 if ip := s .Primary .Attributes [key ]; ip != "" {
8181 return ip
8282 }
You can’t perform that action at this time.
0 commit comments