2020-12-09 15:31:34 +00:00
|
|
|
package remote
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2020-12-16 12:02:02 +00:00
|
|
|
"github.com/cloudskiff/driftctl/pkg/alerter"
|
2020-12-09 15:31:34 +00:00
|
|
|
"github.com/cloudskiff/driftctl/pkg/remote/aws"
|
2021-01-22 17:06:17 +00:00
|
|
|
"github.com/cloudskiff/driftctl/pkg/resource"
|
|
|
|
"github.com/cloudskiff/driftctl/pkg/terraform"
|
2020-12-09 15:31:34 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var supportedRemotes = []string{
|
|
|
|
aws.RemoteAWSTerraform,
|
|
|
|
}
|
|
|
|
|
|
|
|
func IsSupported(remote string) bool {
|
|
|
|
for _, r := range supportedRemotes {
|
|
|
|
if r == remote {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2021-01-22 17:06:17 +00:00
|
|
|
func Activate(remote string, alerter *alerter.Alerter, providerLibrary *terraform.ProviderLibrary, supplierLibrary *resource.SupplierLibrary) error {
|
2020-12-09 15:31:34 +00:00
|
|
|
switch remote {
|
|
|
|
case aws.RemoteAWSTerraform:
|
2021-01-22 17:06:17 +00:00
|
|
|
return aws.Init(alerter, providerLibrary, supplierLibrary)
|
2020-12-09 15:31:34 +00:00
|
|
|
default:
|
|
|
|
return fmt.Errorf("unsupported remote '%s'", remote)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetSupportedRemotes() []string {
|
|
|
|
return supportedRemotes
|
|
|
|
}
|