mirror of
https://github.com/docker/compose.git
synced 2025-07-10 07:14:27 +02:00
Signed-off-by: aiordache <anca.iordache@docker.com> Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
31 lines
588 B
Go
31 lines
588 B
Go
package backend
|
|
|
|
import (
|
|
"github.com/aws/aws-sdk-go/aws"
|
|
"github.com/aws/aws-sdk-go/aws/session"
|
|
"github.com/docker/ecs-plugin/pkg/amazon/sdk"
|
|
)
|
|
|
|
func NewBackend(profile string, region string) (*Backend, error) {
|
|
sess, err := session.NewSessionWithOptions(session.Options{
|
|
Profile: profile,
|
|
SharedConfigState: session.SharedConfigEnable,
|
|
Config: aws.Config{
|
|
Region: aws.String(region),
|
|
},
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &Backend{
|
|
Region: region,
|
|
api: sdk.NewAPI(sess),
|
|
}, nil
|
|
}
|
|
|
|
type Backend struct {
|
|
Region string
|
|
api sdk.API
|
|
}
|