gcloud

package
v0.0.0-...-d8c43a0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceTypeArtifactRegistry      = "gcp-artifact-registry"
	ResourceTypeRemoteDockerImagePush = "gcp-docker-image-push"
)
View Source
const (
	AuthTypeGCPServiceAccount    = "gcp-service-account"
	SecretsTypeGCPSecretsManager = "gcp-secrets-manager"

	StateStorageTypeGcpBucket = "gcp-bucket"
	SecretsProviderTypeGcpKms = "gcp-kms"
)
View Source
const (
	ResourceTypeGkeAutopilot = "gcp-gke-autopilot-cluster"
	TemplateTypeGkeAutopilot = "gcp-gke-autopilot"
)
View Source
const ProviderType = "gcp"
View Source
const ResourceTypeBucket = "gcp-bucket"
View Source
const ResourceTypePostgresGcpCloudsql = "gcp-cloudsql-postgres"
View Source
const ResourceTypePubSub = "gcp-pubsub"
View Source
const ResourceTypeRedis = "gcp-redis"
View Source
const (
	TemplateTypeGcpCloudrun = "cloudrun"
)
View Source
const TemplateTypeStaticWebsite = "gcp-static-website"

Variables

This section is empty.

Functions

func ArtifactRegistryConfigReadConfig

func ArtifactRegistryConfigReadConfig(config *api.Config) (api.Config, error)

func DockerRemoteImagePushReadConfig

func DockerRemoteImagePushReadConfig(config *api.Config) (api.Config, error)

func GcpBucketReadConfig

func GcpBucketReadConfig(config *api.Config) (api.Config, error)

func GcpPubSubTopicsReadConfig

func GcpPubSubTopicsReadConfig(config *api.Config) (api.Config, error)

func PostgresqlGcpCloudsqlReadConfig

func PostgresqlGcpCloudsqlReadConfig(config *api.Config) (api.Config, error)

func ReadAuthServiceAccountConfig

func ReadAuthServiceAccountConfig(config *api.Config) (api.Config, error)

func ReadGkeAutopilotResourceConfig

func ReadGkeAutopilotResourceConfig(config *api.Config) (api.Config, error)

func ReadGkeAutopilotTemplateConfig

func ReadGkeAutopilotTemplateConfig(config *api.Config) (api.Config, error)

func ReadSecretsProviderConfig

func ReadSecretsProviderConfig(config *api.Config) (api.Config, error)

func ReadStateStorageConfig

func ReadStateStorageConfig(config *api.Config) (api.Config, error)

func ReadTemplateConfig

func ReadTemplateConfig(config *api.Config) (api.Config, error)

func RedisReadConfig

func RedisReadConfig(config *api.Config) (api.Config, error)

func ToCloudRunConfig

func ToCloudRunConfig(tpl any, composeCfg compose.Config, stackCfg *api.StackConfigCompose) (any, error)

func ToGkeAutopilotConfig

func ToGkeAutopilotConfig(tpl any, composeCfg compose.Config, stackCfg *api.StackConfigCompose) (any, error)

func ToStaticSiteConfig

func ToStaticSiteConfig(tpl any, stackDir, stackName string, stackCfg *api.StackConfigStatic) (any, error)

Types

type AlertsConfig

type AlertsConfig struct {
	MaxErrors MaxErrorConfig
	Discord   DiscordCfg
	Telegram  TelegramCfg
}

type ArtifactRegistryConfig

type ArtifactRegistryConfig struct {
	Credentials `json:",inline" yaml:",inline"`
	Location    string             `json:"location" yaml:"location"`
	Public      *bool              `json:"public,omitempty" yaml:"public,omitempty"`
	Docker      *DockerConfig      `json:"docker,omitempty" yaml:"docker,omitempty"`
	Domain      *string            `json:"domain" yaml:"domain"`
	BasicAuth   *RegistryBasicAuth `json:"basicAuth,omitempty" yaml:"basicAuth,omitempty"`
}

type CloudRunInput

type CloudRunInput struct {
	TemplateConfig `json:"templateConfig" yaml:"templateConfig"`
	Deployment     k8s.DeploymentConfig `json:"deployment" yaml:"deployment"`
}

func (*CloudRunInput) OverriddenBaseZone

func (i *CloudRunInput) OverriddenBaseZone() string

func (*CloudRunInput) Uses

func (i *CloudRunInput) Uses() []string

type Credentials

type Credentials struct {
	api.Credentials      `json:",inline" yaml:",inline"`
	ServiceAccountConfig `json:",inline" yaml:",inline"`
}

func (*Credentials) CredentialsParsed

func (r *Credentials) CredentialsParsed() (*CredentialsParsed, error)

func (*Credentials) CredentialsValue

func (r *Credentials) CredentialsValue() string

func (*Credentials) ProjectIdValue

func (r *Credentials) ProjectIdValue() string

func (*Credentials) ProviderType

func (r *Credentials) ProviderType() string

type CredentialsParsed

type CredentialsParsed struct {
	Type        string `json:"type"`
	ClientEmail string `json:"client_email"`
}

type DiscordCfg

type DiscordCfg struct {
	WebhookId string
}

type DockerConfig

type DockerConfig struct {
	ImmutableTags *bool `json:"immutableTags" yaml:"immutableTags"`
}

type GcpBucket

type GcpBucket struct {
	Credentials `json:",inline" yaml:",inline"`
	Name        string `json:"name,omitempty" yaml:"name"`
	Location    string `json:"location" yaml:"location"`
}

type GkeAutopilotInput

type GkeAutopilotInput struct {
	GkeAutopilotTemplate `json:"templateConfig" yaml:"templateConfig"`
	Deployment           k8s.DeploymentConfig `json:"deployment" yaml:"deployment"`
}

func (*GkeAutopilotInput) DependsOnResources

func (i *GkeAutopilotInput) DependsOnResources() []api.StackConfigDependencyResource

func (*GkeAutopilotInput) OverriddenBaseZone

func (i *GkeAutopilotInput) OverriddenBaseZone() string

func (*GkeAutopilotInput) Uses

func (i *GkeAutopilotInput) Uses() []string

type GkeAutopilotResource

type GkeAutopilotResource struct {
	Credentials   `json:",inline" yaml:",inline"`
	GkeMinVersion string           `json:"gkeMinVersion" yaml:"gkeMinVersion"`
	Location      string           `json:"location" yaml:"location"`
	Zone          string           `json:"zone" yaml:"zone"`
	Timeouts      *Timeouts        `json:"timeouts,omitempty" yaml:"timeouts,omitempty"`
	Caddy         *k8s.CaddyConfig `json:"caddy,omitempty" yaml:"caddy,omitempty"`
}

type GkeAutopilotTemplate

type GkeAutopilotTemplate struct {
	Credentials              `json:",inline" yaml:",inline"`
	GkeClusterResource       string `json:"gkeClusterResource" yaml:"gkeClusterResource"`
	ArtifactRegistryResource string `json:"artifactRegistryResource" yaml:"artifactRegistryResource"`
}

type MaxErrorConfig

type MaxErrorConfig struct {
	ErrorLogMessageRegexp string
	MaxErrorCount         int
}

type PlainLabels

type PlainLabels map[string]string

type PostgresGcpCloudsqlConfig

type PostgresGcpCloudsqlConfig struct {
	Credentials           `json:",inline" yaml:",inline"`
	Version               string                  `json:"version" yaml:"version"`
	Project               string                  `json:"project" yaml:"project"`
	Tier                  *string                 `json:"tier" yaml:"tier"`
	Region                *string                 `json:"region" yaml:"region"`
	MaxConnections        *int                    `json:"maxConnections" yaml:"maxConnections"`
	DeletionProtection    *bool                   `json:"deletionProtection" yaml:"deletionProtection"`
	QueryInsightsEnabled  *bool                   `json:"queryInsightsEnabled" yaml:"queryInsightsEnabled"`
	QueryStringLength     *int                    `json:"queryStringLength" yaml:"queryStringLength"`
	UsersProvisionRuntime *ProvisionRuntimeConfig `json:"usersProvisionRuntime" yaml:"usersProvisionRuntime"`
}

type ProvisionRuntimeConfig

type ProvisionRuntimeConfig struct {
	Type         string `json:"type" yaml:"type"`                 // type of provisioning runtime
	ResourceName string `json:"resourceName" yaml:"resourceName"` // allows to run init db users jobs on kube jobs
}

type PubSubConfig

type PubSubConfig struct {
	Credentials   `json:",inline" yaml:",inline"`
	Topics        []PubSubTopic        `json:"topics" yaml:"topics"`
	Subscriptions []PubSubSubscription `json:"subscriptions" yaml:"subscriptions"`
	Labels        PlainLabels          `json:"labels" yaml:"labels"`
}

type PubSubSubscription

type PubSubSubscription struct {
	Name                     string                            `json:"name" yaml:"name"`
	Topic                    string                            `json:"topic" yaml:"topic"`
	Labels                   PlainLabels                       `json:"labels" yaml:"labels"`
	DeadLetterPolicy         *SubscriptionDeadLetterPolicyArgs `json:"deadLetterPolicy" yaml:"deadLetterPolicy"`
	ExactlyOnceDelivery      bool                              `json:"exactlyOnceDelivery" yaml:"exactlyOnceDelivery"`
	AckDeadlineSec           int                               `json:"ackDeadlineSec" yaml:"ackDeadlineSec"`
	MessageRetentionDuration string                            `json:"messageRetentionDuration" yaml:"messageRetentionDuration"`
}

type PubSubTopic

type PubSubTopic struct {
	Name                     string      `json:"name" yaml:"name"`
	Labels                   PlainLabels `json:"labels" yaml:"labels"`
	MessageRetentionDuration string      `json:"messageRetentionDuration" yaml:"messageRetentionDuration"`
}

type RedisConfig

type RedisConfig struct {
	Credentials  `json:",inline" yaml:",inline"`
	Version      string            `json:"version" yaml:"version"`
	Project      string            `json:"project" yaml:"project"`
	MemorySizeGb int               `json:"memorySizeGb" yaml:"memorySizeGb"`
	RedisConfig  map[string]string `json:"redisConfig" yaml:"redisConfig"`
	Region       *string           `json:"region" yaml:"region"`
}

type RegistryBasicAuth

type RegistryBasicAuth struct {
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
}

type RemoteImagePush

type RemoteImagePush struct {
	Credentials              `json:",inline" yaml:",inline"`
	RemoteImage              string            `json:"remoteImage" yaml:"remoteImage"`
	Name                     string            `json:"name" yaml:"name"`
	Tag                      string            `json:"tag" yaml:"tag"`
	ArtifactRegistryResource string            `json:"artifactRegistryResource" yaml:"artifactRegistryResource"`
	RegistryCredentials      *string           `json:"registryCredentials" yaml:"registryCredentials"` // TODO: support other registries' creds
	Platform                 api.ImagePlatform `json:"platform" yaml:"platform"`
}

func (*RemoteImagePush) DependsOnResources

func (i *RemoteImagePush) DependsOnResources() []api.ParentResourceDependency

type SecretsProviderConfig

type SecretsProviderConfig struct {
	Credentials `json:",inline" yaml:",inline"`
	// format:
	// "gcpkms://projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s"
	KeyName string `json:"keyName" yaml:"keyName"`

	// only applicable when provision=true
	KeyLocation string `json:"keyLocation" yaml:"keyLocation"`
	// only applicable when provision=true
	KeyRotationPeriod string `json:"keyRotationPeriod" yaml:"keyRotationPeriod"`

	// whether to provision key
	Provision bool `json:"provision" yaml:"provision"`
}

func (*SecretsProviderConfig) IsProvisionEnabled

func (r *SecretsProviderConfig) IsProvisionEnabled() bool

func (*SecretsProviderConfig) KeyUrl

func (r *SecretsProviderConfig) KeyUrl() string

type ServiceAccountConfig

type ServiceAccountConfig struct {
	ProjectId string `json:"projectId" yaml:"projectId"`
}

type StateStorageConfig

type StateStorageConfig struct {
	Credentials `json:",inline" yaml:",inline"`
	BucketName  string  `json:"bucketName" yaml:"bucketName"`
	Location    *string `json:"location" yaml:"location"`
	Provision   bool    `json:"provision" yaml:"provision"`
}

func (*StateStorageConfig) IsProvisionEnabled

func (sa *StateStorageConfig) IsProvisionEnabled() bool

func (*StateStorageConfig) StorageUrl

func (sa *StateStorageConfig) StorageUrl() string

type StaticSiteInput

type StaticSiteInput struct {
	TemplateConfig         `json:"templateConfig" yaml:"templateConfig"`
	*api.StackConfigStatic `json:",inline" yaml:",inline"`
	StackDir               string `json:"stackDir" yaml:"stackDir"`
	StackName              string `json:"stackName" yaml:"stackName"`
	Location               string `json:"location" yaml:"location"`
	BaseDnsZone            string `json:"baseDnsZone" yaml:"baseDnsZone"`
}

func (*StaticSiteInput) OverriddenBaseZone

func (i *StaticSiteInput) OverriddenBaseZone() string

type SubscriptionDeadLetterPolicyArgs

type SubscriptionDeadLetterPolicyArgs struct {
	DeadLetterTopic     *string `json:"deadLetterTopic,omitempty" yaml:"deadLetterTopic,omitempty"`
	MaxDeliveryAttempts *int    `json:"maxDeliveryAttempts,omitempty" yaml:"maxDeliveryAttempts,omitempty"`
}

type TelegramCfg

type TelegramCfg struct {
	DefaultChatId string
}

type TemplateConfig

type TemplateConfig struct {
	Credentials `json:",inline" yaml:",inline"`
}

type Timeouts

type Timeouts struct {
	Create string `json:"create" yaml:"create"`
	Update string `json:"update" yaml:"update"`
	Delete string `json:"delete" yaml:"delete"`
}

Jump to

Keyboard shortcuts

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