Documentation
¶
Index ¶
- Constants
- Variables
- func CheckSchemaAttributesMatch(t *testing.T, rAttributes map[string]resource_schema.Attribute, ...)
- func HookGlobal[T any](ptr *T, val T) func()
- func IsKnown[T Knowable](t T) bool
- func New(version string) func() tf_provider.Provider
- func NewAPIKeyResource() resource.Resource
- func NewAllowlistResource() resource.Resource
- func NewBackupsDataSource() datasource.DataSource
- func NewBlackoutWindowDataSource() datasource.DataSource
- func NewBlackoutWindowResource() resource.Resource
- func NewCMEKResource() resource.Resource
- func NewClientCACertResource() resource.Resource
- func NewClusterCertDataSource() datasource.DataSource
- func NewClusterDataSource() datasource.DataSource
- func NewClusterResource() resource.Resource
- func NewConnectionStringDataSource() datasource.DataSource
- func NewDatabaseResource() resource.Resource
- func NewEgressPrivateEndpointDomainNamesResource() resource.Resource
- func NewEgressPrivateEndpointResource() resource.Resource
- func NewFinalizeVersionUpgradeResource() resource.Resource
- func NewFolderDataSource() datasource.DataSource
- func NewFolderResource() resource.Resource
- func NewJWTIssuerResource() resource.Resource
- func NewLogExportConfigResource() resource.Resource
- func NewMaintenanceWindowResource() resource.Resource
- func NewMetricExportCloudWatchConfigResource() resource.Resource
- func NewMetricExportDatadogConfigResource() resource.Resource
- func NewMetricExportPrometheusConfigResource() resource.Resource
- func NewOrganizationDataSource() datasource.DataSource
- func NewPersonUserDataSource() datasource.DataSource
- func NewPhysicalReplicationStreamResource() resource.Resource
- func NewPrivateEndpointConnectionResource() resource.Resource
- func NewPrivateEndpointServicesResource() resource.Resource
- func NewPrivateEndpointTrustedOwnerResource() resource.Resource
- func NewRestoreResource() resource.Resource
- func NewRestoresDataSource() datasource.DataSource
- func NewSQLUserResource() resource.Resource
- func NewServiceAccountResource() resource.Resource
- func NewUserRoleGrantResource() resource.Resource
- func NewUserRoleGrantsResource() resource.Resource
- func NewVersionDeferralResource() resource.Resource
- type APIErrorMessage
- type APIKey
- type AllowlistEntry
- type AwsCustomerCloudAccount
- type AzureCustomerCloudAccount
- type Backup
- type Backups
- type BlackoutWindow
- type BlackoutWindowList
- type CMEKKey
- type CMEKRegion
- type ClientCACertResourceModel
- type ClusterBackupConfig
- type ClusterBackupConfiguration
- type ClusterCMEK
- type ClusterCert
- type ClusterCloudWatchMetricExportConfig
- type ClusterDatadogMetricExportConfig
- type ClusterLogExport
- type ClusterMaintenanceWindow
- type ClusterPrometheusMetricExportConfig
- type ClusterVersionDeferral
- type CockroachCluster
- type ConnectionParams
- type ConnectionString
- type CustomerCloudAccount
- type Database
- type DedicatedClusterConfig
- type EgressPrivateEndpoint
- type EgressPrivateEndpointDomainNames
- type FinalizeVersionUpgrade
- type Folder
- type FolderDataSourceModel
- type GcpCustomerCloudAccount
- type IdentityMapEntry
- type JWTIssuer
- type Knowable
- type LogExportGroup
- type Organization
- type PersonUser
- type PhysicalReplicationStream
- type PrivateEndpointConnection
- type PrivateEndpointService
- type PrivateEndpointServices
- type PrivateEndpointTrustedOwner
- type PrivateLinkServiceAWSDetail
- type Region
- type Restore
- type RestoreItem
- type RestoreOpts
- type RestoreSummary
- type Restores
- type Role
- type SQLUser
- type ServerlessClusterConfig
- type ServiceAccount
- type UsageLimits
- type UserRoleGrant
- type UserRoleGrants
Constants ¶
const ( CockroachAPIKey string = "COCKROACH_API_KEY" CockroachAPIJWT string = "COCKROACH_API_JWT" APIServerURLKey string = "COCKROACH_SERVER" UserAgent string = "terraform-provider-cockroach" CockroachVanityName string = "COCKROACH_VANITY_NAME" CockroachUsername string = "COCKROACH_USERNAME" )
Variables ¶
var AllowedEgressPrivateEndpointTargetServiceTypeTypeEnumValues = func() []string { var strings []string for i := range client.AllowedEgressPrivateEndpointTargetServiceTypeTypeEnumValues { strings = append(strings, string(client.AllowedEgressPrivateEndpointTargetServiceTypeTypeEnumValues[i])) } return strings }()
var AllowedUpgradeTypeTypeEnumValueStrings = func() []string { var strings []string for i := range client.AllowedUpgradeTypeTypeEnumValues { strings = append(strings, string(client.AllowedUpgradeTypeTypeEnumValues[i])) } return strings }()
var DownloadClusterCert = func(cluster *client.Cluster, diags *diag.Diagnostics) []byte { serverURL := client.DefaultServerURL if value, found := os.LookupEnv(APIServerURLKey); found { serverURL = value } downloadURL := fmt.Sprintf("%s/clusters/%s/cert", serverURL, cluster.Id) httpResp, err := http.Get(downloadURL) if err != nil { diags.AddError("Couldn't download certificate", err.Error()) return nil } certContents, err := io.ReadAll(httpResp.Body) if err != nil { diags.AddError("Error reading cert", err.Error()) return nil } return certContents }
var NewService = client.NewService
NewService overrides the client method for testing.
Functions ¶
func CheckSchemaAttributesMatch ¶ added in v0.7.0
func CheckSchemaAttributesMatch( t *testing.T, rAttributes map[string]resource_schema.Attribute, dAttributes map[string]datasource_schema.Attribute, )
CheckSchemaAttributesMatch is a test utility that can be used to make sure a resource's schema stays in sync with its datasource counterpart. It compares attribute names and topology, but not properties.
func HookGlobal ¶ added in v0.3.0
func HookGlobal[T any](ptr *T, val T) func()
HookGlobal sets `*ptr = val` and returns a closure for restoring `*ptr` to its original value. A runtime panic will occur if `val` is not assignable to `*ptr`.
func IsKnown ¶ added in v1.0.0
IsKnown is a shortcut that checks in a value is neither null nor unknown.
func New ¶
func New(version string) func() tf_provider.Provider
func NewAPIKeyResource ¶ added in v1.6.0
func NewAllowlistResource ¶ added in v0.4.0
func NewBackupsDataSource ¶ added in v1.14.0
func NewBackupsDataSource() datasource.DataSource
func NewBlackoutWindowDataSource ¶ added in v1.16.0
func NewBlackoutWindowDataSource() datasource.DataSource
func NewBlackoutWindowResource ¶ added in v1.16.0
func NewCMEKResource ¶ added in v0.4.0
func NewClientCACertResource ¶ added in v0.4.5
func NewClusterCertDataSource ¶ added in v0.4.1
func NewClusterCertDataSource() datasource.DataSource
func NewClusterDataSource ¶ added in v0.4.0
func NewClusterDataSource() datasource.DataSource
func NewClusterResource ¶ added in v0.4.0
func NewConnectionStringDataSource ¶ added in v0.4.1
func NewConnectionStringDataSource() datasource.DataSource
func NewDatabaseResource ¶ added in v0.4.3
func NewEgressPrivateEndpointDomainNamesResource ¶ added in v1.16.0
func NewEgressPrivateEndpointResource ¶ added in v1.15.0
func NewFinalizeVersionUpgradeResource ¶ added in v0.4.3
func NewFolderDataSource ¶ added in v1.4.0
func NewFolderDataSource() datasource.DataSource
func NewFolderResource ¶ added in v1.1.0
func NewJWTIssuerResource ¶ added in v1.9.0
func NewLogExportConfigResource ¶ added in v0.4.4
func NewMaintenanceWindowResource ¶ added in v0.6.0
func NewMetricExportCloudWatchConfigResource ¶ added in v0.4.5
func NewMetricExportDatadogConfigResource ¶ added in v0.4.5
func NewMetricExportPrometheusConfigResource ¶ added in v1.7.0
func NewOrganizationDataSource ¶ added in v0.4.4
func NewOrganizationDataSource() datasource.DataSource
func NewPersonUserDataSource ¶ added in v0.4.6
func NewPersonUserDataSource() datasource.DataSource
func NewPhysicalReplicationStreamResource ¶ added in v1.13.0
func NewPrivateEndpointConnectionResource ¶ added in v0.4.0
func NewPrivateEndpointServicesResource ¶ added in v0.4.0
func NewPrivateEndpointTrustedOwnerResource ¶ added in v1.2.0
func NewRestoreResource ¶ added in v1.14.0
func NewRestoresDataSource ¶ added in v1.14.0
func NewRestoresDataSource() datasource.DataSource
func NewSQLUserResource ¶ added in v0.4.0
func NewServiceAccountResource ¶ added in v1.6.0
func NewUserRoleGrantResource ¶ added in v1.4.0
func NewUserRoleGrantsResource ¶ added in v1.4.0
func NewVersionDeferralResource ¶ added in v0.7.0
Types ¶
type APIErrorMessage ¶
func (*APIErrorMessage) String ¶
func (e *APIErrorMessage) String() string
type AllowlistEntry ¶
type AwsCustomerCloudAccount ¶ added in v1.15.0
AwsCustomerCloudAccount contains the details for a BYOC cluster on AWS.
type AzureCustomerCloudAccount ¶ added in v1.15.0
type AzureCustomerCloudAccount struct {
SubscriptionId types.String `tfsdk:"subscription_id"`
TenantId types.String `tfsdk:"tenant_id"`
}
AzureCustomerCloudAccount contains the details for a BYOC cluster on Azure.
type BlackoutWindow ¶ added in v1.16.0
type BlackoutWindowList ¶ added in v1.16.0
type CMEKKey ¶ added in v0.4.0
type CMEKKey struct {
Status types.String `tfsdk:"status"`
UserMessage types.String `tfsdk:"user_message"`
Type types.String `tfsdk:"type"`
URI types.String `tfsdk:"uri"`
AuthPrincipal types.String `tfsdk:"auth_principal"`
CreatedAt types.String `tfsdk:"created_at"`
UpdatedAt types.String `tfsdk:"updated_at"`
}
type CMEKRegion ¶ added in v0.4.0
type ClientCACertResourceModel ¶ added in v0.4.5
type ClusterBackupConfig ¶ added in v1.10.0
type ClusterBackupConfiguration ¶ added in v1.10.0
type ClusterCMEK ¶ added in v0.4.0
type ClusterCert ¶ added in v0.4.1
type ClusterCloudWatchMetricExportConfig ¶ added in v0.4.5
type ClusterCloudWatchMetricExportConfig struct {
ID types.String `tfsdk:"id"`
TargetRegion types.String `tfsdk:"target_region"`
LogGroupName types.String `tfsdk:"log_group_name"`
RoleArn types.String `tfsdk:"role_arn"`
ExternalID types.String `tfsdk:"external_id"`
UserMessage types.String `tfsdk:"user_message"`
Status types.String `tfsdk:"status"`
}
type ClusterDatadogMetricExportConfig ¶ added in v0.4.5
type ClusterLogExport ¶ added in v0.4.4
type ClusterLogExport struct {
ID types.String `tfsdk:"id"`
AuthPrincipal types.String `tfsdk:"auth_principal"`
LogName types.String `tfsdk:"log_name"`
Type types.String `tfsdk:"type"`
Redact types.Bool `tfsdk:"redact"`
Region types.String `tfsdk:"region"`
Groups *[]LogExportGroup `tfsdk:"groups"`
Status types.String `tfsdk:"status"`
UserMessage types.String `tfsdk:"user_message"`
CreatedAt types.String `tfsdk:"created_at"`
UpdatedAt types.String `tfsdk:"updated_at"`
OmittedChannels *[]types.String `tfsdk:"omitted_channels"`
AWSExternalID types.String `tfsdk:"aws_external_id"`
}
type ClusterMaintenanceWindow ¶ added in v0.6.0
type ClusterPrometheusMetricExportConfig ¶ added in v1.7.0
type ClusterVersionDeferral ¶ added in v0.7.0
type CockroachCluster ¶
type CockroachCluster struct {
ID types.String `tfsdk:"id"`
Name types.String `tfsdk:"name"`
CloudProvider types.String `tfsdk:"cloud_provider"`
AccountId types.String `tfsdk:"account_id"`
CustomerCloudAccount *CustomerCloudAccount `tfsdk:"customer_cloud_account"`
DedicatedConfig *DedicatedClusterConfig `tfsdk:"dedicated"`
ServerlessConfig *ServerlessClusterConfig `tfsdk:"serverless"`
Regions []Region `tfsdk:"regions"`
CockroachVersion types.String `tfsdk:"cockroach_version"`
FullVersion types.String `tfsdk:"full_version"`
Plan types.String `tfsdk:"plan"`
State types.String `tfsdk:"state"`
CreatorId types.String `tfsdk:"creator_id"`
OperationStatus types.String `tfsdk:"operation_status"`
UpgradeStatus types.String `tfsdk:"upgrade_status"`
ParentId types.String `tfsdk:"parent_id"`
DeleteProtection types.Bool `tfsdk:"delete_protection"`
BackupConfig types.Object `tfsdk:"backup_config"`
Labels types.Map `tfsdk:"labels"`
}
CockroachCluster is used by the cluster resource and the cluster data source. Changes to this model should be supported by both.
type ConnectionParams ¶ added in v1.0.0
type ConnectionString ¶ added in v0.4.1
type ConnectionString struct {
ID types.String `tfsdk:"id"`
OS types.String `tfsdk:"os"`
Database types.String `tfsdk:"database"`
SqlUser types.String `tfsdk:"sql_user"`
Password types.String `tfsdk:"password"`
ConnectionString types.String `tfsdk:"connection_string"`
ConnectionParams *ConnectionParams `tfsdk:"connection_params"`
}
type CustomerCloudAccount ¶ added in v1.15.0
type CustomerCloudAccount struct {
Aws *AwsCustomerCloudAccount `tfsdk:"aws"`
Gcp *GcpCustomerCloudAccount `tfsdk:"gcp"`
Azure *AzureCustomerCloudAccount `tfsdk:"azure"`
}
CustomerCloudAccount is the union of cloud-specific BYOC details.
type DedicatedClusterConfig ¶ added in v0.2.0
type DedicatedClusterConfig struct {
MachineType types.String `tfsdk:"machine_type"`
NumVirtualCpus types.Int64 `tfsdk:"num_virtual_cpus"`
StorageGib types.Int64 `tfsdk:"storage_gib"`
MemoryGib types.Float64 `tfsdk:"memory_gib"`
DiskIops types.Int64 `tfsdk:"disk_iops"`
PrivateNetworkVisibility types.Bool `tfsdk:"private_network_visibility"`
CidrRange types.String `tfsdk:"cidr_range"`
SupportsClusterVirtualization types.Bool `tfsdk:"supports_cluster_virtualization"`
}
type EgressPrivateEndpoint ¶ added in v1.15.0
type EgressPrivateEndpoint struct {
ID types.String `tfsdk:"id"`
ClusterID types.String `tfsdk:"cluster_id"`
EndpointConnectionID types.String `tfsdk:"endpoint_connection_id"`
Region types.String `tfsdk:"region"`
TargetServiceIdentifier types.String `tfsdk:"target_service_identifier"`
TargetServiceType types.String `tfsdk:"target_service_type"`
EndpointAddress types.String `tfsdk:"endpoint_address"`
State types.String `tfsdk:"state"`
}
type EgressPrivateEndpointDomainNames ¶ added in v1.16.0
type FinalizeVersionUpgrade ¶ added in v0.4.3
type FolderDataSourceModel ¶ added in v1.4.0
type GcpCustomerCloudAccount ¶ added in v1.15.0
type GcpCustomerCloudAccount struct {
ServiceAccountEmail types.String `tfsdk:"service_account_email"`
}
GcpCustomerCloudAccount contains the details for a BYOC cluster on GCP.
type IdentityMapEntry ¶ added in v1.3.0
type LogExportGroup ¶ added in v0.4.4
type Organization ¶ added in v0.4.4
type PersonUser ¶ added in v0.4.6
type PhysicalReplicationStream ¶ added in v1.13.0
type PhysicalReplicationStream struct {
PrimaryClusterId types.String `tfsdk:"primary_cluster_id"`
StandbyClusterId types.String `tfsdk:"standby_cluster_id"`
ID types.String `tfsdk:"id"`
CreatedAt types.String `tfsdk:"created_at"`
ReplicatedTime types.String `tfsdk:"replicated_time"`
ReplicationLagSeconds types.Int64 `tfsdk:"replication_lag_seconds"`
RetainedTime types.String `tfsdk:"retained_time"`
Status types.String `tfsdk:"status"`
FailoverAt types.String `tfsdk:"failover_at"`
FailoverImmediately types.Bool `tfsdk:"failover_immediately"`
ActivatedAt types.String `tfsdk:"activated_at"`
}
type PrivateEndpointConnection ¶ added in v0.3.0
type PrivateEndpointConnection struct {
ID types.String `tfsdk:"id"`
RegionName types.String `tfsdk:"region_name"`
CloudProvider types.String `tfsdk:"cloud_provider"`
EndpointID types.String `tfsdk:"endpoint_id"`
ServiceID types.String `tfsdk:"service_id"`
ClusterID types.String `tfsdk:"cluster_id"`
}
type PrivateEndpointService ¶ added in v0.3.0
type PrivateEndpointService struct {
RegionName types.String `tfsdk:"region_name"`
CloudProvider types.String `tfsdk:"cloud_provider"`
Status types.String `tfsdk:"status"`
Name types.String `tfsdk:"name"`
EndpointServiceId types.String `tfsdk:"endpoint_service_id"`
AvailabilityZoneIds []types.String `tfsdk:"availability_zone_ids"`
Aws PrivateLinkServiceAWSDetail `tfsdk:"aws"`
}
type PrivateEndpointServices ¶ added in v0.3.0
type PrivateEndpointTrustedOwner ¶ added in v1.2.0
type PrivateLinkServiceAWSDetail ¶ added in v0.3.0
type Region ¶
type Region struct {
Name types.String `tfsdk:"name"`
SqlDns types.String `tfsdk:"sql_dns"`
UiDns types.String `tfsdk:"ui_dns"`
InternalDns types.String `tfsdk:"internal_dns"`
PrivateEndpointDns types.String `tfsdk:"private_endpoint_dns"`
NodeCount types.Int64 `tfsdk:"node_count"`
Primary types.Bool `tfsdk:"primary"`
}
type Restore ¶ added in v1.14.0
type Restore struct {
ID types.String `tfsdk:"id"`
DestinationClusterID types.String `tfsdk:"destination_cluster_id"`
Type types.String `tfsdk:"type"`
BackupID types.String `tfsdk:"backup_id"`
SourceClusterID types.String `tfsdk:"source_cluster_id"`
Objects []RestoreItem `tfsdk:"objects"`
RestoreOpts *RestoreOpts `tfsdk:"restore_opts"`
Status types.String `tfsdk:"status"`
CreatedAt types.String `tfsdk:"created_at"`
CompletionPercent types.Float32 `tfsdk:"completion_percent"`
}
type RestoreItem ¶ added in v1.14.0
type RestoreOpts ¶ added in v1.14.0
type RestoreOpts struct {
NewDBName types.String `tfsdk:"new_db_name"`
IntoDB types.String `tfsdk:"into_db"`
SkipLocalitiesCheck types.Bool `tfsdk:"skip_localities_check"`
SkipMissingForeignKeys types.Bool `tfsdk:"skip_missing_foreign_keys"`
SkipMissingSequences types.Bool `tfsdk:"skip_missing_sequences"`
SchemaOnly types.Bool `tfsdk:"schema_only"`
}
type RestoreSummary ¶ added in v1.14.0
type ServerlessClusterConfig ¶
type ServerlessClusterConfig struct {
// TODO(andyk): SpendLimit is deprecated and will be removed in a future
// release.
SpendLimit types.Int64 `tfsdk:"spend_limit"`
RoutingId types.String `tfsdk:"routing_id"`
UpgradeType types.String `tfsdk:"upgrade_type"`
UsageLimits *UsageLimits `tfsdk:"usage_limits"`
}
type ServiceAccount ¶ added in v1.6.0
type UsageLimits ¶ added in v0.5.0
type UserRoleGrant ¶ added in v1.4.0
Source Files
¶
- allowlist_resource.go
- api_key_resource.go
- backups_data_source.go
- blackout_window_data_source.go
- blackout_window_resource.go
- client_ca_cert_resource.go
- cluster_cert_data_source.go
- cluster_data_source.go
- cluster_resource.go
- cmek_resource.go
- connection_string_data_source.go
- database_resource.go
- egress_private_endpoint_domain_names_resource.go
- egress_private_endpoint_resource.go
- finalize_version_upgrade_resource.go
- folder_data_source.go
- folder_resource.go
- jwt_issuers.go
- log_export_config_resource.go
- maintenance_window.go
- metric_export_cloudwatch_config_resource.go
- metric_export_datadog_config_resource.go
- metric_export_prometheus_config_resource.go
- models.go
- organization_data_source.go
- person_user_data_source.go
- physical_replication_stream.go
- private_endpoint_connection_resource.go
- private_endpoint_services_resource.go
- private_endpoint_trusted_owner_resource.go
- provider.go
- restore_resource.go
- restores_data_source.go
- service_account_resource.go
- sql_user_resource.go
- user_role_grant_resource.go
- user_role_grants_resource.go
- utils.go
- version_deferral.go