driftctl/pkg/remote/aws/init_test.go

24 lines
553 B
Go
Raw Normal View History

package aws
import (
2021-06-23 08:33:57 +00:00
"os"
"github.com/cloudskiff/driftctl/pkg/output"
"github.com/cloudskiff/driftctl/pkg/terraform"
)
func InitTestAwsProvider(providerLibrary *terraform.ProviderLibrary) (*AWSTerraformProvider, error) {
2021-03-18 10:20:14 +00:00
progress := &output.MockProgress{}
progress.On("Inc").Maybe().Return()
2021-06-23 08:33:57 +00:00
provider, err := NewAWSTerraformProvider("3.19.0", progress, os.TempDir())
if err != nil {
return nil, err
}
err = provider.Init()
if err != nil {
return nil, err
}
providerLibrary.AddProvider(terraform.AWS, provider)
return provider, nil
}