driftctl/pkg/remote/remote.go

37 lines
816 B
Go
Raw Normal View History

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