gcp

package
v0.1.58 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACLPublicRead     = "publicRead"
	ACLProjectPrivate = "projectPrivate"

	OperationDone       = "DONE"
	CloudRunReady       = "Ready"
	CloudRunStatusTrue  = "True"
	CloudRunStatusFalse = "False"

	GCSProxyImageName   = "nginx-gcs-static-proxy"
	GCSProxyVersion     = "1.21-v5"
	GCSProxyDockerImage = "docker.io/outblocks/nginx-gcs-static-proxy:" + GCSProxyVersion
	RunsdDownloadLink   = "https://github.com/ahmetb/runsd/releases/download/v0.0.0-rc.15/runsd"
	CloudSQLVersion     = "1.28.1"

	DefaultConcurrency = 5
)
View Source
const (
	URLPathMatcherServiceIDKey         = "service_id"
	URLPathMatcherPathPrefixRewriteKey = "path_redirect"
)

Variables

View Source
var (
	APISRequired = []string{"run.googleapis.com", "containerregistry.googleapis.com", "compute.googleapis.com", "sqladmin.googleapis.com", "secretmanager.googleapis.com"}
	ValidRegions = []string{"asia-east1", "asia-east2", "asia-northeast1", "asia-northeast2", "asia-northeast3", "asia-south1", "asia-southeast1", "australia-southeast1", "europe-north1", "europe-west1", "europe-west2", "europe-west3", "europe-west4", "europe-west6", "northamerica-northeast1", "southamerica-east1", "us-central1", "us-east1", "us-east4", "us-west1", "us-west2", "us-west3"}
)

Functions

func ErrIs403 added in v0.1.16

func ErrIs403(err error) bool

func ErrIs404

func ErrIs404(err error) bool

func GenericID added in v0.1.37

func GenericID(id string, suffixes ...string) string

func GlobalID added in v0.1.15

func GlobalID(e env.Enver, gcpProject, id string) string

func GlobalIDField added in v0.1.37

func GlobalIDField(e env.Enver, gcpProject, resourceID string) fields.StringInputField

func GlobalRandomIDField added in v0.1.49

func GlobalRandomIDField(e env.Enver, gcpProject, resourceID string) fields.StringInputField

func ID

func ID(e env.Enver, resourceID string) string

func IDField added in v0.1.37

func IDField(e env.Enver, resourceID string) fields.StringInputField

func ImageID added in v0.1.52

func ImageID(e env.Enver, imageID string) string

func RandomIDField added in v0.1.42

func RandomIDField(e env.Enver, resourceID string) fields.StringInputField

func RegionToGCR

func RegionToGCR(region string) string

func ShortShaID added in v0.1.31

func ShortShaID(id string) string

func SplitURL added in v0.1.5

func SplitURL(url string) (host, path string)

func WaitForCloudResourceManagerOperation added in v0.1.6

func WaitForCloudResourceManagerOperation(cli *cloudresourcemanager.Service, op *cloudresourcemanager.Operation) error

func WaitForGlobalComputeOperation added in v0.1.5

func WaitForGlobalComputeOperation(cli *compute.Service, project, name string) error

func WaitForRegionComputeOperation added in v0.1.5

func WaitForRegionComputeOperation(cli *compute.Service, project, region, name string) error

func WaitForSQLOperation added in v0.1.19

func WaitForSQLOperation(ctx context.Context, cli *sqladmin.Service, project, name string) error

func WaitForServiceUsageOperation added in v0.1.5

func WaitForServiceUsageOperation(cli *serviceusage.Service, op *serviceusage.Operation) error

Types

type APIService

type APIService struct {
	registry.ResourceBase

	ProjectNumber fields.IntInputField    `state:"force_new"`
	Name          fields.StringInputField `state:"force_new"`
}

func (*APIService) Create

func (o *APIService) Create(ctx context.Context, meta interface{}) error

func (*APIService) Delete

func (o *APIService) Delete(ctx context.Context, meta interface{}) error

func (*APIService) GetName

func (o *APIService) GetName() string

func (*APIService) Read

func (o *APIService) Read(ctx context.Context, meta interface{}) error

func (*APIService) ReferenceID added in v0.1.42

func (o *APIService) ReferenceID() string

func (*APIService) Update

func (o *APIService) Update(ctx context.Context, meta interface{}) error

type Address

type Address struct {
	registry.ResourceBase

	Name      fields.StringInputField `state:"force_new"`
	ProjectID fields.StringInputField `state:"force_new"`
	IP        fields.StringOutputField
}

func (*Address) Create

func (o *Address) Create(ctx context.Context, meta interface{}) error

func (*Address) Delete

func (o *Address) Delete(ctx context.Context, meta interface{}) error

func (*Address) GetName

func (o *Address) GetName() string

func (*Address) Read

func (o *Address) Read(ctx context.Context, meta interface{}) error

func (*Address) ReferenceID added in v0.1.42

func (o *Address) ReferenceID() string

func (*Address) Update

func (o *Address) Update(ctx context.Context, meta interface{}) error

type BackendService

type BackendService struct {
	registry.ResourceBase

	Name      fields.StringInputField `state:"force_new"`
	ProjectID fields.StringInputField `state:"force_new"`
	NEG       fields.StringInputField `state:"force_new"`

	CDN struct {
		Enabled        fields.BoolInputField
		CacheMode      fields.StringInputField `default:"CACHE_ALL_STATIC"`
		CacheKeyPolicy struct {
			IncludeHost        fields.BoolInputField `default:"1"`
			IncludeProtocol    fields.BoolInputField `default:"1"`
			IncludeQueryString fields.BoolInputField `default:"1"`
		}
		DefaultTTL fields.IntInputField `default:"3600"`
		MaxTTL     fields.IntInputField `default:"86400"`
		ClientTTL  fields.IntInputField `default:"3600"`
	}

	Fingerprint string `state:"-"`
}

func (*BackendService) Create

func (o *BackendService) Create(ctx context.Context, meta interface{}) error

func (*BackendService) Delete

func (o *BackendService) Delete(ctx context.Context, meta interface{}) error

func (*BackendService) GetName

func (o *BackendService) GetName() string

func (*BackendService) Read

func (o *BackendService) Read(ctx context.Context, meta interface{}) error

func (*BackendService) RefField added in v0.1.21

func (o *BackendService) RefField() fields.StringInputField

func (*BackendService) ReferenceID added in v0.1.42

func (o *BackendService) ReferenceID() string

func (*BackendService) Update

func (o *BackendService) Update(ctx context.Context, meta interface{}) error

type Bucket

type Bucket struct {
	registry.ResourceBase

	Name       fields.StringInputField `state:"force_new"`
	Location   fields.StringInputField `state:"force_new"`
	ProjectID  fields.StringInputField
	Versioning fields.BoolInputField
}

func (*Bucket) Create

func (o *Bucket) Create(ctx context.Context, meta interface{}) error

func (*Bucket) Delete

func (o *Bucket) Delete(ctx context.Context, meta interface{}) error

func (*Bucket) GetName

func (o *Bucket) GetName() string

func (*Bucket) Read

func (o *Bucket) Read(ctx context.Context, meta interface{}) error

func (*Bucket) ReferenceID added in v0.1.42

func (o *Bucket) ReferenceID() string

func (*Bucket) Update

func (o *Bucket) Update(ctx context.Context, meta interface{}) error

type BucketObject

type BucketObject struct {
	registry.ResourceBase

	BucketName   fields.StringInputField `state:"force_new"`
	ContentType  fields.StringInputField
	Name         fields.StringInputField `state:"force_new"`
	Hash         fields.StringInputField
	IsPublic     fields.BoolInputField
	CacheControl fields.StringInputField

	Path string `state:"-"`
}

func (*BucketObject) Create

func (o *BucketObject) Create(ctx context.Context, meta interface{}) error

func (*BucketObject) Delete

func (o *BucketObject) Delete(ctx context.Context, meta interface{}) error

func (*BucketObject) GetName

func (o *BucketObject) GetName() string

func (*BucketObject) Read

func (o *BucketObject) Read(ctx context.Context, meta interface{}) error

func (*BucketObject) ReferenceID added in v0.1.42

func (o *BucketObject) ReferenceID() string

func (*BucketObject) Update

func (o *BucketObject) Update(ctx context.Context, meta interface{}) error

type CloudRun

type CloudRun struct {
	registry.ResourceBase

	Name      fields.StringInputField `state:"force_new"`
	ProjectID fields.StringInputField `state:"force_new"`
	Region    fields.StringInputField `state:"force_new"`
	Image     fields.StringInputField
	IsPublic  fields.BoolInputField

	URL           fields.StringOutputField `state:"static"`
	Ready         fields.BoolOutputField
	StatusMessage fields.StringOutputField

	CloudSQLInstances    fields.StringInputField
	MinScale             fields.IntInputField    `default:"0"`
	MaxScale             fields.IntInputField    `default:"100"`
	CPULimit             fields.StringInputField `default:"1000m"`
	MemoryLimit          fields.StringInputField `default:"128Mi"`
	ContainerConcurrency fields.IntInputField    `default:"250"`
	TimeoutSeconds       fields.IntInputField    `default:"300"`
	Port                 fields.IntInputField    `default:"80"`
	EnvVars              fields.MapInputField
	Ingress              fields.StringInputField `default:"all"` // options: internal-and-cloud-load-balancing
}

func (*CloudRun) Create

func (o *CloudRun) Create(ctx context.Context, meta interface{}) error

func (*CloudRun) Delete

func (o *CloudRun) Delete(ctx context.Context, meta interface{}) error

func (*CloudRun) GetName

func (o *CloudRun) GetName() string

func (*CloudRun) Read

func (o *CloudRun) Read(ctx context.Context, meta interface{}) error

func (*CloudRun) ReferenceID added in v0.1.42

func (o *CloudRun) ReferenceID() string

func (*CloudRun) Update

func (o *CloudRun) Update(ctx context.Context, meta interface{}) error

type CloudSQL added in v0.1.19

type CloudSQL struct {
	registry.ResourceBase

	Name            fields.StringInputField `state:"force_new"`
	ProjectID       fields.StringInputField `state:"force_new"`
	Region          fields.StringInputField `state:"force_new"`
	DatabaseVersion fields.StringInputField `state:"force_new"`

	PublicIP       fields.StringOutputField
	PrivateIP      fields.StringOutputField
	ConnectionName fields.StringOutputField `state:"static"`

	Tier             fields.StringInputField `default:"db-f1-micro"`
	AvailabilityZone fields.StringInputField `default:"ZONAL"`

	IPConfiguration struct {
		Ipv4Enabled fields.BoolInputField `default:"true"`
	}

	BackupConfiguration struct {
		Enabled   fields.BoolInputField   `default:"true"`
		StartTime fields.StringInputField `default:"05:00"`
	}

	DatabaseFlags fields.MapInputField

	SettingsVersion int64 `state:"-"`
}

func (*CloudSQL) Create added in v0.1.19

func (o *CloudSQL) Create(ctx context.Context, meta interface{}) error

func (*CloudSQL) Delete added in v0.1.19

func (o *CloudSQL) Delete(ctx context.Context, meta interface{}) error

func (*CloudSQL) GetName added in v0.1.19

func (o *CloudSQL) GetName() string

func (*CloudSQL) IsCritical added in v0.1.39

func (o *CloudSQL) IsCritical(t registry.DiffType, fieldList []string) bool

func (*CloudSQL) Read added in v0.1.19

func (o *CloudSQL) Read(ctx context.Context, meta interface{}) error

func (*CloudSQL) ReferenceID added in v0.1.42

func (o *CloudSQL) ReferenceID() string

func (*CloudSQL) Update added in v0.1.19

func (o *CloudSQL) Update(ctx context.Context, meta interface{}) error

type CloudSQLDatabase added in v0.1.19

type CloudSQLDatabase struct {
	registry.ResourceBase

	ProjectID fields.StringInputField `state:"force_new"`
	Instance  fields.StringInputField `state:"force_new"`
	Name      fields.StringInputField `state:"force_new"`
}

func (*CloudSQLDatabase) Create added in v0.1.19

func (o *CloudSQLDatabase) Create(ctx context.Context, meta interface{}) error

func (*CloudSQLDatabase) Delete added in v0.1.19

func (o *CloudSQLDatabase) Delete(ctx context.Context, meta interface{}) error

func (*CloudSQLDatabase) GetName added in v0.1.19

func (o *CloudSQLDatabase) GetName() string

func (*CloudSQLDatabase) IsCritical added in v0.1.39

func (o *CloudSQLDatabase) IsCritical(t registry.DiffType, fieldList []string) bool

func (*CloudSQLDatabase) Read added in v0.1.19

func (o *CloudSQLDatabase) Read(ctx context.Context, meta interface{}) error

func (*CloudSQLDatabase) ReferenceID added in v0.1.42

func (o *CloudSQLDatabase) ReferenceID() string

func (*CloudSQLDatabase) Update added in v0.1.19

func (o *CloudSQLDatabase) Update(ctx context.Context, meta interface{}) error

type CloudSQLUser added in v0.1.19

type CloudSQLUser struct {
	registry.ResourceBase

	ProjectID fields.StringInputField `state:"force_new"`
	Instance  fields.StringInputField `state:"force_new"`
	Name      fields.StringInputField `state:"force_new"`
	Password  fields.StringInputField
}

func (*CloudSQLUser) Create added in v0.1.19

func (o *CloudSQLUser) Create(ctx context.Context, meta interface{}) error

func (*CloudSQLUser) Delete added in v0.1.19

func (o *CloudSQLUser) Delete(ctx context.Context, meta interface{}) error

func (*CloudSQLUser) GetName added in v0.1.19

func (o *CloudSQLUser) GetName() string

func (*CloudSQLUser) Read added in v0.1.19

func (o *CloudSQLUser) Read(ctx context.Context, meta interface{}) error

func (*CloudSQLUser) ReferenceID added in v0.1.42

func (o *CloudSQLUser) ReferenceID() string

func (*CloudSQLUser) Update added in v0.1.19

func (o *CloudSQLUser) Update(ctx context.Context, meta interface{}) error

type ForwardingRule

type ForwardingRule struct {
	registry.ResourceBase

	Name      fields.StringInputField `state:"force_new"`
	ProjectID fields.StringInputField `state:"force_new"`
	IPAddress fields.StringInputField `state:"force_new"`
	Target    fields.StringInputField
	PortRange fields.StringInputField

	Fingerprint string `state:"-"`
}

func (*ForwardingRule) Create

func (o *ForwardingRule) Create(ctx context.Context, meta interface{}) error

func (*ForwardingRule) Delete

func (o *ForwardingRule) Delete(ctx context.Context, meta interface{}) error

func (*ForwardingRule) GetName

func (o *ForwardingRule) GetName() string

func (*ForwardingRule) Read

func (o *ForwardingRule) Read(ctx context.Context, meta interface{}) error

func (*ForwardingRule) ReferenceID added in v0.1.42

func (o *ForwardingRule) ReferenceID() string

func (*ForwardingRule) Update

func (o *ForwardingRule) Update(ctx context.Context, meta interface{}) error

type Image

type Image struct {
	registry.ResourceBase

	Name       fields.StringInputField `state:"force_new"`
	Tag        fields.StringInputField `state:"force_new"`
	ProjectID  fields.StringInputField `state:"force_new"`
	GCR        fields.StringInputField `state:"force_new"`
	Digest     fields.StringOutputField
	Source     fields.StringInputField
	SourceHash fields.StringInputField

	Pull bool `state:"-"`
}

func (*Image) BeforeDiff added in v0.1.14

func (o *Image) BeforeDiff()

func (*Image) Create

func (o *Image) Create(ctx context.Context, meta interface{}) error

func (*Image) Delete

func (o *Image) Delete(ctx context.Context, meta interface{}) error

func (*Image) GetName

func (o *Image) GetName() string

func (*Image) ImageName

func (o *Image) ImageName() fields.StringInputField

func (*Image) Read

func (o *Image) Read(ctx context.Context, meta interface{}) error

func (*Image) ReferenceID added in v0.1.42

func (o *Image) ReferenceID() string

func (*Image) Update

func (o *Image) Update(ctx context.Context, meta interface{}) error

type ManagedSSL

type ManagedSSL struct {
	registry.ResourceBase

	Name         fields.StringInputField `state:"force_new"`
	ProjectID    fields.StringInputField `state:"force_new"`
	Domains      fields.ArrayInputField  `state:"force_new"`
	Status       fields.StringOutputField
	DomainStatus fields.MapOutputField
}

func (*ManagedSSL) Create

func (o *ManagedSSL) Create(ctx context.Context, meta interface{}) error

func (*ManagedSSL) Delete

func (o *ManagedSSL) Delete(ctx context.Context, meta interface{}) error

func (*ManagedSSL) GetName

func (o *ManagedSSL) GetName() string

func (*ManagedSSL) Init added in v0.1.14

func (o *ManagedSSL) Init(ctx context.Context, meta interface{}, opts *registry.Options) error

func (*ManagedSSL) Read

func (o *ManagedSSL) Read(ctx context.Context, meta interface{}) error

func (*ManagedSSL) RefField added in v0.1.21

func (o *ManagedSSL) RefField() fields.StringInputField

func (*ManagedSSL) ReferenceID added in v0.1.42

func (o *ManagedSSL) ReferenceID() string

func (*ManagedSSL) Update

func (o *ManagedSSL) Update(ctx context.Context, meta interface{}) error

type SelfManagedSSL added in v0.1.43

type SelfManagedSSL struct {
	registry.ResourceBase

	Name        fields.StringInputField `state:"force_new"`
	ProjectID   fields.StringInputField `state:"force_new"`
	Certificate fields.StringInputField `state:"force_new"`
	PrivateKey  fields.StringInputField `state:"force_new"`
}

func (*SelfManagedSSL) Create added in v0.1.43

func (o *SelfManagedSSL) Create(ctx context.Context, meta interface{}) error

func (*SelfManagedSSL) Delete added in v0.1.43

func (o *SelfManagedSSL) Delete(ctx context.Context, meta interface{}) error

func (*SelfManagedSSL) GetName added in v0.1.43

func (o *SelfManagedSSL) GetName() string

func (*SelfManagedSSL) Read added in v0.1.43

func (o *SelfManagedSSL) Read(ctx context.Context, meta interface{}) error

func (*SelfManagedSSL) RefField added in v0.1.43

func (o *SelfManagedSSL) RefField() fields.StringInputField

func (*SelfManagedSSL) ReferenceID added in v0.1.43

func (o *SelfManagedSSL) ReferenceID() string

func (*SelfManagedSSL) Update added in v0.1.43

func (o *SelfManagedSSL) Update(ctx context.Context, meta interface{}) error

type ServerlessNEG

type ServerlessNEG struct {
	registry.ResourceBase

	Name      fields.StringInputField `state:"force_new"`
	ProjectID fields.StringInputField `state:"force_new"`
	Region    fields.StringInputField `state:"force_new"`
	CloudRun  fields.StringInputField `state:"force_new"`
}

func (*ServerlessNEG) Create

func (o *ServerlessNEG) Create(ctx context.Context, meta interface{}) error

func (*ServerlessNEG) Delete

func (o *ServerlessNEG) Delete(ctx context.Context, meta interface{}) error

func (*ServerlessNEG) GetName

func (o *ServerlessNEG) GetName() string

func (*ServerlessNEG) Read

func (o *ServerlessNEG) Read(ctx context.Context, meta interface{}) error

func (*ServerlessNEG) RefField added in v0.1.21

func (o *ServerlessNEG) RefField() fields.StringInputField

func (*ServerlessNEG) ReferenceID added in v0.1.42

func (o *ServerlessNEG) ReferenceID() string

func (*ServerlessNEG) Update

func (o *ServerlessNEG) Update(ctx context.Context, meta interface{}) error

type TargetHTTPProxy

type TargetHTTPProxy struct {
	registry.ResourceBase

	Name      fields.StringInputField `state:"force_new"`
	ProjectID fields.StringInputField `state:"force_new"`
	URLMap    fields.StringInputField

	Fingerprint string `state:"-"`
}

func (*TargetHTTPProxy) Create

func (o *TargetHTTPProxy) Create(ctx context.Context, meta interface{}) error

func (*TargetHTTPProxy) Delete

func (o *TargetHTTPProxy) Delete(ctx context.Context, meta interface{}) error

func (*TargetHTTPProxy) GetName

func (o *TargetHTTPProxy) GetName() string

func (*TargetHTTPProxy) Read

func (o *TargetHTTPProxy) Read(ctx context.Context, meta interface{}) error

func (*TargetHTTPProxy) RefField added in v0.1.21

func (o *TargetHTTPProxy) RefField() fields.StringInputField

func (*TargetHTTPProxy) ReferenceID added in v0.1.42

func (o *TargetHTTPProxy) ReferenceID() string

func (*TargetHTTPProxy) Update

func (o *TargetHTTPProxy) Update(ctx context.Context, meta interface{}) error

type TargetHTTPSProxy

type TargetHTTPSProxy struct {
	registry.ResourceBase

	Name            fields.StringInputField `state:"force_new"`
	ProjectID       fields.StringInputField `state:"force_new"`
	URLMap          fields.StringInputField
	SSLCertificates fields.ArrayInputField

	Fingerprint string `state:"-"`
}

func (*TargetHTTPSProxy) Create

func (o *TargetHTTPSProxy) Create(ctx context.Context, meta interface{}) error

func (*TargetHTTPSProxy) Delete

func (o *TargetHTTPSProxy) Delete(ctx context.Context, meta interface{}) error

func (*TargetHTTPSProxy) GetName

func (o *TargetHTTPSProxy) GetName() string

func (*TargetHTTPSProxy) Read

func (o *TargetHTTPSProxy) Read(ctx context.Context, meta interface{}) error

func (*TargetHTTPSProxy) RefField added in v0.1.21

func (*TargetHTTPSProxy) ReferenceID added in v0.1.42

func (o *TargetHTTPSProxy) ReferenceID() string

func (*TargetHTTPSProxy) Update

func (o *TargetHTTPSProxy) Update(ctx context.Context, meta interface{}) error

type URLMap

type URLMap struct {
	registry.ResourceBase

	Name       fields.StringInputField `state:"force_new"`
	ProjectID  fields.StringInputField `state:"force_new"`
	URLMapping fields.MapInputField
	AppMapping fields.MapInputField

	Fingerprint string `state:"-"`
}

func (*URLMap) Create

func (o *URLMap) Create(ctx context.Context, meta interface{}) error

func (*URLMap) Delete

func (o *URLMap) Delete(ctx context.Context, meta interface{}) error

func (*URLMap) GetName

func (o *URLMap) GetName() string

func (*URLMap) Read

func (o *URLMap) Read(ctx context.Context, meta interface{}) error

func (*URLMap) RefField added in v0.1.21

func (o *URLMap) RefField() fields.StringInputField

func (*URLMap) ReferenceID added in v0.1.42

func (o *URLMap) ReferenceID() string

func (*URLMap) Update

func (o *URLMap) Update(ctx context.Context, meta interface{}) error

type URLMapping

type URLMapping struct {
	Host        string
	PathMatcher []*URLPathMatcher
}

type URLPathMatcher

type URLPathMatcher struct {
	Paths             []string
	ServiceID         string
	PathPrefixRewrite string
}

Jump to

Keyboard shortcuts

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