-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This builds on the existing methods to detect remote backend usage and adds detection of cloud blocks in the terraform block.
- Loading branch information
Showing
7 changed files
with
176 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package backend | ||
|
||
type CloudData interface { | ||
Copy() CloudData | ||
Equals(CloudData) bool | ||
} | ||
|
||
type UnknownCloudData struct{} | ||
|
||
func (*UnknownCloudData) Copy() CloudData { | ||
return &UnknownCloudData{} | ||
} | ||
|
||
func (*UnknownCloudData) Equals(d CloudData) bool { | ||
_, ok := d.(*UnknownCloudData) | ||
return ok | ||
} | ||
|
||
type Cloud struct { | ||
Organization string | ||
Hostname string | ||
} | ||
|
||
func (r *Cloud) Copy() CloudData { | ||
return &Cloud{ | ||
Organization: r.Organization, | ||
} | ||
} | ||
|
||
func (r *Cloud) Equals(d CloudData) bool { | ||
data, ok := d.(*Cloud) | ||
if !ok { | ||
return false | ||
} | ||
|
||
return data.Organization == r.Organization | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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