mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-26 00:35:19 -04:00
debugd: add AWS
This commit is contained in:
parent
02602716b5
commit
828923d159
2 changed files with 19 additions and 0 deletions
|
@ -55,6 +55,12 @@ func main() {
|
|||
var fetcher metadata.Fetcher
|
||||
csp := os.Getenv("CONSTEL_CSP")
|
||||
switch platform.FromString(csp) {
|
||||
case platform.AWS:
|
||||
awsFetcher, err := cloudprovider.NewAWS(ctx)
|
||||
if err != nil {
|
||||
log.Fatalf("%s", err)
|
||||
}
|
||||
fetcher = awsFetcher
|
||||
case platform.Azure:
|
||||
azureFetcher, err := cloudprovider.NewAzure(ctx)
|
||||
if err != nil {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
|
||||
awscloud "github.com/edgelesssys/constellation/v2/internal/cloud/aws"
|
||||
azurecloud "github.com/edgelesssys/constellation/v2/internal/cloud/azure"
|
||||
gcpcloud "github.com/edgelesssys/constellation/v2/internal/cloud/gcp"
|
||||
"github.com/edgelesssys/constellation/v2/internal/cloud/metadata"
|
||||
|
@ -46,6 +47,18 @@ func NewGCP(ctx context.Context) (*Fetcher, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
// NewAzure creates a new Azure fetcher.
|
||||
func NewAWS(ctx context.Context) (*Fetcher, error) {
|
||||
metaAPI, err := awscloud.New(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Fetcher{
|
||||
metaAPI: metaAPI,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// NewAzure creates a new Azure fetcher.
|
||||
func NewAzure(ctx context.Context) (*Fetcher, error) {
|
||||
metaAPI, err := azurecloud.NewMetadata(ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue