Merge pull request #1576 from snyk/fix/do_not_panic_on_aws_init

fix: do not panic on aws provider init
main
Martin 2022-08-04 15:33:08 +02:00 committed by GitHub
commit 25c259dfd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -63,9 +63,14 @@ func NewAWSTerraformProvider(version string, progress enumeration.ProgressCounte
if err != nil { if err != nil {
return nil, err return nil, err
} }
p.session = session.Must(session.NewSessionWithOptions(session.Options{
p.session, err = session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable, SharedConfigState: session.SharedConfigEnable,
})) })
if err != nil {
return nil, err
}
tfProvider, err := terraform.NewTerraformProvider(installer, terraform.TerraformProviderConfig{ tfProvider, err := terraform.NewTerraformProvider(installer, terraform.TerraformProviderConfig{
Name: p.name, Name: p.name,
DefaultAlias: *p.session.Config.Region, DefaultAlias: *p.session.Config.Region,