cloudcmd

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: AGPL-3.0 Imports: 35 Imported by: 0

Documentation

Overview

Package cloudcmd provides executable command for the CLI.

This package focuses on the interaction with the cloud provider. It separates the cloud provider specific code from the rest of the CLI, and provides a common interface for all cloud providers.

Exported functions must not be cloud provider specific, but rather take a cloudprovider.Provider as an argument.

User interaction happens in the cmd package, and should not happen or pass through this package.

The backend to this package is currently provided by the terraform package.

SPDX-License-Identifier: AGPL-3.0-only

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewValidator

func NewValidator(cmd *cobra.Command, config config.AttestationCfg, log debugLog) (atls.Validator, error)

NewValidator creates a new Validator.

func UpdateInitMeasurements added in v2.8.0

func UpdateInitMeasurements(config config.AttestationCfg, ownerID, clusterID string) error

UpdateInitMeasurements sets the owner and cluster measurement values.

Types

type AWSIAMConfig added in v2.3.0

type AWSIAMConfig struct {
	Region string
	Prefix string
}

AWSIAMConfig holds the necessary values for AWS IAM configuration.

type AzureIAMConfig added in v2.3.0

type AzureIAMConfig struct {
	Region           string
	ServicePrincipal string
	ResourceGroup    string
}

AzureIAMConfig holds the necessary values for Azure IAM configuration.

type AzurePolicyPatcher added in v2.8.0

type AzurePolicyPatcher struct{}

AzurePolicyPatcher patches attestation policies on Azure.

func NewAzurePolicyPatcher added in v2.8.0

func NewAzurePolicyPatcher() AzurePolicyPatcher

NewAzurePolicyPatcher returns a new AzurePolicyPatcher.

func (AzurePolicyPatcher) Patch added in v2.8.0

func (p AzurePolicyPatcher) Patch(ctx context.Context, attestationURL string) error

Patch updates the attestation policy to the base64-encoded attestation policy JWT for the given attestation URL. https://learn.microsoft.com/en-us/azure/attestation/author-sign-policy#next-steps

type CreateOptions added in v2.8.0

type CreateOptions struct {
	Provider          cloudprovider.Provider
	Config            *config.Config
	InsType           string
	ControlPlaneCount int
	WorkerCount       int

	TFLogLevel terraform.LogLevel
	// contains filtered or unexported fields
}

CreateOptions are the options for creating a Constellation cluster.

type Creator

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

Creator creates cloud resources.

func NewCreator

func NewCreator(out io.Writer) *Creator

NewCreator creates a new creator.

func (*Creator) Create

func (c *Creator) Create(ctx context.Context, opts CreateOptions) (clusterid.File, error)

Create creates the handed amount of instances and all the needed resources.

type GCPIAMConfig added in v2.3.0

type GCPIAMConfig struct {
	Region           string
	Zone             string
	ProjectID        string
	ServiceAccountID string
}

GCPIAMConfig holds the necessary values for GCP IAM configuration.

type IAMConfigOptions added in v2.8.0

type IAMConfigOptions struct {
	GCP        GCPIAMConfig
	Azure      AzureIAMConfig
	AWS        AWSIAMConfig
	TFLogLevel terraform.LogLevel
}

IAMConfigOptions holds the necessary values for IAM configuration.

type IAMCreator added in v2.3.0

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

IAMCreator creates the IAM configuration on the cloud provider.

func NewIAMCreator added in v2.3.0

func NewIAMCreator(out io.Writer) *IAMCreator

NewIAMCreator creates a new IAM creator.

func (*IAMCreator) Create added in v2.3.0

func (c *IAMCreator) Create(ctx context.Context, provider cloudprovider.Provider, opts *IAMConfigOptions) (iamid.File, error)

Create prepares and hands over the corresponding providers IAM creator.

type IAMDestroyer added in v2.6.0

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

IAMDestroyer destroys an IAM configuration.

func NewIAMDestroyer added in v2.6.0

func NewIAMDestroyer(ctx context.Context) (*IAMDestroyer, error)

NewIAMDestroyer creates a new IAM Destroyer.

func (*IAMDestroyer) DestroyIAMConfiguration added in v2.6.0

func (d *IAMDestroyer) DestroyIAMConfiguration(ctx context.Context, logLevel terraform.LogLevel) error

DestroyIAMConfiguration destroys the previously created IAM configuration and deletes the local IAM terraform files.

func (*IAMDestroyer) GetTfstateServiceAccountKey added in v2.6.0

func (d *IAMDestroyer) GetTfstateServiceAccountKey(ctx context.Context) (gcpshared.ServiceAccountKey, error)

GetTfstateServiceAccountKey returns the sa_key output from the terraform state.

type Terminator

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

Terminator deletes cloud provider resources.

func NewTerminator

func NewTerminator() *Terminator

NewTerminator create a new cloud terminator.

func (*Terminator) Terminate

func (t *Terminator) Terminate(ctx context.Context, logLevel terraform.LogLevel) (retErr error)

Terminate deletes the could provider resources.

Jump to

Keyboard shortcuts

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