Documentation ¶
Index ¶
- Constants
- Variables
- func BetaMetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, ...)
- func Convert(item, out interface{}) error
- func ConvertSelfLinkToV1(link string) string
- func GetResourceNameFromSelfLink(link string) string
- func MetadataRetryWrapper(update func() error) error
- func MetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, ...)
- func Provider() terraform.ResourceProvider
- func SignString(toSign []byte, cfg *jwt.Config) ([]byte, error)
- func StoreResourceName(resourceLink interface{}) string
- type BigtableClientFactory
- type ComputeApiVersion
- type ComputeOperationError
- type ComputeOperationWaiter
- type Config
- type ContainerOperationWaiter
- type DataprocClusterOperationWaiter
- type DnsChangeWaiter
- type Feature
- type GlobalFieldValue
- func ParseHttpHealthCheckFieldValue(healthCheck string, d TerraformResourceData, config *Config) (*GlobalFieldValue, error)
- func ParseNetworkFieldValue(network string, d TerraformResourceData, config *Config) (*GlobalFieldValue, error)
- func ParseSslCertificateFieldValue(sslCertificate string, d TerraformResourceData, config *Config) (*GlobalFieldValue, error)
- type InUseFunc
- type LoggingSinkId
- type ResourceManagerOperationWaiter
- type RoleEntity
- type ServiceAccountKeyWaiter
- type ServiceManagementOperationWaiter
- type SpannerDatabaseOperationWaiter
- type SpannerInstanceOperationWaiter
- type SqlAdminOperationError
- type SqlAdminOperationWaiter
- type TerraformResourceData
- type UrlData
- type ZonalFieldValue
Constants ¶
const ( // Copied from the official Google Cloud auto-generated client. ProjectRegex = "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))" RegionRegex = "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" SubnetworkRegex = "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" SubnetworkLinkRegex = "projects/(" + ProjectRegex + ")/regions/(" + RegionRegex + ")/subnetworks/(" + SubnetworkRegex + ")$" )
const COMPUTE_FIREWALL_PRIORITY_DEFAULT = 1000
const FINGERPRINT_RETRIES = 10
Variables ¶
var ( AddressBaseApiVersion = v1 AddressVersionedFeatures = []Feature{ {Version: v0beta, Item: "address_type", DefaultValue: addressTypeExternal}, {Version: v0beta, Item: "subnetwork"}, } )
var FINGERPRINT_FAIL_ERRORS = []string{"Invalid fingerprint.", "Supplied fingerprint does not match current metadata fingerprint."}
var FirewallBaseApiVersion = v1
var FirewallVersionedFeatures = []Feature{ Feature{Version: v0beta, Item: "deny"}, Feature{Version: v0beta, Item: "direction"}, Feature{Version: v0beta, Item: "destination_ranges"}, Feature{Version: v0beta, Item: "priority", DefaultValue: COMPUTE_FIREWALL_PRIORITY_DEFAULT}, Feature{Version: v0beta, Item: "source_service_accounts"}, Feature{Version: v0beta, Item: "target_service_accounts"}, }
var GlobalForwardingRuleBaseApiVersion = v1
var GlobalForwardingRuleVersionedFeatures = []Feature{
{Version: v0beta, Item: "labels"},
}
var InstanceBaseApiVersion = v1
var InstanceGroupManagerBaseApiVersion = v1
var InstanceGroupManagerVersionedFeatures = []Feature{Feature{Version: v0beta, Item: "auto_healing_policies"}}
var InstanceVersionedFeatures = []Feature{
{
Version: v0beta,
Item: "guest_accelerator",
},
{
Version: v0beta,
Item: "min_cpu_platform",
},
}
var OrderedComputeApiVersions = []ComputeApiVersion{
v0beta,
v1,
}
var RegionInstanceGroupManagerBaseApiVersion = v1
var RegionInstanceGroupManagerVersionedFeatures = []Feature{Feature{Version: v0beta, Item: "auto_healing_policies"}}
Functions ¶
func BetaMetadataUpdate ¶ added in v1.0.0
func BetaMetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, serverMD *computeBeta.Metadata)
Update the beta metadata (serverMD) according to the provided diff (oldMDMap v newMDMap).
func Convert ¶ added in v0.1.3
func Convert(item, out interface{}) error
Convert between two types by converting to/from JSON. Intended to switch between multiple API versions, as they are strict supersets of one another. Convert loses information about ForceSendFields and NullFields.
func ConvertSelfLinkToV1 ¶ added in v0.1.3
func GetResourceNameFromSelfLink ¶ added in v1.0.0
func MetadataRetryWrapper ¶
Since the google compute API uses optimistic locking, there is a chance we need to resubmit our updated metadata. To do this, you need to provide an update function that attempts to submit your metadata
func MetadataUpdate ¶
func MetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, serverMD *compute.Metadata)
Update the metadata (serverMD) according to the provided diff (oldMDMap v newMDMap).
func Provider ¶
func Provider() terraform.ResourceProvider
Provider returns a terraform.ResourceProvider.
func SignString ¶
SignString calculates the SHA256 signature of the input string
func StoreResourceName ¶ added in v1.0.0
func StoreResourceName(resourceLink interface{}) string
Types ¶
type BigtableClientFactory ¶ added in v0.1.2
type BigtableClientFactory struct { UserAgent string TokenSource oauth2.TokenSource }
func (BigtableClientFactory) NewAdminClient ¶ added in v0.1.2
func (s BigtableClientFactory) NewAdminClient(project, instance string) (*bigtable.AdminClient, error)
func (BigtableClientFactory) NewInstanceAdminClient ¶ added in v0.1.2
func (s BigtableClientFactory) NewInstanceAdminClient(project string) (*bigtable.InstanceAdminClient, error)
type ComputeApiVersion ¶ added in v0.1.3
type ComputeApiVersion uint8
type ComputeOperationError ¶
type ComputeOperationError compute.OperationError
ComputeOperationError wraps compute.OperationError and implements the error interface so it can be returned.
func (ComputeOperationError) Error ¶
func (e ComputeOperationError) Error() string
type ComputeOperationWaiter ¶
type ComputeOperationWaiter struct { Service *compute.Service Op *compute.Operation Project string }
func (*ComputeOperationWaiter) Conf ¶
func (w *ComputeOperationWaiter) Conf() *resource.StateChangeConf
func (*ComputeOperationWaiter) RefreshFunc ¶
func (w *ComputeOperationWaiter) RefreshFunc() resource.StateRefreshFunc
type Config ¶
type Config struct { Credentials string Project string Region string // contains filtered or unexported fields }
Config is the configuration structure used to instantiate the Google provider.
type ContainerOperationWaiter ¶
type ContainerOperationWaiter struct { Service *container.Service Op *container.Operation Project string Zone string }
func (*ContainerOperationWaiter) Conf ¶
func (w *ContainerOperationWaiter) Conf() *resource.StateChangeConf
func (*ContainerOperationWaiter) RefreshFunc ¶
func (w *ContainerOperationWaiter) RefreshFunc() resource.StateRefreshFunc
type DataprocClusterOperationWaiter ¶ added in v1.2.0
type DataprocClusterOperationWaiter struct { Service *dataproc.Service Op *dataproc.Operation }
func (*DataprocClusterOperationWaiter) Conf ¶ added in v1.2.0
func (w *DataprocClusterOperationWaiter) Conf() *resource.StateChangeConf
func (*DataprocClusterOperationWaiter) RefreshFunc ¶ added in v1.2.0
func (w *DataprocClusterOperationWaiter) RefreshFunc() resource.StateRefreshFunc
type DnsChangeWaiter ¶
type DnsChangeWaiter struct { Service *dns.Service Change *dns.Change Project string ManagedZone string }
func (*DnsChangeWaiter) Conf ¶
func (w *DnsChangeWaiter) Conf() *resource.StateChangeConf
func (*DnsChangeWaiter) RefreshFunc ¶
func (w *DnsChangeWaiter) RefreshFunc() resource.StateRefreshFunc
type Feature ¶ added in v0.1.3
type Feature struct { Version ComputeApiVersion // Path to the beta field. // // The feature is considered to be in-use if the field referenced by "Item" is set in the state. // The path can reference: // - a beta field at the top-level (e.g. "min_cpu_platform"). // - a beta field nested inside a list (e.g. "network_interface.*.alias_ip_range" is considered to be // in-use if the "alias_ip_range" field is set in the state for any of the network interfaces). // // Note: beta field nested inside a SET are NOT supported at the moment. Item string // Optional, only set if your field has a default value. // If the value for the field is equal to the DefaultValue, we assume the beta feature is not activated. DefaultValue interface{} }
A field of a resource and the version of the Compute API required to use it.
func (Feature) HasChangeBy ¶ added in v0.1.3
func (s Feature) HasChangeBy(d TerraformResourceData) bool
Returns true when a feature has been modified. This is most important when updating a resource to remove versioned feature usage; if the resource is reverting to its base version, it needs to perform a final update at the higher version in order to remove high version features.
func (Feature) InUseByDefault ¶ added in v1.1.0
func (s Feature) InUseByDefault(d TerraformResourceData) bool
Return true when a feature appears in schema and doesn't hold the default value.
func (Feature) InUseByUpdate ¶ added in v1.1.0
func (s Feature) InUseByUpdate(d TerraformResourceData) bool
type GlobalFieldValue ¶ added in v1.1.0
type GlobalFieldValue struct { Project string Name string // contains filtered or unexported fields }
func ParseHttpHealthCheckFieldValue ¶ added in v1.2.0
func ParseHttpHealthCheckFieldValue(healthCheck string, d TerraformResourceData, config *Config) (*GlobalFieldValue, error)
func ParseNetworkFieldValue ¶ added in v1.0.0
func ParseNetworkFieldValue(network string, d TerraformResourceData, config *Config) (*GlobalFieldValue, error)
func ParseSslCertificateFieldValue ¶ added in v1.1.1
func ParseSslCertificateFieldValue(sslCertificate string, d TerraformResourceData, config *Config) (*GlobalFieldValue, error)
func (GlobalFieldValue) RelativeLink ¶ added in v1.1.0
func (f GlobalFieldValue) RelativeLink() string
type InUseFunc ¶ added in v1.1.0
type InUseFunc func(d TerraformResourceData, path string, defaultValue interface{}) bool
type LoggingSinkId ¶ added in v1.0.0
type LoggingSinkId struct {
// contains filtered or unexported fields
}
LoggingSinkId represents the parts that make up the canonical id used within terraform for a logging resource.
type ResourceManagerOperationWaiter ¶
type ResourceManagerOperationWaiter struct { Service *cloudresourcemanager.Service Op *cloudresourcemanager.Operation }
func (*ResourceManagerOperationWaiter) Conf ¶
func (w *ResourceManagerOperationWaiter) Conf() *resource.StateChangeConf
func (*ResourceManagerOperationWaiter) RefreshFunc ¶
func (w *ResourceManagerOperationWaiter) RefreshFunc() resource.StateRefreshFunc
type RoleEntity ¶
type ServiceAccountKeyWaiter ¶ added in v1.2.0
type ServiceAccountKeyWaiter struct { Service *iam.ProjectsServiceAccountsKeysService PublicKeyType string KeyName string }
func (*ServiceAccountKeyWaiter) Conf ¶ added in v1.2.0
func (w *ServiceAccountKeyWaiter) Conf() *resource.StateChangeConf
func (*ServiceAccountKeyWaiter) RefreshFunc ¶ added in v1.2.0
func (w *ServiceAccountKeyWaiter) RefreshFunc() resource.StateRefreshFunc
type ServiceManagementOperationWaiter ¶
type ServiceManagementOperationWaiter struct { Service *servicemanagement.APIService Op *servicemanagement.Operation }
func (*ServiceManagementOperationWaiter) Conf ¶
func (w *ServiceManagementOperationWaiter) Conf() *resource.StateChangeConf
func (*ServiceManagementOperationWaiter) RefreshFunc ¶
func (w *ServiceManagementOperationWaiter) RefreshFunc() resource.StateRefreshFunc
type SpannerDatabaseOperationWaiter ¶ added in v0.1.3
type SpannerDatabaseOperationWaiter struct { Service *spanner.Service Op *spanner.Operation }
func (*SpannerDatabaseOperationWaiter) Conf ¶ added in v0.1.3
func (w *SpannerDatabaseOperationWaiter) Conf() *resource.StateChangeConf
func (*SpannerDatabaseOperationWaiter) RefreshFunc ¶ added in v0.1.3
func (w *SpannerDatabaseOperationWaiter) RefreshFunc() resource.StateRefreshFunc
type SpannerInstanceOperationWaiter ¶ added in v0.1.3
type SpannerInstanceOperationWaiter struct { Service *spanner.Service Op *spanner.Operation }
func (*SpannerInstanceOperationWaiter) Conf ¶ added in v0.1.3
func (w *SpannerInstanceOperationWaiter) Conf() *resource.StateChangeConf
func (*SpannerInstanceOperationWaiter) RefreshFunc ¶ added in v0.1.3
func (w *SpannerInstanceOperationWaiter) RefreshFunc() resource.StateRefreshFunc
type SqlAdminOperationError ¶
type SqlAdminOperationError sqladmin.OperationErrors
SqlAdminOperationError wraps sqladmin.OperationError and implements the error interface so it can be returned.
func (SqlAdminOperationError) Error ¶
func (e SqlAdminOperationError) Error() string
type SqlAdminOperationWaiter ¶
type SqlAdminOperationWaiter struct { Service *sqladmin.Service Op *sqladmin.Operation Project string }
func (*SqlAdminOperationWaiter) Conf ¶
func (w *SqlAdminOperationWaiter) Conf() *resource.StateChangeConf
func (*SqlAdminOperationWaiter) RefreshFunc ¶
func (w *SqlAdminOperationWaiter) RefreshFunc() resource.StateRefreshFunc
type TerraformResourceData ¶ added in v0.1.3
type UrlData ¶
type UrlData struct { JwtConfig *jwt.Config ContentMd5 string ContentType string HttpMethod string Expires int HttpHeaders map[string]string Path string }
UrlData stores the values required to create a Signed Url
func (*UrlData) EncodedSignature ¶
EncodedSignature returns the Signature() after base64 encoding and url escaping
func (*UrlData) SignedUrl ¶
SignedUrl constructs the final signed URL a client can use to retrieve storage object
func (*UrlData) SigningString ¶
SigningString creates a string representation of the UrlData in a form ready for signing: see https://cloud.google.com/storage/docs/access-control/create-signed-urls-program Example output: ------------------- GET
1388534400 bucket/objectname -------------------
type ZonalFieldValue ¶ added in v1.1.1
type ZonalFieldValue struct { Project string Zone string Name string // contains filtered or unexported fields }
func ParseDiskFieldValue ¶ added in v1.1.1
func ParseDiskFieldValue(disk string, d TerraformResourceData, config *Config) (*ZonalFieldValue, error)
func (ZonalFieldValue) RelativeLink ¶ added in v1.1.1
func (f ZonalFieldValue) RelativeLink() string
Source Files ¶
- api_versions.go
- bigtable_client_factory.go
- compute_operation.go
- compute_shared_operation.go
- config.go
- container_operation.go
- data_source_compute_lb_ip_ranges.go
- data_source_dns_managed_zone.go
- data_source_google_client_config.go
- data_source_google_compute_instance_group.go
- data_source_google_compute_network.go
- data_source_google_compute_subnetwork.go
- data_source_google_compute_zones.go
- data_source_google_container_engine_versions.go
- data_source_google_iam_policy.go
- data_source_storage_object_signed_url.go
- dataproc_cluster_operation.go
- disk_type.go
- dns_change.go
- field_helpers.go
- image.go
- logging_utils.go
- metadata.go
- node_config.go
- provider.go
- resource_bigquery_dataset.go
- resource_bigquery_table.go
- resource_bigtable_instance.go
- resource_bigtable_table.go
- resource_compute_address.go
- resource_compute_address_migrate.go
- resource_compute_autoscaler.go
- resource_compute_backend_bucket.go
- resource_compute_backend_service.go
- resource_compute_backend_service_migrate.go
- resource_compute_disk.go
- resource_compute_firewall.go
- resource_compute_firewall_migrate.go
- resource_compute_forwarding_rule.go
- resource_compute_global_address.go
- resource_compute_global_forwarding_rule.go
- resource_compute_health_check.go
- resource_compute_http_health_check.go
- resource_compute_https_health_check.go
- resource_compute_image.go
- resource_compute_instance.go
- resource_compute_instance_group.go
- resource_compute_instance_group_manager.go
- resource_compute_instance_group_migrate.go
- resource_compute_instance_migrate.go
- resource_compute_instance_template.go
- resource_compute_instance_template_migrate.go
- resource_compute_network.go
- resource_compute_network_peering.go
- resource_compute_project_metadata.go
- resource_compute_project_metadata_item.go
- resource_compute_region_autoscaler.go
- resource_compute_region_backend_service.go
- resource_compute_region_instance_group_manager.go
- resource_compute_route.go
- resource_compute_router.go
- resource_compute_router_interface.go
- resource_compute_router_peer.go
- resource_compute_shared_vpc_host_project.go
- resource_compute_shared_vpc_service_project.go
- resource_compute_snapshot.go
- resource_compute_ssl_certificate.go
- resource_compute_subnetwork.go
- resource_compute_target_http_proxy.go
- resource_compute_target_https_proxy.go
- resource_compute_target_pool.go
- resource_compute_target_ssl_proxy.go
- resource_compute_target_tcp_proxy.go
- resource_compute_url_map.go
- resource_compute_vpn_gateway.go
- resource_compute_vpn_tunnel.go
- resource_container_cluster.go
- resource_container_cluster_migrate.go
- resource_container_node_pool.go
- resource_container_node_pool_migrate.go
- resource_dataproc_cluster.go
- resource_dns_managed_zone.go
- resource_dns_record_set.go
- resource_google_folder.go
- resource_google_folder_iam_policy.go
- resource_google_organization_policy.go
- resource_google_project.go
- resource_google_project_iam_binding.go
- resource_google_project_iam_member.go
- resource_google_project_iam_policy.go
- resource_google_project_migrate.go
- resource_google_project_service.go
- resource_google_project_services.go
- resource_google_service_account.go
- resource_google_service_account_key.go
- resource_kms_key_ring.go
- resource_logging_billing_account_sink.go
- resource_logging_folder_sink.go
- resource_logging_project_sink.go
- resource_logging_sink.go
- resource_pubsub_subscription.go
- resource_pubsub_topic.go
- resource_runtimeconfig_config.go
- resource_runtimeconfig_variable.go
- resource_source_repos_repository.go
- resource_spanner_database.go
- resource_spanner_instance.go
- resource_sql_database.go
- resource_sql_database_instance.go
- resource_sql_user.go
- resource_sql_user_migrate.go
- resource_storage_bucket.go
- resource_storage_bucket_acl.go
- resource_storage_bucket_object.go
- resource_storage_object_acl.go
- resourcemanager_operation.go
- self_link_helpers.go
- service_account_waiter.go
- service_scope.go
- serviceman_operation.go
- spanner_database_operation.go
- spanner_instance_operation.go
- sqladmin_operation.go
- utils.go
- validation.go