v1beta2

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Overview

Package v1beta2 contains API Schema definitions for the terraform v1beta2 API group +kubebuilder:object:generate=true +groupName=terraform.core.oam.dev

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "terraform.core.oam.dev", Version: "v1beta2"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// SecretSuffix used when creating secrets. Secrets will be named in the format: tfstate-{workspace}-{secretSuffix}
	SecretSuffix string `json:"secretSuffix,omitempty"`
	// InClusterConfig Used to authenticate to the cluster from inside a pod. Only `true` is allowed
	InClusterConfig bool `json:"inClusterConfig,omitempty"`

	// Inline allows users to use raw hcl code to specify their Terraform backend
	Inline string `json:"inline,omitempty"`

	// BackendType indicates which backend type to use. This field is needed for custom backend configuration.
	// +kubebuilder:validation:Enum=kubernetes;s3
	BackendType string `json:"backendType,omitempty"`

	// Kubernetes is needed for the Terraform `kubernetes` backend type.
	Kubernetes *KubernetesBackendConf `json:"kubernetes,omitempty"`

	// S3 is needed for the Terraform `s3` backend type.
	S3 *S3BackendConf `json:"s3,omitempty"`
}

Backend describes the Terraform backend configuration

func (*Backend) DeepCopy

func (in *Backend) DeepCopy() *Backend

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend.

func (*Backend) DeepCopyInto

func (in *Backend) DeepCopyInto(out *Backend)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Configuration

type Configuration struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ConfigurationSpec   `json:"spec,omitempty"`
	Status ConfigurationStatus `json:"status,omitempty"`
}

Configuration is the Schema for the configurations API +kubebuilder:storageversion +kubebuilder:subresource:status +kubebuilder:printcolumn:name="APPLY",type="string",JSONPath=".status.apply.state" +kubebuilder:printcolumn:name="DESTROY",type="string",JSONPath=".status.destroy.state" +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"

func (*Configuration) DeepCopy

func (in *Configuration) DeepCopy() *Configuration

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Configuration.

func (*Configuration) DeepCopyInto

func (in *Configuration) DeepCopyInto(out *Configuration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Configuration) DeepCopyObject

func (in *Configuration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ConfigurationApplyStatus

type ConfigurationApplyStatus struct {
	State   apitypes.ConfigurationState `json:"state,omitempty"`
	Message string                      `json:"message,omitempty"`
	Outputs map[string]Property         `json:"outputs,omitempty"`
	// Region is the region for the cloud resources created by this Configuration. If spec.region is not empty, it's the
	// value of it. Otherwise, it's the value of spec.providerReference.region.
	Region string `json:"region,omitempty"`
}

ConfigurationApplyStatus is the status for Configuration apply

func (*ConfigurationApplyStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationApplyStatus.

func (*ConfigurationApplyStatus) DeepCopyInto

func (in *ConfigurationApplyStatus) DeepCopyInto(out *ConfigurationApplyStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConfigurationDestroyStatus

type ConfigurationDestroyStatus struct {
	State   apitypes.ConfigurationState `json:"state,omitempty"`
	Message string                      `json:"message,omitempty"`
}

ConfigurationDestroyStatus is the status for Configuration destroy

func (*ConfigurationDestroyStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationDestroyStatus.

func (*ConfigurationDestroyStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConfigurationList

type ConfigurationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Configuration `json:"items"`
}

ConfigurationList contains a list of Configuration

func (*ConfigurationList) DeepCopy

func (in *ConfigurationList) DeepCopy() *ConfigurationList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationList.

func (*ConfigurationList) DeepCopyInto

func (in *ConfigurationList) DeepCopyInto(out *ConfigurationList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ConfigurationList) DeepCopyObject

func (in *ConfigurationList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ConfigurationSpec

type ConfigurationSpec struct {
	// HCL is the Terraform HCL type configuration
	HCL string `json:"hcl,omitempty"`

	// Remote is a git repo which contains hcl files. Currently, only public git repos are supported.
	Remote string `json:"remote,omitempty"`

	// GitRef is the git branch or tag or commit hash to checkout. Only used when Remote is specified.
	GitRef apitypes.GitRef `json:"gitRef,omitempty"`

	// +kubebuilder:pruning:PreserveUnknownFields
	Variable *runtime.RawExtension `json:"variable,omitempty"`

	// Backend describes the Terraform backend configuration.
	// This field is needed if the users use a git repo to provide the hcl files or
	// want to use their custom Terraform backend (instead of the default kubernetes backend type).
	// Notice: This field may cause two backend blocks in the final Terraform module and make the executor job failed.
	// So, please make sure that there are no backend configurations in your inline hcl code or the git repo.
	Backend *Backend `json:"backend,omitempty"`

	// Path is the sub-directory of remote git repository.
	Path string `json:"path,omitempty"`

	// WriteConnectionSecretToReference specifies the namespace and name of a
	// Secret to which any connection details for this managed resource should
	// be written. Connection details frequently include the endpoint, username,
	// and password required to connect to the managed resource.
	// +optional
	WriteConnectionSecretToReference *types.SecretReference `json:"writeConnectionSecretToRef,omitempty"`

	// ProviderReference specifies the reference to Provider
	ProviderReference *types.Reference `json:"providerRef,omitempty"`
	// +kubebuilder:pruning:PreserveUnknownFields
	JobEnv *runtime.RawExtension `json:"JobEnv,omitempty"`
	// InlineCredentials specifies the credentials in spec.HCl field as below.
	//	provider "aws" {
	//		region     = "us-west-2"
	//		access_key = "my-access-key"
	//		secret_key = "my-secret-key"
	//	}
	// Or indicates a Terraform module or configuration don't need credentials at all, like provider `random`
	InlineCredentials bool `json:"inlineCredentials,omitempty"`

	// DeleteResource will determine whether provisioned cloud resources will be deleted when CR is deleted
	// +kubebuilder:default:=true
	DeleteResource *bool `json:"deleteResource,omitempty"`

	// Region is cloud provider's region. It will override the region in the region field of ProviderReference
	Region string `json:"customRegion,omitempty"`

	// ForceDelete will force delete Configuration no matter which state it is or whether it has provisioned some resources
	// It will help delete Configuration in unexpected cases.
	ForceDelete *bool `json:"forceDelete,omitempty"`

	// GitCredentialsSecretReference specifies the reference to the secret containing the git credentials
	GitCredentialsSecretReference *v1.SecretReference `json:"gitCredentialsSecretReference,omitempty"`

	// TerraformCredentialsSecretReference specifies the reference to the secret containing the terraform credentials and terraform registry details
	TerraformCredentialsSecretReference *v1.SecretReference `json:"terraformCredentialsSecretReference,omitempty"`

	// TerraformRCConfigMapReference specifies the reference to a config map containing the terraform registry configuration
	TerraformRCConfigMapReference *v1.SecretReference `json:"terraformRCConfigMapReference,omitempty"`

	// TerraformCredentialsHelperConfigMapReference specifies the reference to a configmap containing the terraform registry credentials helper
	TerraformCredentialsHelperConfigMapReference *v1.SecretReference `json:"terraformCredentialsHelperConfigMapReference,omitempty"`
}

ConfigurationSpec defines the desired state of Configuration

func (*ConfigurationSpec) DeepCopy

func (in *ConfigurationSpec) DeepCopy() *ConfigurationSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationSpec.

func (*ConfigurationSpec) DeepCopyInto

func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConfigurationStatus

type ConfigurationStatus struct {
	// observedGeneration is the most recent generation observed for this Configuration. It corresponds to the
	// Configuration's generation, which is updated on mutation by the API Server.
	// If ObservedGeneration equals Generation, and State is Available, the value of Outputs is latest
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	Apply   ConfigurationApplyStatus   `json:"apply,omitempty"`
	Destroy ConfigurationDestroyStatus `json:"destroy,omitempty"`
}

ConfigurationStatus defines the observed state of Configuration

func (*ConfigurationStatus) DeepCopy

func (in *ConfigurationStatus) DeepCopy() *ConfigurationStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationStatus.

func (*ConfigurationStatus) DeepCopyInto

func (in *ConfigurationStatus) DeepCopyInto(out *ConfigurationStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type KubernetesBackendConf added in v0.7.1

type KubernetesBackendConf struct {
	SecretSuffix string  `json:"secret_suffix" hcl:"secret_suffix"`
	Namespace    *string `json:"namespace,omitempty" hcl:"namespace"`
}

KubernetesBackendConf defines all options supported by the Terraform `kubernetes` backend type. You can refer to https://www.terraform.io/language/settings/backends/kubernetes for the usage of each option.

func (*KubernetesBackendConf) DeepCopy added in v0.7.1

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesBackendConf.

func (*KubernetesBackendConf) DeepCopyInto added in v0.7.1

func (in *KubernetesBackendConf) DeepCopyInto(out *KubernetesBackendConf)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Property

type Property struct {
	Value string `json:"value,omitempty"`
}

Property is the property for an output

func (*Property) DeepCopy

func (in *Property) DeepCopy() *Property

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Property.

func (*Property) DeepCopyInto

func (in *Property) DeepCopyInto(out *Property)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type S3BackendConf added in v0.7.4

type S3BackendConf struct {
	// Region is optional, default to the AWS_DEFAULT_REGION in the credentials of the provider
	Region *string `json:"region,omitempty" hcl:"region"`
	Bucket string  `json:"bucket" hcl:"bucket"`
	Key    string  `json:"key" hcl:"key"`
}

S3BackendConf defines all options supported by the Terraform `s3` backend type. You can refer to https://www.terraform.io/language/settings/backends/s3 for the usage of each option.

func (*S3BackendConf) DeepCopy added in v0.7.4

func (in *S3BackendConf) DeepCopy() *S3BackendConf

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3BackendConf.

func (*S3BackendConf) DeepCopyInto added in v0.7.4

func (in *S3BackendConf) DeepCopyInto(out *S3BackendConf)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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