schema

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreEqual

func AreEqual[T comparable](array1 []T, array2 []T) bool

AreEqual returns true if the two arrays contain the same elements, without any extra values, False otherwise.

func CollectionAttributeTypes added in v1.1.0

func CollectionAttributeTypes() map[string]attr.Type

func ConvertResource

func ConvertResource(resource Resource) api.Resource

ConvertResources is used to convert a resource object containing nested fields of type basetypes.StringValue to a resource object containing nested fields of type string. TODO (AV-53457): add unit testing.

func ConvertResources

func ConvertResources(resources []Resource) []api.Resource

ConvertResources is used to convert an array of resource objects containing nested fields of type basetypes.StringValue to resource objects containing nested fields of type string. TODO (AV-53457): add unit testing.

func ConvertRoles

func ConvertRoles(roles []basetypes.StringValue) []string

ConvertRoles is used to convert all roles in an array of basetypes.StringValue to strings. TODO (AV-53457): add unit testing.

func IsTrimmed

func IsTrimmed(planValue string) bool

IsTrimmed checks if a string is equal to its trimmed version.

func MorphAllowedCidrs

func MorphAllowedCidrs(allowedCIDRs []string) (basetypes.SetValue, error)

MorphAllowedCidrs is used to convert string list to basetypes.ListValue TODO : add unit testing.

func MorphApiKeyOrganizationRoles

func MorphApiKeyOrganizationRoles(organizationRoles []string) []basetypes.StringValue

MorphApiKeyOrganizationRoles is used to convert nested organizationRoles from strings to terraform type.String. TODO : add unit testing.

func MorphCommands added in v1.3.0

func MorphCommands(commands []string) (basetypes.SetValue, error)

MorphCommands is used to convert nested Commands from strings to terraform type.String.

func MorphRoles

func MorphRoles(roles []string) []basetypes.StringValue

MorphRoles is used to convert nested organizationRoles from strings to terraform type.String. TODO (AV-53457): add unit testing.

Types

type AWSCommandRequest added in v1.3.0

type AWSCommandRequest struct {
	// ClusterId is the ID of the cluster associated with the private endpoint.
	ClusterId types.String `tfsdk:"cluster_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	ProjectId types.String `tfsdk:"project_id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	OrganizationId types.String `tfsdk:"organization_id"`

	// VpcID The ID of your virtual network.
	VpcID types.String `tfsdk:"vpc_id"`

	// SubnetIDs is a list of subnet ids.
	SubnetIDs []types.String `tfsdk:"subnet_ids"`

	// Command is the AWS command.
	Command types.String `tfsdk:"command"`
}

AWSCommandRequest represents the AWS cli to create a private endpoint.

type AWSConfig added in v1.3.0

type AWSConfig struct {
	// AccountId The numeric AWS Account ID or Owner ID.
	AccountId types.String `tfsdk:"account_id"`

	// Cidr The AWS VPC CIDR block of network in which your application runs. This cannot overlap with your Capella CIDR Block.
	Cidr types.String `tfsdk:"cidr"`

	// Region The AWS region where your VPC is deployed.
	Region types.String `tfsdk:"region"`

	// VpcId The alphanumeric VPC ID which starts with \"vpc-\". This is also known as the networkId.
	VpcId types.String `tfsdk:"vpc_id"`

	// ProviderId The ID of the VPC peer on AWS.
	ProviderId types.String `tfsdk:"provider_id"`
}

AWSConfig AWS config data required to establish a VPC peering relationship.

Refer to the docs for other limitations to AWS VPC Peering - [ref](https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-basics.html#vpc-peering-limitations).

type Access

type Access struct {
	// Resources is the level at which the above privileges are defined.
	// Ex: Access of read/write privilege can be defined at the bucket level or scope level resource.
	Resources *Resources `tfsdk:"resources"`

	// Privileges is a list of permissions that the database credential will have over the data in the given bucket or scope.
	// Privileges can be "read", "write" or both.
	Privileges []types.String `tfsdk:"privileges"`
}

Access is a list of privileges or permissions which can be narrowed to the scope level of every bucket in the Capella cluster.

type AllowList

type AllowList struct {
	// Cidr represents the trusted CIDR to allow the database connections from.
	Cidr types.String `tfsdk:"cidr"`

	// Comment is a short description of the allowed CIDR.
	Comment types.String `tfsdk:"comment"`

	// ExpiresAt is an RFC3339 timestamp determining when the allowed CIDR should expire.
	ExpiresAt types.String `tfsdk:"expires_at"`

	// Id is a GUID4 identifier of the allowlist.
	Id types.String `tfsdk:"id"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Audit represents all audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`
}

AllowList maps AllowList resource schema data to the response received from V4 Capella Public API.

func (*AllowList) Validate

func (a *AllowList) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type AllowLists

type AllowLists struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Data contains the list of resources.
	Data []OneAllowList `tfsdk:"data"`
}

AllowLists defines the attributes as received from the V4 Capella Public API when asked to list allowlists.

type ApiKey

type ApiKey struct {
	// Expiry is the expiry of the API key in number of days.
	// If set to -1, the token will not expire.
	Expiry types.Float64 `tfsdk:"expiry"`

	// Rotate is set only when updating(rotating) the API key,
	// and it should be set be set in incremental order from
	// the previously set rotate value, ideally we should start.
	// it from 1 when we are rotating for first time.
	Rotate types.Number `tfsdk:"rotate"`

	// AllowedCIDRs is the list of inbound CIDRs for the API key.
	// The system making a request must come from one of the allowed CIDRs.
	AllowedCIDRs   types.Set    `tfsdk:"allowed_cidrs"`
	OrganizationId types.String `tfsdk:"organization_id"`
	Audit          types.Object `tfsdk:"audit"`
	Description    types.String `tfsdk:"description"`
	Id             types.String `tfsdk:"id"`
	Name           types.String `tfsdk:"name"`

	// Secret associated with API key. One has to follow the secret key policy,
	// such as allowed characters and a length of 64 characters. If this field
	// is left empty, a secret will be auto-generated.
	Secret types.String `tfsdk:"secret"`

	// Token is a confidential piece of information that is used to authorize
	// requests made to v4 endpoints.
	Token             types.String   `tfsdk:"token"`
	OrganizationRoles []types.String `tfsdk:"organization_roles"`

	// Resources  is the resources are the resource level permissions associated
	// with the API key. To learn more about Organization Roles, see
	// [Organization Roles](https://docs.couchbase.com/cloud/organizations/organization-user-roles.html).
	Resources []ApiKeyResourcesItems `tfsdk:"resources"`
}

ApiKey maps ApiKey resource schema data.

func NewApiKey

func NewApiKey(apiKey *api.GetApiKeyResponse, organizationId string, auditObject basetypes.ObjectValue) (*ApiKey, error)

NewApiKey creates new apikey object.

func (*ApiKey) Validate

func (a *ApiKey) Validate() (map[Attr]string, error)

Validate checks the validity of an API key and extracts associated IDs. TODO : add unit testing.

type ApiKeyData

type ApiKeyData struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// AllowedCIDRs represents the list of inbound CIDRs for the API key.
	// The system making a request must come from one of the allowed CIDRs.
	AllowedCIDRs types.List   `tfsdk:"allowed_cidrs"`
	Audit        types.Object `tfsdk:"audit"`

	// Description is the description for the API key.
	Description types.String `tfsdk:"description"`

	// Expiry is the expiry of the API key in number of days.
	// If set to -1, the token will not expire.
	Expiry types.Float64 `tfsdk:"expiry"`

	// Id is the id is a unique identifier for an apiKey.
	Id types.String `tfsdk:"id"`

	// Name is the name of the API key.
	Name types.String `tfsdk:"name"`

	// OrganizationRoles are the organization level roles granted to the API key.
	OrganizationRoles []types.String `tfsdk:"organization_roles"`

	// Resources are the resource level permissions associated
	// with the API key. To learn more about Organization Roles, see
	// [Organization Roles](https://docs.couchbase.com/cloud/organizations/organization-user-roles.html).
	Resources []ApiKeyResourcesItems `tfsdk:"resources"`
}

ApiKeyData maps api key resource schema data to the GET API response as received from V4 Capella Public API.

func NewApiKeyData

func NewApiKeyData(apiKey *api.GetApiKeyResponse, organizationId string, auditObject basetypes.ObjectValue) (ApiKeyData, error)

NewApiKeyData creates a new apiKeyData object.

type ApiKeyResourcesItems

type ApiKeyResourcesItems struct {
	Id   types.String `tfsdk:"id"`
	Type types.String `tfsdk:"type"`

	// Roles is the Project Roles associated with the API key.
	// To learn more about Project Roles,
	// see [Project Roles](https://docs.couchbase.com/cloud/projects/project-roles.html).
	Roles []types.String `tfsdk:"roles"`
}

ApiKeyResourcesItems the individual item that is part of Resources. These items define the set of roles or access that can be had on a single type of resource.

func MorphApiKeyResources

func MorphApiKeyResources(resources api.Resources) []ApiKeyResourcesItems

MorphApiKeyResources is used to covert nested resources from strings to terraform types.String TODO : add unit testing.

func OrderList2

func OrderList2(list1, list2 []ApiKeyResourcesItems) ([]ApiKeyResourcesItems, error)

OrderList2 function to order list2 based on list1's Ids.

type ApiKeys

type ApiKeys struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Data contains the list of resources.
	Data []ApiKeyData `tfsdk:"data"`
}

ApiKeys defines attributes as received in the LIST API response of Capella V4 Public API.

func (ApiKeys) Validate

func (a ApiKeys) Validate() (organizationId string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type AppService

type AppService struct {
	// Compute is the CPU and RAM configuration of the app service.
	Compute *AppServiceCompute `tfsdk:"compute"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Description is the description for the app service (up to 256 characters).
	Description types.String `tfsdk:"description"`

	// CloudProvider is the cloud provider where the app service will be hosted.
	// To learn more, see:
	// [AWS] https://docs.couchbase.com/cloud/reference/aws.html
	// [GCP] https://docs.couchbase.com/cloud/reference/gcp.html
	// [Azure] https://docs.couchbase.com/cloud/reference/azure.html
	CloudProvider types.String `tfsdk:"cloud_provider"`

	// Name is the name of the app service, the name of the app service should follow this naming criteria:
	// An app service name should have at least 2 characters and up to 256 characters.
	Name types.String `tfsdk:"name"`

	// Id is a UUID of the app service.
	Id types.String `tfsdk:"id"`

	// ProjectId is the projectId of the cluster.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the cluster.
	ClusterId types.String `tfsdk:"cluster_id"`

	// CurrentState defines the current state of app service.
	CurrentState types.String `tfsdk:"current_state"`

	// Version defines the version of the app service server
	Version types.String `tfsdk:"version"`

	// Audit represents all audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`

	// Etag represents the version of the document.
	Etag types.String `tfsdk:"etag"`

	// IfMatch is a precondition header that specifies the entity tag of a resource.
	IfMatch types.String `tfsdk:"if_match"`

	// Nodes is the number of nodes configured for the app service.
	Nodes types.Int64 `tfsdk:"nodes"`
}

AppService defines the response as received from V4 Capella Public API when asked to create a new app service. To learn more about App Services, see https://docs.couchbase.com/cloud/app-services/index.html

func NewAppService

func NewAppService(
	appService *appservice.GetAppServiceResponse,
	organizationId, projectId string,
	auditObject basetypes.ObjectValue,
) *AppService

NewAppService creates a new instance of an App Service.

func (AppService) Validate

func (a AppService) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type AppServiceCompute

type AppServiceCompute struct {
	// Cpu depicts cpu units (cores).
	Cpu types.Int64 `tfsdk:"cpu"`

	// Ram depicts ram units (GB).
	Ram types.Int64 `tfsdk:"ram"`
}

AppServiceCompute depicts the couchbase compute, following are the supported compute combinations for CPU and RAM for different cloud providers. To learn more, see: [AWS] https://docs.couchbase.com/cloud/reference/aws.html [GCP] https://docs.couchbase.com/cloud/reference/gcp.html [Azure] https://docs.couchbase.com/cloud/reference/azure.html

type AppServiceData

type AppServiceData struct {
	// Compute is the CPU and RAM configuration of the app service.
	Compute *AppServiceCompute `tfsdk:"compute"`

	// Id is a UUID of the app service.
	Id types.String `tfsdk:"id"`

	// Name is the name of the app service, the name of the app service should follow this naming criteria:
	// An app service name should have at least 2 characters and up to 256 characters.
	Name types.String `tfsdk:"name"`

	// Description is the description for the app service (up to 256 characters).
	Description types.String `tfsdk:"description"`

	// CloudProvider is the cloud provider where the app service will be hosted.
	// To learn more, see:
	// [AWS] https://docs.couchbase.com/cloud/reference/aws.html
	// [GCP] https://docs.couchbase.com/cloud/reference/gcp.html
	// [Azure] https://docs.couchbase.com/cloud/reference/azure.html
	CloudProvider types.String `tfsdk:"cloud_provider"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ClusterId is the clusterId of the cluster.
	ClusterId types.String `tfsdk:"cluster_id"`

	// CurrentState defines the current state of app service.
	CurrentState types.String `tfsdk:"current_state"`

	// Version defines the version of the app service server
	Version types.String `tfsdk:"version"`

	// Audit represents all audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`

	// Nodes is the number of nodes configured for the app service.
	Nodes types.Int64 `tfsdk:"nodes"`
}

AppServiceData defines attributes for a single cluster when fetched from the V4 Capella Public API.

func NewAppServiceData

func NewAppServiceData(
	appService *appservice.GetAppServiceResponse,
	organizationId string,
	auditObject basetypes.ObjectValue,
) *AppServiceData

NewAppServiceData creates a new cluster data object.

type AppServiceOnOffOnDemand added in v1.1.0

type AppServiceOnOffOnDemand struct {
	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// AppServiceId is the appServiceId of the capella tenant.
	AppServiceId types.String `tfsdk:"app_service_id"`

	// State is the state to which the app service needs to be turned to i.e. on or off.
	State types.String `tfsdk:"state"`
}

func (*AppServiceOnOffOnDemand) Validate added in v1.1.0

func (a *AppServiceOnOffOnDemand) Validate() (map[Attr]string, error)

type AppServices

type AppServices struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Data contains the list of resources.
	Data []AppServiceData `tfsdk:"data"`
}

AppServices defines structure based on the response received from V4 Capella Public API when asked to list app services.

type Attr

type Attr string
const (
	OrganizationId Attr = "organizationId"
	ProjectId      Attr = "projectId"
	ClusterId      Attr = "clusterId"
	BucketId       Attr = "bucketId"
	Id             Attr = "id"
	ScopeName      Attr = "scopeName"
	CollectionName Attr = "collectionName"
	AppServiceId   Attr = "appServiceId"
	EndpointId     Attr = "endpointId"
)

type AuditLogEventID added in v1.2.0

type AuditLogEventID struct {
	Description types.String `tfsdk:"description"`
	Id          types.Int64  `tfsdk:"id"`
	Module      types.String `tfsdk:"module"`
	Name        types.String `tfsdk:"name"`
}

type AuditLogEventIDs added in v1.2.0

type AuditLogEventIDs struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	Data []AuditLogEventID `tfsdk:"data"`
}

func (*AuditLogEventIDs) Validate added in v1.2.0

func (a *AuditLogEventIDs) Validate() error

Validate is used to verify that all the fields in the datasource have been populated.

type AuditLogExport added in v1.2.0

type AuditLogExport struct {
	// AuditLogDownloadURL Pre-signed URL to download cluster audit logs.
	AuditLogDownloadURL types.String `tfsdk:"audit_log_download_url"`

	// Expiration The timestamp when the download link expires.
	Expiration types.String `tfsdk:"expiration"`

	// Id is a GUID4 identifier of the export job.
	Id types.String `tfsdk:"id"`

	// Start Specifies the audit log's start date and time.
	Start types.String `tfsdk:"start"`

	// End Specifies the audit log's end date and time.
	End types.String `tfsdk:"end"`

	// CreatedAt The timestamp when the audit logs were exported.
	CreatedAt types.String `tfsdk:"created_at"`

	// Status Indicates status of audit log creation.
	Status types.String `tfsdk:"status"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`
}

func (*AuditLogExport) Validate added in v1.2.0

func (a *AuditLogExport) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type AuditLogExports added in v1.2.0

type AuditLogExports struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Data contains the list of resources.
	Data []AuditLogExport `tfsdk:"data"`
}

type AuditSettingsDisabledUser added in v1.2.0

type AuditSettingsDisabledUser struct {
	// Domain Specifies whether the user is local or external.
	Domain types.String `tfsdk:"domain"`

	// Name The user name.
	Name types.String `tfsdk:"name"`
}

type Availability

type Availability struct {
	// Type is the availability zone type, either 'single' or 'multi'.
	Type types.String `tfsdk:"type"`
}

Availability defines the type of Availability Zone configuration for a cluster resource. single type means the nodes in the cluster will all be deployed in a single availability zone in the cloud region. multi type means the nodes in the cluster will all be deployed in separate multiple availability zones in the cloud region.

type AzureCommandRequest added in v1.3.0

type AzureCommandRequest struct {
	// ClusterId is the ID of the cluster associated with the private endpoint.
	ClusterId types.String `tfsdk:"cluster_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	ProjectId types.String `tfsdk:"project_id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	OrganizationId types.String `tfsdk:"organization_id"`

	// The name of your resource group.
	ResourceGroupName types.String `tfsdk:"resource_group_name"`

	// The virtual network and subnet name.
	VirtualNetwork types.String `tfsdk:"virtual_network"`

	// Command is the Azure script.
	Command types.String `tfsdk:"command"`
}

AzureCommandRequest represents the Azure script to create a private endpoint.

type Backup

type Backup struct {
	// RestoreTimes represents the number of times we have requested a restore.
	// It represents the incremental count each time we request a restore.
	RestoreTimes types.Number `tfsdk:"restore_times"`

	// Method represents the mechanism of the backup.
	// Enum: "incremental" "full"
	// Incremental backups include the data that has changed since the last scheduled backup.
	// Full backup includes all bucket data from the time the backup was created.
	Method types.String `tfsdk:"method"`

	// Date represents the time at which backup was created.
	Date types.String `tfsdk:"date"`

	// BucketName represents the name of the bucket to which the backup belongs to.
	BucketName types.String `tfsdk:"bucket_name"`

	// CycleId is the cycleId to the which the backup belongs to.
	CycleId types.String `tfsdk:"cycle_id"`

	// BucketId is the ID of the bucket to which the backup belongs to.
	BucketId types.String `tfsdk:"bucket_id"`

	// RestoreBefore represents the time at which backup will expire.
	RestoreBefore types.String `tfsdk:"restore_before"`

	// Status represents the status of the backup.
	// Enum: "pending" "ready" "failed"
	Status types.String `tfsdk:"status"`

	// Source represents the way a backup job was initiated.
	// Enum: "manual" "scheduled"
	// Manual represents a manually triggered backup job or on-demand.
	// Scheduled represents a backup job created from a schedule.
	Source types.String `tfsdk:"source"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// Id is a GUID4 identifier of the backup.
	Id types.String `tfsdk:"id"`

	// Provider is the cloud provider where the cluster is hosted.
	CloudProvider types.String `tfsdk:"cloud_provider"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// BackupStats represents various backup level data that couchbase provides.
	BackupStats types.Object `tfsdk:"backup_stats"`

	// ScheduleInfo represents the schedule information of the backup.
	ScheduleInfo types.Object `tfsdk:"schedule_info"`

	// Restore represents information about how to restore the backup.
	Restore types.Object `tfsdk:"restore"`

	// ElapsedTimeInSeconds represents the amount of seconds that have elapsed between the creation and completion of the backup.
	ElapsedTimeInSeconds types.Int64 `tfsdk:"elapsed_time_in_seconds"`
}

Backup maps Backup resource schema data to the response received from V4 Capella Public API.

func NewBackup

func NewBackup(backup *backup.GetBackupResponse,
	organizationId, projectId string,
	bStatsObj, sInfoObj basetypes.ObjectValue,
) *Backup

NewBackup creates new backup object.

func (Backup) Validate

func (b Backup) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type BackupData

type BackupData struct {
	// Method represents the mechanism of the backup.
	// Enum: "incremental" "full"
	// Incremental backups include the data that has changed since the last scheduled backup.
	// Full backup includes all bucket data from the time the backup was created.
	Method types.String `tfsdk:"method"`

	// RestoreBefore represents the time at which backup will expire.
	RestoreBefore types.String `tfsdk:"restore_before"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Id is a GUID4 identifier of the backup.
	Id types.String `tfsdk:"id"`

	// Date represents the time at which backup was created.
	Date types.String `tfsdk:"date"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Status represents the status of the backup.
	// Enum: "pending" "ready" "failed"
	Status types.String `tfsdk:"status"`

	// CycleId is the cycleId to the which the backup belongs to.
	CycleId types.String `tfsdk:"cycle_id"`

	// BucketName represents the name of the bucket to which the backup belongs to.
	BucketName types.String `tfsdk:"bucket_name"`

	// BucketId is the ID of the bucket to which the backup belongs to.
	BucketId types.String `tfsdk:"bucket_id"`

	// Source represents the way a backup job was initiated.
	// Enum: "manual" "scheduled"
	// Manual represents a manually triggered backup job or on-demand.
	// Scheduled represents a backup job created from a schedule.
	Source types.String `tfsdk:"source"`

	// Provider is the cloud provider where the cluster is hosted.
	CloudProvider types.String `tfsdk:"cloud_provider"`

	// BackupStats represents various backup level data that couchbase provides.
	BackupStats types.Object `tfsdk:"backup_stats"`

	// ScheduleInfo represents the schedule information of the backup.
	ScheduleInfo types.Object `tfsdk:"schedule_info"`

	// ElapsedTimeInSeconds represents the amount of seconds that have elapsed between the creation and completion of the backup.
	ElapsedTimeInSeconds types.Int64 `tfsdk:"elapsed_time_in_seconds"`
}

BackupData defines attributes for a single Backup when fetched from the V4 Capella Public API.

func NewBackupData

func NewBackupData(backup *backup.GetBackupResponse,
	organizationId, projectId string,
	bStatsObj, sInfoObj basetypes.ObjectValue,
) *BackupData

NewBackupData creates new backup data object.

type BackupSchedule

type BackupSchedule struct {
	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// BucketId is the ID of the bucket to which the backup belongs to.
	BucketId types.String `tfsdk:"bucket_id"`

	// Type represents whether the backup is a Weekly or Daily backup.
	// e.g. 'weekly'
	Type types.String `tfsdk:"type"`

	// WeeklySchedule represents the weekly schedule of the backup.
	WeeklySchedule types.Object `tfsdk:"weekly_schedule"`
}

BackupSchedule defines the response as received from V4 Capella Public API when asked to create a new backup schedule.

func NewBackupSchedule

func NewBackupSchedule(backupSchedule *backup_schedule.GetBackupScheduleResponse,
	organizationId, projectId string,
	scheduleObj basetypes.ObjectValue,
) *BackupSchedule

NewBackupSchedule creates new backup schedule object.

func (*BackupSchedule) Validate

func (a *BackupSchedule) Validate() (map[Attr]string, error)

Validate checks the validity of an API key and extracts associated IDs. TODO : add unit testing.

type BackupStats

type BackupStats struct {
	// SizeInMB represents backup size in megabytes.
	SizeInMB types.Float64 `tfsdk:"size_in_mb"`

	// Items is the number of items saved during the backup.
	Items types.Int64 `tfsdk:"items"`

	// Mutations is the number of mutations saved during the backup.
	Mutations types.Int64 `tfsdk:"mutations"`

	// Tombstones is the number of tombstones saved during the backup.
	Tombstones types.Int64 `tfsdk:"tombstones"`

	// GSI is the number of global secondary indexes saved during the backup.
	GSI types.Int64 `tfsdk:"gsi"`

	// FTS is the number of full text search entities saved during the backup.
	FTS types.Int64 `tfsdk:"fts"`

	// CBAS is the number of analytics entities saved during the backup.
	CBAS types.Int64 `tfsdk:"cbas"`

	// Event represents the number of event entities saved during the backup.
	Event types.Int64 `tfsdk:"event"`
}

BackupStats has the backup level stats provided by Couchbase.

func NewBackupStats

func NewBackupStats(backupStats backup.BackupStats) BackupStats

NewBackupStats creates a new BackupStats data object.

func (BackupStats) AttributeTypes

func (b BackupStats) AttributeTypes() map[string]attr.Type

type Backups

type Backups struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// BucketId is the ID of the bucket to which the backup belongs to.
	BucketId types.String `tfsdk:"bucket_id"`

	// Data contains the list of resources.
	Data []BackupData `tfsdk:"data"`
}

Backups defines structure based on the response received from V4 Capella Public API when asked to list backups.

func (Backups) Validate

func (b Backups) Validate() (bucketId, clusterId, projectId, organizationId string, err error)

Validate is used to verify that IDs have been properly imported.

type Bucket

type Bucket struct {
	// DurabilityLevel is the minimum level at which all writes to the bucket must occur.
	// Default: "none"
	// Enum: "none" "majority" "majorityAndPersistActive" "persistToMajority"
	//
	// The options for Durability level are as follows, according to the bucket type.
	//
	// For a Couchbase bucket:
	// None
	// Replicate to Majority
	// Majority and Persist to Active
	// Persist to Majority
	//
	//For an Ephemeral bucket:
	// None
	// Replicate to Majority
	DurabilityLevel types.String `tfsdk:"durability_level"`

	// Stats has the bucket stats that are related to memory and disk consumption.
	// itemCount: Number of documents in the bucket.
	// opsPerSecond: Number of operations per second.
	// diskUsedInMib: The amount of disk used (in MiB).
	// memoryUsedInMib: The amount of memory used (in MiB).
	Stats types.Object `tfsdk:"stats"`

	// Type defines the type of the bucket.
	// Default: "couchbase"
	// Enum: "couchbase" "ephemeral"
	// If selected Ephemeral, it is not eligible for imports or App Endpoints creation. This field cannot be changed later.
	// The options may also be referred to as Memory and Disk (Couchbase), Memory Only (Ephemeral) in the Couchbase documentation.
	// To learn more, see https://docs.couchbase.com/cloud/clusters/data-service/manage-buckets.html#add-bucket
	Type types.String `tfsdk:"type"`

	// StorageBackend defines the storage engine that is used by the bucket.
	// Default: "couchstore"
	// Enum: "couchstore" "magma"
	//
	// Ephemeral buckets do not support StorageBackend, hence not applicable for Ephemeral buckets and throws an error if this field is added.
	// This field is only applicable for a Couchbase bucket. The default value mentioned (Couchstore) is for Couchbase bucket.
	// This field cannot be changed later.
	// To learn more, see https://docs.couchbase.com/cloud/clusters/data-service/storage-engines.html
	StorageBackend types.String `tfsdk:"storage_backend"`

	// ClusterId is the ID of the cluster for which the database credential needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// BucketConflictResolution is the means by which conflicts are resolved during replication.
	// Default: "seqno"
	// Enum: "seqno" "lww"
	// This field may be referred to as "conflict resolution" in the Couchbase documentation.
	// seqno and lww may be referred to as "sequence number" and "timestamp" respectively.
	// This field cannot be changed later.
	// To learn more, see https://docs.couchbase.com/cloud/clusters/xdcr/xdcr.html#conflict-resolution
	BucketConflictResolution types.String `tfsdk:"bucket_conflict_resolution"`

	// Name is the name of the bucket.
	Name types.String `tfsdk:"name"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	ProjectId types.String `tfsdk:"project_id"`

	// Id is the id of the created bucket.
	Id types.String `tfsdk:"id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	OrganizationId types.String `tfsdk:"organization_id"`

	// EvictionPolicy is the policy which Capella adopts to prevent data loss due to memory exhaustion.
	// This may be also known as Ejection Policy in the Couchbase documentation.
	//
	// For Couchbase bucket, Eviction Policy is fullEviction by default.
	// For Ephemeral buckets, Eviction Policy is a required field, and should be one of the following:
	// noEviction
	// nruEviction
	// Default: "fullEviction"
	// Enum: "fullEviction" "noEviction" "nruEviction"
	// To learn more, see https://docs.couchbase.com/server/current/rest-api/rest-bucket-create.html#evictionpolicy
	EvictionPolicy types.String `tfsdk:"eviction_policy"`

	// MemoryAllocationInMB is the amount of memory to allocate for the bucket memory in MiB.
	// This is the maximum limit is dependent on the allocation of the KV service. For example, 80% of the allocation.
	// Default: 100
	//
	// The default value (100MiB) mentioned is for Couchbase type buckets with Couchstore as the Storage Backend.
	//
	// For Couchbase buckets, the default and minimum memory allocation changes according to the Storage Backend type as follows:
	// For Couchstore, the default and minimum memory allocation is 100 MiB.
	// For Magma, the default and minimum memory allocation is 1024 MiB.
	// For Ephemeral buckets, the default and minimum memory allocation is 100 MiB.
	MemoryAllocationInMB types.Int64 `tfsdk:"memory_allocation_in_mb"`

	// TimeToLiveInSeconds specifies the time to live (TTL) value in seconds.
	// This is the maximum time to live for items in the bucket.
	// Default is 0, that means TTL is disabled. This is a non-negative value.
	TimeToLiveInSeconds types.Int64 `tfsdk:"time_to_live_in_seconds"`

	// Replicas is the number of replicas for the bucket.
	// Default: 1
	// Enum: 1 2 3
	Replicas types.Int64 `tfsdk:"replicas"`

	// Flush determines whether flushing is enabled on the bucket.
	// Enable Flush to delete all items in this bucket at the earliest opportunity.
	// Disable Flush to avoid inadvertent data loss.
	// Default: false
	Flush types.Bool `tfsdk:"flush"`
}

func (Bucket) Validate

func (b Bucket) Validate() (map[Attr]string, error)

Validate will split the IDs by a delimiter i.e. comma , in case a terraform import CLI is invoked. The format of the terraform import CLI would include the IDs as follows - `terraform import capella_bucket.new_bucket id=<uuid>,cluster_id=<uuid>,project_id=<uuid>,organization_id=<uuid>`.

type BucketResource

type BucketResource struct {
	Name types.String `tfsdk:"name"`
	// Scopes is the details of the scopes inside the bucket to which we want to apply access privileges.
	Scopes []ScopeResource `tfsdk:"scopes"`
}

BucketResource contains the details of a single bucket with scope and collection level information. Scopes can be a subset of all scopes inside the bucket, since this is defined only to govern the access.

type Buckets

type Buckets struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Data It contains the list of resources.
	Data []OneBucket `tfsdk:"data"`
}

Buckets defines attributes for the LIST buckets response received from V4 Capella Public API.

func (Buckets) Validate

func (b Buckets) Validate() (clusterId, projectId, organizationId string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type Certificate

type Certificate struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	Data []OneCertificate `tfsdk:"data"`
}

func (*Certificate) Validate

func (c *Certificate) Validate() error

Validate is used to verify that all the fields in the datasource have been populated.

type CloudProvider

type CloudProvider struct {
	// Cidr is the cidr block for Cloud Provider.
	Cidr types.String `tfsdk:"cidr"`

	// Region is the cloud provider region, e.g. 'us-west-2'.
	// For information about supported regions, see
	// [Amazon Web Services](https://docs.couchbase.com/cloud/reference/aws.html).
	// [Google Cloud Provider](https://docs.couchbase.com/cloud/reference/gcp.html).
	// [Azure Cloud](https://docs.couchbase.com/cloud/reference/azure.html).
	Region types.String `tfsdk:"region"`

	// Type is the cloud provider type, either 'AWS', 'GCP', or 'Azure'.
	Type types.String `tfsdk:"type"`
}

CloudProvider is the cloud provider where the cluster will be hosted. To learn more, see [Amazon Web Services](https://docs.couchbase.com/cloud/reference/aws.html).

type Cluster

type Cluster struct {
	// Availability zone type, either 'single' or 'multi'.
	Availability *Availability `tfsdk:"availability"`

	// Support defines the support plan and timezone for this particular cluster.
	Support *Support `tfsdk:"support"`

	// CloudProvider The cloud provider where the cluster will be hosted.
	// To learn more, see [Amazon Web Services](https://docs.couchbase.com/cloud/reference/aws.html).
	CloudProvider *CloudProvider `tfsdk:"cloud_provider"`

	ProjectId      types.String `tfsdk:"project_id"`
	Id             types.String `tfsdk:"id"`
	OrganizationId types.String `tfsdk:"organization_id"`
	Audit          types.Object `tfsdk:"audit"`

	// ConfigurationType represents whether a cluster is configured as a single-node or multi-node cluster.
	ConfigurationType types.String `tfsdk:"configuration_type"`

	// CouchbaseServer is the version of the Couchbase Server to be installed in the cluster.
	CouchbaseServer types.Object `tfsdk:"couchbase_server"`

	// Description of the cluster (up to 1024 characters).
	Description types.String `tfsdk:"description"`

	// Name of the cluster (up to 256 characters).
	Name types.String `tfsdk:"name"`

	// AppServiceId is the ID of the linked app service.
	AppServiceId types.String `tfsdk:"app_service_id"`

	// ConnectionString specifies the Capella database endpoint for your client connection.
	ConnectionString types.String `tfsdk:"connection_string"`

	// CurrentState tells the status of the cluster - if it's healthy or degraded.
	CurrentState types.String `tfsdk:"current_state"`

	// Etag represents the version of the document
	Etag    types.String `tfsdk:"etag"`
	IfMatch types.String `tfsdk:"if_match"`

	// ServiceGroups is the couchbase service groups to be run. At least one service group must contain the data service.
	ServiceGroups []ServiceGroup `tfsdk:"service_groups"`
}

Cluster defines the response as received from V4 Capella Public API when asked to create a new cluster.

func NewCluster

func NewCluster(ctx context.Context, cluster *clusterapi.GetClusterResponse, organizationId, projectId string, auditObject basetypes.ObjectValue) (*Cluster, error)

NewCluster create new cluster object.

func (*Cluster) Validate

func (c *Cluster) Validate() (map[Attr]string, error)

type ClusterAuditSettings added in v1.2.0

type ClusterAuditSettings struct {
	OrganizationId  types.String                `tfsdk:"organization_id"`
	ProjectId       types.String                `tfsdk:"project_id"`
	ClusterId       types.String                `tfsdk:"cluster_id"`
	DisabledUsers   []AuditSettingsDisabledUser `tfsdk:"disabled_users"`
	EnabledEventIDs []types.Int64               `tfsdk:"enabled_event_ids"`
	AuditEnabled    types.Bool                  `tfsdk:"audit_enabled"`
}

func (*ClusterAuditSettings) Validate added in v1.2.0

func (c *ClusterAuditSettings) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type ClusterData

type ClusterData struct {
	Availability     *Availability    `tfsdk:"availability"`
	Support          *Support         `tfsdk:"support"`
	CouchbaseServer  *CouchbaseServer `tfsdk:"couchbase_server"`
	CloudProvider    *CloudProvider   `tfsdk:"cloud_provider"`
	OrganizationId   types.String     `tfsdk:"organization_id"`
	ProjectId        types.String     `tfsdk:"project_id"`
	Id               types.String     `tfsdk:"id"`
	Audit            types.Object     `tfsdk:"audit"`
	Description      types.String     `tfsdk:"description"`
	Name             types.String     `tfsdk:"name"`
	AppServiceId     types.String     `tfsdk:"app_service_id"`
	ConnectionString types.String     `tfsdk:"connection_string"`
	CurrentState     types.String     `tfsdk:"current_state"`
	ServiceGroups    []ServiceGroup   `tfsdk:"service_groups"`
}

ClusterData defines attributes for a single cluster when fetched from the V4 Capella Public API.

func NewClusterData

func NewClusterData(cluster *clusterapi.GetClusterResponse, organizationId, projectId string, auditObject basetypes.ObjectValue) (*ClusterData, error)

NewClusterData creates a new cluster data object.

type ClusterOnOffOnDemand added in v1.1.0

type ClusterOnOffOnDemand struct {
	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// State is the state (on/off) the cluster needs to be turned on/off of the cluster
	State types.String `tfsdk:"state"`

	// TurnOnLinkedAppService Set this value to true if you want to turn on the app service linked with the cluster, false if not.
	TurnOnLinkedAppService types.Bool `tfsdk:"turn_on_linked_app_service"`
}

ClusterOnOffOnDemand provides the means to turn the given cluster to on or off state.

func (*ClusterOnOffOnDemand) Validate added in v1.1.0

func (c *ClusterOnOffOnDemand) Validate() (map[Attr]string, error)

type ClusterOnOffSchedule added in v1.1.0

type ClusterOnOffSchedule struct {
	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Timezone for the schedule
	// Enum: "Pacific/Midway" "US/Hawaii" "US/Alaska" "US/Pacific" "US/Mountain" "US/Central" "US/Eastern"
	// "America/Puerto_Rico" "Canada/Newfoundland" "America/Argentina/Buenos_Aires" "Atlantic/Cape_Verde"
	// "Europe/London" "Europe/Amsterdam" "Europe/Athens" "Africa/Nairobi" "Asia/Tehran" "Indian/Mauritius"
	// "Asia/Karachi" "Asia/Calcutta" "Asia/Dhaka" "Asia/Bangkok" "Asia/Hong_Kong" "Asia/Tokyo" "Australia/North"
	// "Australia/Sydney" "Pacific/Ponape" "Antarctica/South_Pole"
	Timezone types.String `tfsdk:"timezone"`

	// Days is an array of day-wise schedule to manage the cluster on/off state.
	Days []DayItem `tfsdk:"days"`
}

ClusterOnOffSchedule defines the response as received from V4 Capella Public API when asked to create a new cluster activation schedule. Couchbase supports the feature where you can schedule when your provisioned database is on and off to save costs. Turning off your database turns off the compute for your cluster but the storage remains. All of your data, schema (buckets, scopes, and collections), and indexes remain, as well as your cluster configuration, including users and allow lists. When you turn your provisioned database off, you will be charged the OFF amount for the database.

func NewClusterOnOffSchedule added in v1.1.0

func NewClusterOnOffSchedule(onOffSchedule *scheduleapi.GetClusterOnOffScheduleResponse,
	organizationId, projectId, clusterId string,
) *ClusterOnOffSchedule

NewClusterOnOffSchedule creates new cluster on/off schedule object.

func (*ClusterOnOffSchedule) Validate added in v1.1.0

func (a *ClusterOnOffSchedule) Validate() (map[Attr]string, error)

Validate checks the validity of an API key and extracts associated IDs.

type Clusters

type Clusters struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the cluster
	ProjectId types.String `tfsdk:"project_id"`

	// Data It contains the list of resources.
	Data []ClusterData `tfsdk:"data"`
}

Clusters defines structure based on the response received from V4 Capella Public API when asked to list clusters.

type Collection added in v1.1.0

type Collection struct {

	// Name is the name of the collection.
	Name types.String `tfsdk:"collection_name"`

	// MaxTTL Max TTL of the collection.
	MaxTTL types.Int64 `tfsdk:"max_ttl"`

	// ScopeName is the name of the scope for which the collection needs to be created.
	ScopeName types.String `tfsdk:"scope_name"`

	// BucketId is the id of the bucket for which the collection needs to be created.
	BucketId types.String `tfsdk:"bucket_id"`

	// ClusterId is the ID of the cluster for which the collection needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	ProjectId types.String `tfsdk:"project_id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	OrganizationId types.String `tfsdk:"organization_id"`
}

Collection maps Collection resource schema data to the response received from V4 Capella Public API.

func (*Collection) Validate added in v1.1.0

func (c *Collection) Validate() (map[Attr]string, error)

Validate will split the IDs by a delimiter i.e. comma , in case a terraform import CLI is invoked.

type CollectionData added in v1.1.0

type CollectionData struct {
	Name   types.String `tfsdk:"collection_name"`
	MaxTTL types.Int64  `tfsdk:"max_ttl"`
}

CollectionData defines attributes for a single Collection when fetched from the V4 Capella Public API.

func NewCollectionData added in v1.1.0

func NewCollectionData(collection *collection.GetCollectionResponse) (*CollectionData, error)

NewCollectionData creates a new collectionData object.

type Collections added in v1.1.0

type Collections struct {
	// Array of scopes. The server returns an array of scopes in the bucket under the single Uid.
	Data []CollectionData `tfsdk:"data"`

	// ScopeName is the name of the scope for which the collection needs to be created.
	ScopeName types.String `tfsdk:"scope_name"`

	// BucketId is the id of the bucket for which the collection needs to be created.
	BucketId types.String `tfsdk:"bucket_id"`

	// ClusterId is the ID of the cluster for which the collection needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	ProjectId types.String `tfsdk:"project_id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	OrganizationId types.String `tfsdk:"organization_id"`
}

Collections defines structure based on the response received from V4 Capella Public API when asked to list collections.

func (Collections) Validate added in v1.1.0

func (c Collections) Validate() (bucketId, clusterId, projectId, organizationId, scopeName string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type Compute

type Compute struct {
	// Cpu depicts cpu units (cores).
	Cpu types.Int64 `tfsdk:"cpu"`

	// Ram depicts ram units (GB).
	Ram types.Int64 `tfsdk:"ram"`
}

Compute depicts the couchbase compute, following are the supported compute combinations for CPU and RAM for different cloud providers. To learn more, see: [AWS] https://docs.couchbase.com/cloud/reference/aws.html [GCP] https://docs.couchbase.com/cloud/reference/gcp.html [Azure] https://docs.couchbase.com/cloud/reference/azure.html

type Config

type Config struct {
	Host                types.String `tfsdk:"host"`
	AuthenticationToken types.String `tfsdk:"authentication_token"`
}

Config maps provider schema data to a Go type.

type CouchbaseAuditData

type CouchbaseAuditData struct {
	// CreatedAt The RFC3339 timestamp associated with when the resource was initially
	// created.
	CreatedAt types.String `tfsdk:"created_at"`

	// CreatedBy The user who created the resource; this will be a UUID4 ID for standard
	// users and will be a string such as "internal-support" for internal
	// Couchbase support users.
	CreatedBy types.String `tfsdk:"created_by"`

	// ModifiedAt The RFC3339 timestamp associated with when the resource was last modified.
	ModifiedAt types.String `tfsdk:"modified_at"`

	// ModifiedBy The user who last modified the resource; this will be a UUID4 ID for
	// standard users and wilmal be a string such asas "internal-support" for
	// internal Couchbase support users.
	ModifiedBy types.String `tfsdk:"modified_by"`

	// Version The version of the document. This value is incremented each time the
	// resource is modified.
	Version types.Int64 `tfsdk:"version"`
}

CouchbaseAuditData contains all audit-related fields.

func NewCouchbaseAuditData

func NewCouchbaseAuditData(audit api.CouchbaseAuditData) CouchbaseAuditData

func (CouchbaseAuditData) AttributeTypes

func (c CouchbaseAuditData) AttributeTypes() map[string]attr.Type

type CouchbaseServer

type CouchbaseServer struct {
	// Version is the version of the Couchbase Server to be installed in the cluster.
	// Refer to documentation [here](https://docs.couchbase.com/cloud/clusters/upgrade-database.html#server-version-maintenance-support)
	// for list of supported versions.
	// The latest Couchbase Server version will be deployed by default.
	Version types.String `tfsdk:"version"`
}

CouchbaseServer defines version for the Couchbase Server to be launched during the creation of the Capella cluster.

func (CouchbaseServer) AttributeTypes

func (c CouchbaseServer) AttributeTypes() map[string]attr.Type

AttributeTypes returns a mapping of field names to their respective attribute types for the CouchbaseServer struct. It is used during the conversion of a types.Object field to a CouchbaseServer type.

type Cursor added in v1.3.0

type Cursor struct {
	Hrefs *Hrefs `tfsdk:"hrefs"`
	Pages *Pages `tfsdk:"pages"`
}

type Data

type Data struct {
	Client  *api.Client
	HostURL string
	Token   string
}

Data is provider-defined data, clients, etc. that is passed to data sources or resources in the provider that implement the Configure method.

type DatabaseCredential

type DatabaseCredential struct {
	// Id is the id of the created database credential.
	Id types.String `tfsdk:"id"`

	// Name is the name of the database credential, the name of the database credential should follow this naming criteria:
	// A database credential name should have at least 2 characters and up to 256 characters and should not contain spaces.
	Name types.String `tfsdk:"name"`

	// Password is the password that you may want to use to create this database credential.
	// This password can later be used to authenticate connections to the underlying couchbase server.
	// The password should contain 8+ characters, at least 1 lower, 1 upper, 1 numerical and 1 special character.
	Password types.String `tfsdk:"password"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the ID of the cluster for which the database credential needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Audit contains all audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`

	// Access is a list of access which can be narrowed to the scope level of every bucket in the Capella cluster.
	// Access can be "read", "write" or both.
	Access []Access `tfsdk:"access"`
}

DatabaseCredential maps the schema for the resource - database credential in Capella. A database credential is created on a cluster resource to gain read/write access to the cluster's data. This credential can have a fixed password supplied during creation or the password can be auto-generated.

A database credential is simply a user in the couchbase server with some roles attached to it based on the Access field supplied during creation.

func NewDatabaseCredential

func NewDatabaseCredential(
	Id types.String,
	name types.String,
	organizationId, projectId, clusterId types.String,
	auditObject basetypes.ObjectValue,
) *DatabaseCredential

func (DatabaseCredential) Validate

func (c DatabaseCredential) Validate() (map[Attr]string, error)

Validate will split the IDs by a delimiter i.e. comma , in case a terraform import CLI is invoked. The format of the terraform import CLI would include the IDs as follows - `terraform import capella_database_credential.new_database_credential id=<uuid>,cluster_id=<uuid>,project_id=<uuid>,organization_id=<uuid>`.

type DatabaseCredentialItem

type DatabaseCredentialItem struct {
	// Id A GUID4 identifier of the created database credential.
	Id types.String `tfsdk:"id"`

	// Name is the name of the database credential, the name of the database credential should follow this naming criteria:
	// A database credential name should have at least 2 characters and up to 256 characters and should not contain spaces.
	Name types.String `tfsdk:"name"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the ID of the cluster for which the database credential needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Access is a list of access which can be narrowed to the scope level of every bucket in the Capella cluster.
	// Access can be "read", "write" or both.
	Access []Access `tfsdk:"access"`

	// Audit All audit-related fields.
	Audit CouchbaseAuditData `tfsdk:"audit"`
}

DatabaseCredentialItem is used to retrieve the new state of a database credential after it is created by Terraform. This struct is separate from the DatabaseCredential struct because of the change in data type of its attributes after retrieval.

type DatabaseCredentials

type DatabaseCredentials struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Data It contains the list of resources.
	Data []DatabaseCredentialItem `tfsdk:"data"`
}

DatabaseCredentials defines model for GetDatabaseCredentialsResponse.

func (DatabaseCredentials) Validate

func (d DatabaseCredentials) Validate() (clusterId, projectId, organizationId string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type DayItem added in v1.1.0

type DayItem struct {
	// State to be set for the cluster (on, off, or custom).
	//
	// On state turns the cluster on (healthy state) for the whole day.
	// Off state turns the cluster off for the whole day.
	// Custom state should be used for the days when a cluster needs to be in the turned on (healthy) state
	// during the specified time window instead of all day.
	State types.String `tfsdk:"state"`

	// Day of the week for scheduling on/off.
	//
	// The days of the week should be in proper sequence starting from Monday and ending with Sunday.
	// The On/Off schedule requires 7 days for the schedule, one for each day of the week.
	// There cannot be more or less than 7 days in the schedule.
	// Clusters cannot be scheduled to be off for the entire day for every day of the week.
	// Enum: "monday" "tuesday" "wednesday" "thursday" "friday" "saturday" "sunday"
	Day types.String `tfsdk:"day"`

	// From is the starting time boundary for the cluster on/off schedule.
	// The time boundary should be according to the following rules:
	//
	// If the schedule is a non-custom day - with state on or off, it cannot contain a time boundary.
	// If the schedule is a custom day -
	// It should contain the from time boundary. If the to time boundary is not specified then
	// the default value of 0 hour 0 minute is set and the cluster will be turned on for the entire day
	// from the time set in from time boundary.
	//
	// Time boundary should have a valid hour value. The valid hour values are from 0 to 23 inclusive.
	// Time boundary should have a valid minute value. The valid minute values are 0 and 30.
	// The from time boundary should not be later than the to time boundary.
	//
	// If the hour and minute values are not provided for the time boundaries,
	// it is set to a default value of 0 for both. (0 hour 0 minute)
	From *OnTimeBoundary `tfsdk:"from"`
	// To is the ending time boundary for the cluster on/off schedule.
	To *OnTimeBoundary `tfsdk:"to"`
}

DayItem is an array of Days.

type Event added in v1.3.0

type Event struct {
	Id              types.String `tfsdk:"id"`
	OrganizationId  types.String `tfsdk:"organization_id"`
	AlertKey        types.String `tfsdk:"alert_key"`
	AppServiceId    types.String `tfsdk:"app_service_id"`
	AppServiceName  types.String `tfsdk:"app_service_name"`
	ClusterId       types.String `tfsdk:"cluster_id"`
	ClusterName     types.String `tfsdk:"cluster_name"`
	ImageUrl        types.String `tfsdk:"image_url"`
	IncidentIds     types.Set    `tfsdk:"incident_ids"`
	Key             types.String `tfsdk:"key"`
	Kv              types.String `tfsdk:"kv"`
	OccurrenceCount types.Int64  `tfsdk:"occurrence_count"`
	ProjectId       types.String `tfsdk:"project_id"`
	ProjectName     types.String `tfsdk:"project_name"`
	RequestId       types.String `tfsdk:"request_id"`
	SessionId       types.String `tfsdk:"session_id"`
	Severity        types.String `tfsdk:"severity"`
	Source          types.String `tfsdk:"source"`
	Summary         types.String `tfsdk:"summary"`
	Timestamp       types.String `tfsdk:"timestamp"`
	UserEmail       types.String `tfsdk:"user_email"`
	UserId          types.String `tfsdk:"user_id"`
	UserName        types.String `tfsdk:"user_name"`
}

Event represents a detailed event with all associated information.

func NewEvent added in v1.3.0

func NewEvent(event *api.GetEventResponse, organizationId types.String, incidentIdsSet types.Set, kvString types.String) (*Event, error)

NewEvent creates a new Event instance from the provided API response.

type EventItem added in v1.3.0

type EventItem struct {
	AlertKey        types.String `tfsdk:"alert_key"`
	AppServiceId    types.String `tfsdk:"app_service_id"`
	AppServiceName  types.String `tfsdk:"app_service_name"`
	ClusterId       types.String `tfsdk:"cluster_id"`
	ClusterName     types.String `tfsdk:"cluster_name"`
	Id              types.String `tfsdk:"id"`
	ImageUrl        types.String `tfsdk:"image_url"`
	IncidentIds     types.Set    `tfsdk:"incident_ids"`
	Key             types.String `tfsdk:"key"`
	Kv              types.String `tfsdk:"kv"`
	OccurrenceCount types.Int64  `tfsdk:"occurrence_count"`
	ProjectId       types.String `tfsdk:"project_id"`
	ProjectName     types.String `tfsdk:"project_name"`
	RequestId       types.String `tfsdk:"request_id"`
	SessionId       types.String `tfsdk:"session_id"`
	Severity        types.String `tfsdk:"severity"`
	Source          types.String `tfsdk:"source"`
	Summary         types.String `tfsdk:"summary"`
	Timestamp       types.String `tfsdk:"timestamp"`
	UserEmail       types.String `tfsdk:"user_email"`
	UserId          types.String `tfsdk:"user_id"`
	UserName        types.String `tfsdk:"user_name"`
}

EventItem represents a single event item with detailed information.

func NewEventItem added in v1.3.0

func NewEventItem(event api.GetEventResponse, incidentIdsSet types.Set, kvString types.String) (*EventItem, error)

NewEventItem creates a new EventItem instance from the provided API response.

type Events added in v1.3.0

type Events struct {
	OrganizationId types.String `tfsdk:"organization_id"`
	ProjectIds     types.Set    `tfsdk:"project_ids"`
	ClusterIds     types.Set    `tfsdk:"cluster_ids"`
	UserIds        types.Set    `tfsdk:"user_ids"`
	SeverityLevels types.Set    `tfsdk:"severity_levels"`
	Tags           types.Set    `tfsdk:"tags"`
	From           types.String `tfsdk:"from"`
	To             types.String `tfsdk:"to"`
	Page           types.Int64  `tfsdk:"page"`
	PerPage        types.Int64  `tfsdk:"per_page"`
	SortBy         types.String `tfsdk:"sort_by"`
	SortDirection  types.String `tfsdk:"sort_direction"`
	Data           []EventItem  `tfsdk:"data"`
	Cursor         *Cursor      `tfsdk:"cursor"`
}

Events represents a structure for filtering and paginating events.

type GCPConfig added in v1.3.0

type GCPConfig struct {
	// Cidr The GCP VPC CIDR block of network in which your application runs. This cannot overlap with your Capella CIDR Block.
	Cidr types.String `tfsdk:"cidr"`

	// NetworkName The name of the network that you want to peer with.
	NetworkName types.String `tfsdk:"network_name"`

	// ProjectId The unique identifier for your GCP project.
	ProjectId types.String `tfsdk:"project_id"`

	// ServiceAccount is the service account created or assigned on the external VPC project. GCP Service Account with below permissions
	// - DNS Admin
	// - Compute.NetworkAdmin
	// It should be in the form of an email that is shown under `gcloud iam service-accounts list` command.
	// [Reference](https://cloud.google.com/iam/docs/creating-managing-service-accounts#creating)
	ServiceAccount types.String `tfsdk:"service_account"`

	//// ProviderId The ID of the VPC peer on GCP.
	ProviderId types.String `tfsdk:"provider_id"`
}

GCPConfig GCP config data required to establish a VPC peering relationship.

Refer to the docs for other limitations to GCP VPC Peering - [ref](https://cloud.google.com/vpc/docs/vpc-peering).

type Hrefs added in v1.3.0

type Hrefs struct {
	First    types.String `tfsdk:"first"`
	Last     types.String `tfsdk:"last"`
	Next     types.String `tfsdk:"next"`
	Previous types.String `tfsdk:"previous"`
}

type NetworkPeer added in v1.3.0

type NetworkPeer struct {
	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the ID of the cluster for which the network peer needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Id is the ID is the unique UUID generated when a VPC record is created.
	Id types.String `tfsdk:"id"`

	// Commands Commands contains the list of commands that the user must execute in order to complete the association of the network.
	Commands types.Set `tfsdk:"commands"`

	// Name is the Name of the peering relationship.
	Name types.String `tfsdk:"name"`

	//ProviderType is the type of the cloud provider for which the peering connection is created. Which are-
	//     1. aws
	//     2. gcp
	ProviderType types.String `tfsdk:"provider_type"`

	// ProviderConfig This provides details about the configuration and the ID of the VPC peer on AWS, GCP.
	ProviderConfig *ProviderConfig `tfsdk:"provider_config"`

	// Status communicates the state of the VPC peering relationship. It is the state and reasoning for VPC peer.
	Status types.Object `tfsdk:"status"`

	Audit types.Object `tfsdk:"audit"`
}

NetworkPeer defines the response as received from V4 Capella Public API when asked to create a new network peer.

func NewNetworkPeer added in v1.3.0

func NewNetworkPeer(ctx context.Context, networkPeer *network_peer_api.GetNetworkPeeringRecordResponse, organizationId, projectId, clusterId string, auditObject basetypes.ObjectValue) (*NetworkPeer, error)

NewNetworkPeer create new network peer object.

func (*NetworkPeer) Validate added in v1.3.0

func (n *NetworkPeer) Validate() (map[Attr]string, error)

Validate will split the IDs by a delimiter i.e. comma , in case a terraform import CLI is invoked. The format of the terraform import CLI would include the IDs as follows - `terraform import capella_network_peer.new_network_peer id=<uuid>,cluster_id=<uuid>,project_id=<uuid>,organization_id=<uuid>`.

type NetworkPeerData added in v1.3.0

type NetworkPeerData struct {

	// Id is the ID is the unique UUID generated when a VPC record is created.
	Id types.String `tfsdk:"id"`

	// Name is the Name of the peering relationship.
	Name types.String `tfsdk:"name"`

	// ProviderConfig This provides details about the configuration and the ID of the VPC peer on AWS, GCP.
	ProviderConfig ProviderConfig `tfsdk:"provider_config"`

	// Status communicates the state of the VPC peering relationship. It is the state and reasoning for VPC peer.
	Status PeeringStatus `tfsdk:"status"`

	Audit types.Object `tfsdk:"audit"`
}

NetworkPeerData defines attributes for a single network peer when fetched from the V4 Capella Public API.

func NewNetworkPeerData added in v1.3.0

func NewNetworkPeerData(networkPeer *network_peer_api.GetNetworkPeeringRecordResponse, organizationId, projectId, clusterId string, auditObject basetypes.ObjectValue) (*NetworkPeerData, error)

NewNetworkPeerData create new network peer data object.

type NetworkPeers added in v1.3.0

type NetworkPeers struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the cluster
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the ID of the cluster for which the network peer needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Data It contains the list of resources.
	Data []NetworkPeerData `tfsdk:"data"`
}

NetworkPeers defines structure based on the response received from V4 Capella Public API when asked to list network peers.

func (NetworkPeers) Validate added in v1.3.0

func (n NetworkPeers) Validate() (clusterId, projectId, organizationId string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type Node

type Node struct {
	// Disk is the type of disk that is supported per cloud provider during cluster creation.
	Disk Node_Disk `tfsdk:"disk"`
	// Compute Following are the supported compute combinations for CPU and RAM
	// for different cloud providers. To learn more, see
	// [Amazon Web Services](https://docs.couchbase.com/cloud/reference/aws.html).
	Compute Compute `tfsdk:"compute"`
}

Node defines attributes of a cluster node.

type Node_Disk

type Node_Disk struct {
	Type          types.String `tfsdk:"type"`
	Storage       types.Int64  `tfsdk:"storage"`
	IOPS          types.Int64  `tfsdk:"iops"`
	Autoexpansion types.Bool   `tfsdk:"autoexpansion"`
}

Node_Disk is the type of disk on a particular node that is supported per cloud provider during cluster creation.

type OnTimeBoundary added in v1.1.0

type OnTimeBoundary struct {
	// Hour of the time boundary.
	// Default: 0
	Hour types.Int64 `tfsdk:"hour"`

	// Minute of the time boundary.
	// Default: 0
	Minute types.Int64 `tfsdk:"minute"`
}

OnTimeBoundary corresponds to "from" and "to" time boundaries for when the cluster needs to be in the turned on (healthy) state on a day with "custom" scheduling timings.

type OneAllowList

type OneAllowList struct {
	Cidr    types.String `tfsdk:"cidr"`
	Comment types.String `tfsdk:"comment"`

	// ExpiresAt is an RFC3339 timestamp determining when the allowed CIDR should expire.
	ExpiresAt      types.String       `tfsdk:"expires_at"`
	Id             types.String       `tfsdk:"id"`
	OrganizationId types.String       `tfsdk:"organization_id"`
	ProjectId      types.String       `tfsdk:"project_id"`
	ClusterId      types.String       `tfsdk:"cluster_id"`
	Audit          CouchbaseAuditData `tfsdk:"audit"`
}

OneAllowList maps allowlist resource schema data; there is a separate response object to avoid conversion error for nested fields.

type OneBucket

type OneBucket struct {
	Stats                    *Stats       `tfsdk:"stats"`
	DurabilityLevel          types.String `tfsdk:"durability_level"`
	Name                     types.String `tfsdk:"name"`
	StorageBackend           types.String `tfsdk:"storage_backend"`
	ClusterId                types.String `tfsdk:"cluster_id"`
	BucketConflictResolution types.String `tfsdk:"bucket_conflict_resolution"`
	Id                       types.String `tfsdk:"id"`
	ProjectId                types.String `tfsdk:"project_id"`
	OrganizationId           types.String `tfsdk:"organization_id"`
	Type                     types.String `tfsdk:"type"`
	EvictionPolicy           types.String `tfsdk:"eviction_policy"`
	TimeToLiveInSeconds      types.Int64  `tfsdk:"time_to_live_in_seconds"`
	Replicas                 types.Int64  `tfsdk:"replicas"`
	MemoryAllocationInMB     types.Int64  `tfsdk:"memory_allocation_in_mb"`
	Flush                    types.Bool   `tfsdk:"flush"`
}

type OneCertificate

type OneCertificate struct {
	Certificate types.String `tfsdk:"certificate"`
}

type OneProject

type OneProject struct {
	Description    types.String       `tfsdk:"description"`
	Id             types.String       `tfsdk:"id"`
	OrganizationId types.String       `tfsdk:"organization_id"`
	Name           types.String       `tfsdk:"name"`
	Etag           types.String       `tfsdk:"etag"`
	IfMatch        types.String       `tfsdk:"if_match"`
	Audit          CouchbaseAuditData `tfsdk:"audit"`
}

OneProject maps project resource schema data; there is a separate response object to avoid conversion error for nested fields.

type Organization

type Organization struct {
	// Audit represents all audit-related fields.
	Audit types.Object `tfsdk:"audit"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Name represents the name of the organization
	Name types.String `tfsdk:"name"`

	// Description is a short description of the organization.
	Description types.String `tfsdk:"description"`

	// Preferences stores preferences for the tenant.
	Preferences types.Object `tfsdk:"preferences"`
}

type Pages added in v1.3.0

type Pages struct {
	Last       types.Int64 `tfsdk:"last"`
	Next       types.Int64 `tfsdk:"next"`
	Page       types.Int64 `tfsdk:"page"`
	PerPage    types.Int64 `tfsdk:"per_page"`
	Previous   types.Int64 `tfsdk:"previous"`
	TotalItems types.Int64 `tfsdk:"total_items"`
}

type PeeringStatus added in v1.3.0

type PeeringStatus struct {
	Reasoning types.String `tfsdk:"reasoning"`
	State     types.String `tfsdk:"state"`
}

PeeringStatus communicates the state of the VPC peering relationship. It is the state and reasoning for VPC peer.

func (PeeringStatus) AttributeTypes added in v1.3.0

func (p PeeringStatus) AttributeTypes() map[string]attr.Type

AttributeTypes returns a mapping of field names to their respective attribute types for the PeeringStatus struct. It is used during the conversion of a types.Object field to a PeeringStatus type.

type Preferences

type Preferences struct {
	// SessionDuration: Maximum allowed time in seconds inside the tenant for a user.
	SessionDuration types.Int64 `tfsdk:"session_duration"`
}

func NewPreferences

func NewPreferences(preference organization.Preferences) Preferences

NewPreferences create new preferences object.

func (Preferences) AttributeTypes

func (p Preferences) AttributeTypes() map[string]attr.Type

type PrivateEndpoint added in v1.3.0

type PrivateEndpoint struct {
	// EndpointId is the id of the private endpoint.
	EndpointId types.String `tfsdk:"endpoint_id"`

	// Status is the endpoint status.  Possible values are failed, linked, pending, pendingAcceptance, rejected and unrecognized.
	Status types.String `tfsdk:"status"`

	// ClusterId is the ID of the cluster associated with the private endpoint.
	ClusterId types.String `tfsdk:"cluster_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	ProjectId types.String `tfsdk:"project_id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	OrganizationId types.String `tfsdk:"organization_id"`
}

PrivateEndpoint represents a private endpoint resource.

func (*PrivateEndpoint) Validate added in v1.3.0

func (p *PrivateEndpoint) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type PrivateEndpointData added in v1.3.0

type PrivateEndpointData struct {
	// Id is the endpoint id.
	Id types.String `tfsdk:"id"`
	// Status is the endpoint status.  Possible values are failed, linked, pending, pendingAcceptance, rejected and unrecognized.
	Status types.String `tfsdk:"status"`
}

PrivateEndpointData defines a single private endpoint.

type PrivateEndpointService added in v1.3.0

type PrivateEndpointService struct {
	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the ID of the cluster associated with the private endpoint service.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Enabled indicates if private endpoint service is enabled/disabled on cluster.
	Enabled types.Bool `tfsdk:"enabled"`
}

PrivateEndpointService represents the status of private endpoint service on a cluster.

func (*PrivateEndpointService) Validate added in v1.3.0

func (p *PrivateEndpointService) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type PrivateEndpoints added in v1.3.0

type PrivateEndpoints struct {
	ClusterId      types.String          `tfsdk:"cluster_id"`
	ProjectId      types.String          `tfsdk:"project_id"`
	OrganizationId types.String          `tfsdk:"organization_id"`
	Data           []PrivateEndpointData `tfsdk:"data"`
}

PrivateEndpoints defines a structure used by the LIST endpoint for private endpoints.

type Project

type Project struct {
	// Description The description of a particular project.
	Description types.String `tfsdk:"description"`

	// Id A GUID4 identifier of the project.
	Id types.String `tfsdk:"id"`

	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Name The name of the project.
	Name types.String `tfsdk:"name"`

	Etag types.String `tfsdk:"etag"`

	IfMatch types.String `tfsdk:"if_match"`

	// Audit All audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`
}

Project maps project resource schema data.

func (Project) Validate

func (p Project) Validate() (map[Attr]string, error)

type ProjectEvents added in v1.3.0

type ProjectEvents struct {
	OrganizationId types.String `tfsdk:"organization_id"`
	ProjectId      types.String `tfsdk:"project_id"`
	ClusterIds     types.Set    `tfsdk:"cluster_ids"`
	UserIds        types.Set    `tfsdk:"user_ids"`
	SeverityLevels types.Set    `tfsdk:"severity_levels"`
	Tags           types.Set    `tfsdk:"tags"`
	From           types.String `tfsdk:"from"`
	To             types.String `tfsdk:"to"`
	Page           types.Int64  `tfsdk:"page"`
	PerPage        types.Int64  `tfsdk:"per_page"`
	SortBy         types.String `tfsdk:"sort_by"`
	SortDirection  types.String `tfsdk:"sort_direction"`
	Data           []EventItem  `tfsdk:"data"`
	Cursor         *Cursor      `tfsdk:"cursor"`
}

ProjectEvents represents a structure for querying project-specific events.

type Projects

type Projects struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Data It contains the list of resources.
	Data []OneProject `tfsdk:"data"`
}

Projects defines the attributes for a list of projects in Capella.

type ProviderConfig added in v1.3.0

type ProviderConfig struct {
	// AWSConfig AWS config data required to establish a VPC peering relationship. Refer to the docs for other limitations to AWS VPC Peering - [ref](https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-basics.html#vpc-peering-limitations).
	AWSConfig *AWSConfig `tfsdk:"aws_config"`

	// GCPConfig GCP config data required to establish a VPC peering relationship. Refer to the docs for other limitations to GCP VPC Peering - [ref](https://cloud.google.com/vpc/docs/vpc-peering).
	GCPConfig *GCPConfig `tfsdk:"gcp_config"`
}

ProviderConfig provides details about the configuration and the ID of the VPC peer on AWS, GCP.

type Resource

type Resource struct {
	// Id is a GUID4 identifier of the resource.
	Id types.String `tfsdk:"id"`

	// Type is the type of the resource.
	Type types.String `tfsdk:"type"`

	// Roles is an array of strings representing a users project roles
	Roles []types.String `tfsdk:"roles"`
}

func MorphResources

func MorphResources(resources []api.Resource) []Resource

MorphResources is used to covert nested resources from strings to terraform types.String TODO (AV-53457): add unit testing.

type Resources

type Resources struct {
	// Buckets contains the details of all buckets with scope and collection level information to which the access applies.
	Buckets []BucketResource `tfsdk:"buckets"`
}

Resources is the level at which the above privileges are defined. Ex: Access of read/write privilege can be defined at the bucket level or scope level resource.

type Restore

type Restore struct {
	// MapData is specified when you want to restore source data into a different location.
	MapData types.String `tfsdk:"map_data"`

	// SourceClusterId represents the Id of the source cluster the restore is based on.
	SourceClusterId types.String `tfsdk:"source_cluster_id"`

	// FilterKeys represents a regular expression. It is used to selectively
	// restore data, allowing only the restoration of data where the key
	// matches a specific regular expression.
	FilterKeys types.String `tfsdk:"filter_keys"`

	// FilterValues represents a regular expression. It is used to selectively
	// restore data, allowing restoration only when the value matches a
	// specific regular expression.
	FilterValues types.String `tfsdk:"filter_values"`

	// IncludeData when specified restores only the data specified here
	IncludeData types.String `tfsdk:"include_data"`

	// ExcludeData when specified, skips restoring the data specified here.
	ExcludeData types.String `tfsdk:"exclude_data"`

	// TargetClusterId represents the Id of the target cluster to restore to.
	TargetClusterId types.String `tfsdk:"target_cluster_id"`

	// ReplaceTTL sets a new expiration (time-to-live) value for the specified keys.
	ReplaceTTL types.String `tfsdk:"replace_ttl"`

	// ReplaceTTLWith updates the expiration for the keys.
	ReplaceTTLWith types.String `tfsdk:"replace_ttl_with"`

	// Status represents the status of restore.
	Status types.String `tfsdk:"status"`

	// Services represents the array of strings (Services) like data, query.
	Services []types.String `tfsdk:"services"`

	// ForceUpdates when marked true forces data in the Couchbase cluster to
	// be overwritten even if the data in the cluster is newer.
	ForceUpdates types.Bool `tfsdk:"force_updates"`

	// AutoRemoveCollections when marked true automatically delete scopes/collections
	// which are known to be deleted in the backup.
	AutoRemoveCollections types.Bool `tfsdk:"auto_remove_collections"`
}

Restore provides information about how to restore the backup.

func (Restore) AttributeTypes

func (r Restore) AttributeTypes() map[string]attr.Type

type SampleBucket added in v1.1.0

type SampleBucket struct {
	// DurabilityLevel is the minimum level at which all writes to the sample bucket must occur.
	// Default: "none"
	// Enum: "none" "majority" "majorityAndPersistActive" "persistToMajority"
	//
	// The options for Durability level are as follows, according to the sample bucket type.
	//
	// For a Couchbase sample bucket:
	// None
	// Replicate to Majority
	// Majority and Persist to Active
	// Persist to Majority
	DurabilityLevel types.String `tfsdk:"durability_level"`

	// Stats has the sample bucket stats that are related to memory and disk consumption.
	// itemCount: Number of documents in the sample bucket.
	// opsPerSecond: Number of operations per second.
	// diskUsedInMib: The amount of disk used (in MiB).
	// memoryUsedInMib: The amount of memory used (in MiB).
	Stats types.Object `tfsdk:"stats"`

	// Type defines the type of the sample bucket.
	// Default: "couchbase"
	//
	// This field for sample buckets is always the default and cannot be changed.
	// The options may also be referred to as Memory and Disk (Couchbase), Memory Only (Ephemeral) in the Couchbase documentation.
	// To learn more, see https://docs.couchbase.com/cloud/clusters/data-service/manage-buckets.html#add-bucket
	Type types.String `tfsdk:"type"`

	// StorageBackend defines the storage engine that is used by the sample bucket.
	// Default: "couchstore"
	//
	// This field for sample buckets is always the default and cannot be changed.
	// This field cannot be changed later.
	// To learn more, see https://docs.couchbase.com/cloud/clusters/data-service/storage-engines.html
	StorageBackend types.String `tfsdk:"storage_backend"`

	// ClusterId is the ID of the cluster for which the database credential needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// BucketConflictResolution is the means by which conflicts are resolved during replication.
	// Default: "seqno"
	//
	// This field for sample buckets is always the default and cannot be changed.
	// This field may be referred to as "conflict resolution" in the Couchbase documentation.
	// seqno may be referred to as "sequence number".
	// This field cannot be changed later.
	// To learn more, see https://docs.couchbase.com/cloud/clusters/xdcr/xdcr.html#conflict-resolution
	BucketConflictResolution types.String `tfsdk:"bucket_conflict_resolution"`

	// Name is the name of the sample bucket.
	// Enum: "travel-sample", "beer-sample", "gamesim-sample"
	Name types.String `tfsdk:"name"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	ProjectId types.String `tfsdk:"project_id"`

	// Id is the id of the created sample bucket.
	Id types.String `tfsdk:"id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	OrganizationId types.String `tfsdk:"organization_id"`

	// EvictionPolicy is the policy which Capella adopts to prevent data loss due to memory exhaustion.
	// This may be also known as Ejection Policy in the Couchbase documentation.
	//
	// For Couchbase sample bucket, Eviction Policy is fullEviction by default and cannot be changed
	// To learn more, see https://docs.couchbase.com/server/current/rest-api/rest-bucket-create.html#evictionpolicy
	EvictionPolicy types.String `tfsdk:"eviction_policy"`

	// MemoryAllocationInMB is the amount of memory to allocate for the sample bucket memory in MiB.
	// This is the maximum limit is dependent on the allocation of the KV service. For example, 80% of the allocation.
	// Default: 200
	//
	// For Couchbase sample buckets, the default and minimum memory allocation is different. The minimum allocation is 100MiB
	MemoryAllocationInMB types.Int64 `tfsdk:"memory_allocation_in_mb"`

	// TimeToLiveInSeconds specifies the time to live (TTL) value in seconds.
	// This is the maximum time to live for items in the sample bucket.
	// Default is 0, that means TTL is disabled. This is a non-negative value.
	TimeToLiveInSeconds types.Int64 `tfsdk:"time_to_live_in_seconds"`

	// Replicas is the number of replicas for the sample bucket.
	// Default: 1
	// Enum: 1 2 3
	Replicas types.Int64 `tfsdk:"replicas"`

	// Flush determines whether flushing is enabled on the sample bucket.
	// Enable Flush to delete all items in this sample bucket at the earliest opportunity.
	// Disable Flush to avoid inadvertent data loss.
	// Default: false
	Flush types.Bool `tfsdk:"flush"`
}

func (SampleBucket) Validate added in v1.1.0

func (b SampleBucket) Validate() (map[Attr]string, error)

Validate will split the IDs by a delimiter i.e. comma , in case a terraform import CLI is invoked. The format of the terraform import CLI would include the IDs as follows - `terraform import couchbase-capella_sample_bucket.new_sample_bucket id=<uuid>,cluster_id=<uuid>,project_id=<uuid>,organization_id=<uuid>`.

type SampleBuckets added in v1.1.0

type SampleBuckets struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Data It contains the list of resources.
	Data []SampleBucket `tfsdk:"data"`
}

SampleBuckets defines attributes for the LIST buckets response received from V4 Capella Public API.

func (SampleBuckets) Validate added in v1.1.0

func (b SampleBuckets) Validate() (clusterId, projectId, organizationId string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type ScheduleInfo

type ScheduleInfo struct {
	// BackupType represents whether the backup is a Weekly or Daily backup.
	BackupType types.String `tfsdk:"backup_type"`

	// BackupTime is the timestamp indicating the backup created time.
	BackupTime types.String `tfsdk:"backup_time"`

	// Retention represents retention time in days.
	Retention types.String `tfsdk:"retention"`

	// Increment represents interval in hours for incremental backup.
	Increment types.Int64 `tfsdk:"increment"`
}

ScheduleInfo provides schedule information of the backup.

func NewScheduleInfo

func NewScheduleInfo(scheduleInfo backup.ScheduleInfo) ScheduleInfo

NewScheduleInfo creates a new ScheduleInfo data object.

func (ScheduleInfo) AttributeTypes

func (b ScheduleInfo) AttributeTypes() map[string]attr.Type

type Scope

type Scope struct {
	// Collections is the array of Collections under a single scope
	Collections types.Set `tfsdk:"collections"`

	// Name is the name of the scope.
	Name types.String `tfsdk:"scope_name"`

	// BucketId is the id of the bucket for which the scope needs to be created.
	BucketId types.String `tfsdk:"bucket_id"`

	// ClusterId is the ID of the cluster for which the scope needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	ProjectId types.String `tfsdk:"project_id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	OrganizationId types.String `tfsdk:"organization_id"`
}

Scope maps Scope resource schema data to the response received from V4 Capella Public API.

func (*Scope) Validate added in v1.1.0

func (s *Scope) Validate() (map[Attr]string, error)

Validate will split the IDs by a delimiter i.e. comma , in case a terraform import CLI is invoked.

type ScopeCollection added in v1.1.0

type ScopeCollection struct {
	// MaxTTL Max TTL of the collection.
	MaxTTL types.Int64 `tfsdk:"max_ttl"`

	// Name is the name of the collection.
	Name types.String `tfsdk:"name"`
}

ScopeCollection defines a Collection within the list of collections in a scope.

func NewCollection added in v1.1.0

func NewCollection(collection scope.Collection) ScopeCollection

NewCollection creates a new collection object.

type ScopeData added in v1.1.0

type ScopeData struct {
	Collections types.Set    `tfsdk:"collections"`
	Name        types.String `tfsdk:"scope_name"`
}

ScopeData defines attributes for a single Scope when fetched from the V4 Capella Public API.

func NewScopeData added in v1.1.0

func NewScopeData(scope *scope.GetScopeResponse,
	collectionSet basetypes.SetValue,
) *ScopeData

NewScopeData creates new scope object.

type ScopeResource added in v1.1.0

type ScopeResource struct {
	Name        types.String   `tfsdk:"name"`
	Collections []types.String `tfsdk:"collections"`
}

ScopeResource is the details of a single scope inside the bucket, and it contains the collections details too. This collections can be a subset of all collections inside the scope, since this is defined only to govern the access.

type Scopes added in v1.1.0

type Scopes struct {
	// Array of scopes. The server returns an array of scopes in the bucket under the single Uid.
	Scopes []ScopeData `tfsdk:"scopes"`

	// BucketId is the id of the bucket for which the scope needs to be created.
	BucketId types.String `tfsdk:"bucket_id"`

	// ClusterId is the ID of the cluster for which the scope needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	ProjectId types.String `tfsdk:"project_id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	OrganizationId types.String `tfsdk:"organization_id"`
}

Scopes defines structure based on the response received from V4 Capella Public API when asked to list scopes.

func (Scopes) Validate added in v1.1.0

func (s Scopes) Validate() (bucketId, clusterId, projectId, organizationId string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type Service

type Service string

Service is the couchbase service to run on the node.

type ServiceGroup

type ServiceGroup struct {
	Node *Node `tfsdk:"node"`

	// Services is the couchbase service to run on the node.
	Services []types.String `tfsdk:"services"`

	// NumOfNodes is number of nodes. The minimum number of nodes for the cluster
	// can be 3 and maximum can be 27 nodes. Additional service groups can have
	// 2 nodes minimum and 24 nodes maximum.
	NumOfNodes types.Int64 `tfsdk:"num_of_nodes"`
}

ServiceGroup is the set of nodes that share the same disk, number of nodes and services.

type Stats

type Stats struct {
	// ItemCount: Number of documents in the bucket.
	ItemCount types.Int64 `tfsdk:"item_count"`
	// OpsPerSecond: Number of operations per second.
	OpsPerSecond types.Int64 `tfsdk:"ops_per_second"`
	// DiskUsedInMib: The amount of disk used (in MiB).
	DiskUsedInMiB types.Int64 `tfsdk:"disk_used_in_mib"`
	// MemoryUsedInMib: The amount of memory used (in MiB).
	MemoryUsedInMiB types.Int64 `tfsdk:"memory_used_in_mib"`
}

Stats has the bucket stats that are related to memory and disk consumption.

func NewStats added in v1.1.0

func NewStats(stats samplebucketapi.Stats) Stats

NewStats creates a new Stats data object.

func (Stats) AttributeTypes

func (s Stats) AttributeTypes() map[string]attr.Type

type Support

type Support struct {
	// Plan is the plan type, either 'Basic', 'Developer Pro', or 'Enterprise'.
	Plan types.String `tfsdk:"plan"`

	// Timezone is the standard timezone for the cluster.
	// Should be the TZ identifier.
	Timezone types.String `tfsdk:"timezone"`
}

Support defines the support plan and timezone for this particular cluster.

type User

type User struct {
	TimeZone       types.String `tfsdk:"time_zone"`
	Region         types.String `tfsdk:"region"`
	Email          types.String `tfsdk:"email"`
	Status         types.String `tfsdk:"status"`
	Audit          types.Object `tfsdk:"audit"`
	OrganizationId types.String `tfsdk:"organization_id"`
	Name           types.String `tfsdk:"name"`
	LastLogin      types.String `tfsdk:"last_login"`
	// ExpiresAt is the time at which user invitation expires.
	ExpiresAt         types.String   `tfsdk:"expires_at"`
	Id                types.String   `tfsdk:"id"`
	OrganizationRoles []types.String `tfsdk:"organization_roles"`
	// Resources is an array of objects representing the resources the user has access to
	Resources           []Resource `tfsdk:"resources"`
	EnableNotifications types.Bool `tfsdk:"enable_notifications"`
	Inactive            types.Bool `tfsdk:"inactive"`
}

User maps User resource schema data.

func NewUser

func NewUser(
	Id types.String,
	name types.String,
	email types.String,
	status types.String,
	inactive types.Bool,
	organizationId types.String,
	organizationRoles []types.String,
	lastLogin types.String,
	region types.String,
	timeZone types.String,
	enableNotifications types.Bool,
	expiresAt types.String,
	resources []Resource,
	audit basetypes.ObjectValue,
) *User

NewUser creates a new instance of a User object.

func (*User) Validate

func (u *User) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type Users

type Users struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Data contains the list of resources.
	Data []User `tfsdk:"data"`
}

Users defines the attributes for a list of users in Capella.

type WeeklySchedule

type WeeklySchedule struct {
	// DayOfWeek represents the day of the week for the backup.
	// Enum: "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"
	DayOfWeek types.String `tfsdk:"day_of_week"`

	// RetentionTime represents the retention time in days.
	// Enum: "30days", "60days", "90days", "180days", "1year", "2years", "3years", "4years", "5years"
	RetentionTime types.String `tfsdk:"retention_time"`

	// StartAt represents the start hour of the backup.
	// Enum: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
	StartAt types.Int64 `tfsdk:"start_at"`

	// IncrementalEvery represents the interval in hours for incremental backup.
	// Enum: 1, 2, 4, 6, 8, 12, 24
	IncrementalEvery types.Int64 `tfsdk:"incremental_every"`

	// CostOptimizedRetention optimizes backup retention to reduce total cost of ownership (TCO).
	CostOptimizedRetention types.Bool `tfsdk:"cost_optimized_retention"`
}

WeeklySchedule represents the weekly schedule of the backup.

func NewWeeklySchedule

func NewWeeklySchedule(weeklySchedule backup_schedule.WeeklySchedule) WeeklySchedule

NewWeeklySchedule creates a new WeeklySchedule data object.

func (WeeklySchedule) AttributeTypes

func (b WeeklySchedule) AttributeTypes() map[string]attr.Type

Jump to

Keyboard shortcuts

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