cloud

package
v2.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GCPRegion         = "europe-west1"
	AWSRegion         = "eu-west-2"
	AzureRegion       = "northeurope"
	ResourceGroupName = "svet-test"
	Subnet1Name       = "atlas-operator-e2e-test-subnet1"
	Subnet2Name       = "atlas-operator-e2e-test-subnet2"
	Subnet1CIDR       = "10.0.0.0/25"
	Subnet2CIDR       = "10.0.0.128/25"
)
View Source
const (
	AzureKeyVaultName = "ako-kms-test"
)
View Source
const (
	// TODO get from GCP
	GoogleProjectID = "atlasoperator" // Google Cloud Project ID

)

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	Region        string
	VPC           string
	CIDR          string
	Subnets       map[string]string
	EnableCleanup bool
}

type AWSPrivateEndpointRequest

type AWSPrivateEndpointRequest struct {
	ID          string
	Region      string
	ServiceName string
}

type AwsAction

type AwsAction struct {
	// contains filtered or unexported fields
}

func NewAWSAction

func NewAWSAction(t core.GinkgoTInterface) (*AwsAction, error)

func (*AwsAction) AcceptVpcPeeringConnection

func (a *AwsAction) AcceptVpcPeeringConnection(connectionID, region string) error

func (*AwsAction) CreateKMS

func (a *AwsAction) CreateKMS(alias, region, atlasAccountArn, assumedRoleArn string) (string, error)

func (*AwsAction) CreatePrivateEndpoint

func (a *AwsAction) CreatePrivateEndpoint(serviceName, privateEndpointName, region string) (string, error)

func (*AwsAction) GetAccountID

func (a *AwsAction) GetAccountID() (string, error)

func (*AwsAction) GetPrivateEndpoint

func (a *AwsAction) GetPrivateEndpoint(endpointID, region string) (*ec2.VpcEndpoint, error)

func (*AwsAction) InitNetwork

func (a *AwsAction) InitNetwork(vpcName, cidr, region string, subnets map[string]string, cleanup bool) (string, error)

type AzureAction

type AzureAction struct {
	// contains filtered or unexported fields
}

func NewAzureAction

func NewAzureAction(t core.GinkgoTInterface, subscriptionID, resourceGroupName string) (*AzureAction, error)

func (*AzureAction) CreateKeyVault

func (a *AzureAction) CreateKeyVault(keyName string) (string, error)

func (*AzureAction) CreatePrivateEndpoint

func (a *AzureAction) CreatePrivateEndpoint(vpcName, subnetName, endpointName, serviceID, region string) (*armnetwork.PrivateEndpoint, error)

func (*AzureAction) GetInterface

func (a *AzureAction) GetInterface(name string) (*armnetwork.Interface, error)

func (*AzureAction) GetPrivateEndpoint

func (a *AzureAction) GetPrivateEndpoint(endpointName string) (*armnetwork.PrivateEndpoint, error)

func (*AzureAction) InitNetwork

func (a *AzureAction) InitNetwork(vpcName, cidr, region string, subnets map[string]string, cleanup bool) (string, error)

type AzureConfig

type AzureConfig struct {
	Region        string
	VPC           string
	CIDR          string
	Subnets       map[string]string
	EnableCleanup bool
}

type AzurePrivateEndpointRequest

type AzurePrivateEndpointRequest struct {
	ID                string
	Region            string
	ServiceResourceID string
	SubnetName        string
}

type GCPAction

type GCPAction struct {
	// contains filtered or unexported fields
}

func NewGCPAction

func NewGCPAction(t core.GinkgoTInterface, projectID string) (*GCPAction, error)

func (*GCPAction) CreateKMS

func (a *GCPAction) CreateKMS() (string, error)

func (*GCPAction) CreateNetworkPeering

func (a *GCPAction) CreateNetworkPeering(vpcName, peerProjectID, peerVPCName string) error

func (*GCPAction) CreatePrivateEndpoint

func (a *GCPAction) CreatePrivateEndpoint(ctx context.Context, name, region, subnet, target string, index int) (string, string, error)

func (*GCPAction) GetForwardingRule

func (a *GCPAction) GetForwardingRule(name, region string, suffixIndex int) (*computepb.ForwardingRule, error)

func (*GCPAction) InitNetwork

func (a *GCPAction) InitNetwork(vpcName, region string, subnets map[string]string, cleanup bool) (string, error)

type GCPConfig

type GCPConfig struct {
	Region        string
	VPC           string
	Subnets       map[string]string
	EnableCleanup bool
}

type GCPPrivateEndpoint

type GCPPrivateEndpoint struct {
	Name string
	IP   string
}

type GCPPrivateEndpointRequest

type GCPPrivateEndpointRequest struct {
	ID         string
	Region     string
	Targets    []string
	SubnetName string
}

type PrivateEndpointDetails

type PrivateEndpointDetails struct {
	ProviderName      provider.ProviderName
	Region            string
	ID                string
	IP                string
	GCPProjectID      string
	EndpointGroupName string
	Endpoints         []GCPPrivateEndpoint
}

type PrivateEndpointRequest

type PrivateEndpointRequest interface {
	// contains filtered or unexported methods
}

type Provider

type Provider interface {
	GetAWSAccountID() string
	SetupNetwork(providerName provider.ProviderName, configs ProviderConfig) string
	SetupPrivateEndpoint(request PrivateEndpointRequest) *PrivateEndpointDetails
	ValidatePrivateEndpointStatus(providerName provider.ProviderName, endpoint, region string, gcpNumAttachments int)
	SetupNetworkPeering(providerName provider.ProviderName, peerID, peerVPC string)
}

type ProviderAction

type ProviderAction struct {
	// contains filtered or unexported fields
}

func NewProviderAction

func NewProviderAction(t core.GinkgoTInterface, aws *AwsAction, gcp *GCPAction, azure *AzureAction) *ProviderAction

func (*ProviderAction) GetAWSAccountID

func (a *ProviderAction) GetAWSAccountID() string

func (*ProviderAction) SetupNetwork

func (a *ProviderAction) SetupNetwork(providerName provider.ProviderName, config ProviderConfig) string

func (*ProviderAction) SetupNetworkPeering

func (a *ProviderAction) SetupNetworkPeering(providerName provider.ProviderName, peerID, peerVPC string)

func (*ProviderAction) SetupPrivateEndpoint

func (a *ProviderAction) SetupPrivateEndpoint(request PrivateEndpointRequest) *PrivateEndpointDetails

func (*ProviderAction) ValidatePrivateEndpointStatus

func (a *ProviderAction) ValidatePrivateEndpointStatus(providerName provider.ProviderName, endpoint, region string, gcpNumAttachments int)

type ProviderConfig

type ProviderConfig func(action *ProviderAction)

func WithAWSConfig

func WithAWSConfig(config *AWSConfig) ProviderConfig

func WithAzureConfig

func WithAzureConfig(config *AzureConfig) ProviderConfig

func WithGCPConfig

func WithGCPConfig(config *GCPConfig) ProviderConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL