mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
debugd: add AWS
This commit is contained in:
parent
02602716b5
commit
828923d159
@ -55,6 +55,12 @@ func main() {
|
|||||||
var fetcher metadata.Fetcher
|
var fetcher metadata.Fetcher
|
||||||
csp := os.Getenv("CONSTEL_CSP")
|
csp := os.Getenv("CONSTEL_CSP")
|
||||||
switch platform.FromString(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:
|
case platform.Azure:
|
||||||
azureFetcher, err := cloudprovider.NewAzure(ctx)
|
azureFetcher, err := cloudprovider.NewAzure(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
|
awscloud "github.com/edgelesssys/constellation/v2/internal/cloud/aws"
|
||||||
azurecloud "github.com/edgelesssys/constellation/v2/internal/cloud/azure"
|
azurecloud "github.com/edgelesssys/constellation/v2/internal/cloud/azure"
|
||||||
gcpcloud "github.com/edgelesssys/constellation/v2/internal/cloud/gcp"
|
gcpcloud "github.com/edgelesssys/constellation/v2/internal/cloud/gcp"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/cloud/metadata"
|
"github.com/edgelesssys/constellation/v2/internal/cloud/metadata"
|
||||||
@ -46,6 +47,18 @@ func NewGCP(ctx context.Context) (*Fetcher, error) {
|
|||||||
}, nil
|
}, 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.
|
// NewAzure creates a new Azure fetcher.
|
||||||
func NewAzure(ctx context.Context) (*Fetcher, error) {
|
func NewAzure(ctx context.Context) (*Fetcher, error) {
|
||||||
metaAPI, err := azurecloud.NewMetadata(ctx)
|
metaAPI, err := azurecloud.NewMetadata(ctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user