Documentation
¶
Overview ¶
Package cloudcmd provides executable commands 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, perform CSP specific logic, and return a universally usable result.
It is used by the "cmd" to handle creation of cloud resources and other CSP specific interactions. 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.
Copyright (c) Edgeless Systems GmbH ¶
SPDX-License-Identifier: AGPL-3.0-only
Index ¶
- func GetMarshaledServiceAccountURI(provider cloudprovider.Provider, config *config.Config, ...) (string, error)
- func NewValidator(cmd *cobra.Command, config config.AttestationCfg, log debugLog) (atls.Validator, error)
- func TerraformUpgradeVars(conf *config.Config, imageRef string) (terraform.Variables, error)
- func UpdateInitMeasurements(config config.AttestationCfg, ownerID, clusterID string) error
- type AWSIAMConfig
- type AWSIAMOutput
- type AzureIAMConfig
- type AzureIAMOutput
- type AzurePolicyPatcher
- type CreateOptions
- type Creator
- type GCPIAMConfig
- type GCPIAMOutput
- type IAMConfigOptions
- type IAMCreator
- type IAMDestroyer
- type IAMOutput
- type Terminator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMarshaledServiceAccountURI ¶ added in v2.10.0
func GetMarshaledServiceAccountURI(provider cloudprovider.Provider, config *config.Config, pf pathprefix.PathPrefixer, log debugLog, fileHandler file.Handler, ) (string, error)
GetMarshaledServiceAccountURI returns the service account URI for the given cloud provider.
func NewValidator ¶
func NewValidator(cmd *cobra.Command, config config.AttestationCfg, log debugLog) (atls.Validator, error)
NewValidator creates a new Validator.
func TerraformUpgradeVars ¶ added in v2.10.0
TerraformUpgradeVars returns variables required to execute the Terraform scripts.
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
AWSIAMConfig holds the necessary values for AWS IAM configuration.
type AWSIAMOutput ¶ added in v2.10.0
type AWSIAMOutput struct {
ControlPlaneInstanceProfile string `json:"controlPlaneInstanceProfile,omitempty"`
WorkerNodeInstanceProfile string `json:"workerNodeInstanceProfile,omitempty"`
}
AWSIAMOutput contains the output information of an AWS IAM configuration.
type AzureIAMConfig ¶ added in v2.3.0
AzureIAMConfig holds the necessary values for Azure IAM configuration.
type AzureIAMOutput ¶ added in v2.10.0
type AzureIAMOutput struct {
SubscriptionID string `json:"subscriptionID,omitempty"`
TenantID string `json:"tenantID,omitempty"`
UAMIID string `json:"uamiID,omitempty"`
}
AzureIAMOutput contains the output information of a Microsoft 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
TFWorkspace string
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.
type GCPIAMConfig ¶ added in v2.3.0
GCPIAMConfig holds the necessary values for GCP IAM configuration.
type GCPIAMOutput ¶ added in v2.10.0
type GCPIAMOutput struct {
ServiceAccountKey string `json:"serviceAccountID,omitempty"`
}
GCPIAMOutput contains the output information of a GCP IAM configuration.
type IAMConfigOptions ¶ added in v2.8.0
type IAMConfigOptions struct {
GCP GCPIAMConfig
Azure AzureIAMConfig
AWS AWSIAMConfig
TFLogLevel terraform.LogLevel
TFWorkspace string
}
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) (IAMOutput, 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() *IAMDestroyer
NewIAMDestroyer creates a new IAM Destroyer.
func (*IAMDestroyer) DestroyIAMConfiguration ¶ added in v2.6.0
func (d *IAMDestroyer) DestroyIAMConfiguration(ctx context.Context, tfWorkspace string, logLevel terraform.LogLevel) error
DestroyIAMConfiguration destroys the previously created IAM configuration and deletes the local IAM terraform files.
func (*IAMDestroyer) GetTfStateServiceAccountKey ¶ added in v2.10.0
func (d *IAMDestroyer) GetTfStateServiceAccountKey(ctx context.Context, tfWorkspace string) (gcpshared.ServiceAccountKey, error)
GetTfStateServiceAccountKey returns the sa_key output from the terraform state.
type IAMOutput ¶ added in v2.10.0
type IAMOutput struct {
// CloudProvider is the cloud provider of the cluster.
CloudProvider cloudprovider.Provider `json:"cloudprovider,omitempty"`
GCPOutput GCPIAMOutput `json:"gcpOutput,omitempty"`
AzureOutput AzureIAMOutput `json:"azureOutput,omitempty"`
AWSOutput AWSIAMOutput `json:"awsOutput,omitempty"`
}
IAMOutput is the output of creating a new IAM profile.
type Terminator ¶
type Terminator struct {
// contains filtered or unexported fields
}
Terminator deletes cloud provider resources.