provider

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MPL-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAstraAPIURL     = astra.ServerURL
	DefaultAstraAppsDomain = "apps.astra.datastax.com"
	DefaultStreamingAPIURL = "https://api.streaming.datastax.com/"
)

Variables

This section is empty.

Functions

func CompareTerraformAttrToString added in v2.2.0

func CompareTerraformAttrToString(attr attr.Value, s string) bool

func HTTPResponseDiagErr added in v2.2.0

func HTTPResponseDiagErr(resp *http.Response, err error, errorSummary string) diag.Diagnostics

HTTPResponseDiagErr takes an HTTP response and error and creates a Terraform Error Diagnostic if there is an error

func HTTPResponseDiagErrWithBody added in v2.3.0

func HTTPResponseDiagErrWithBody(statusCode int, body []byte, err error, errorSummary string) diag.Diagnostics

HTTPResponseDiagErrWithBody takes an HTTP status code, body, and error and creates a Terraform Error Diagnostic if there is an error

func HTTPResponseDiagWarn added in v2.2.0

func HTTPResponseDiagWarn(resp *http.Response, err error, errorSummary string) diag.Diagnostics

HTTPResponseDiagWarn takes an HTTP response and error and creates a Terraform Warn Diagnostic if there is an error or if the status code is not in the 2xx range

func HTTPResponseDiagWarnWithBody added in v2.3.0

func HTTPResponseDiagWarnWithBody(statusCode int, body []byte, err error, errorSummary string) diag.Diagnostics

HTTPResponseDiagWarnWithBody takes an HTTP status code, body, and error and creates a Terraform Error Diagnostic if there is an error

func MergeTerraformObjects added in v2.2.0

func MergeTerraformObjects(old, new types.Object, attributeTypes map[string]attr.Type) (types.Object, diag.Diagnostics)

MergeTerraformObjects combines two Terraform Objects replacing any null or unknown attribute values in `old` with matching attributes from `new`. Object type attributes are handled recursively to avoid overwriting existing nested attributes in the old Object. Full type information must be specified.

The reason for this function is to handle situations where a remote resource was created but not all configuration was performed successfully. Instead of deleting the misconfigured resource, we can warn the user, and allow them to fix the configuration. In the case of Pulsar namespaces, it's possible that a namespace has been created, but not all of the policy configuration was completed successfully. If the user is warned of the issues, they can re-sync their remote state, and then decide how to proceed, either changing the configuration or deleting the namespace.

func New

func New(version string) func() provider.Provider

New creates an Astra terraform provider using the terraform-plugin-framework

func NewSDKProvider added in v2.1.18

func NewSDKProvider(version string) func() *schema.Provider

New creates an Astra terraform provider using the terraform-plugin-sdk

func NewSDKProviderV6 added in v2.2.0

func NewSDKProviderV6(version string) func() tfprotov6.ProviderServer

NewSDKProviderV6 returns the legacy SDK provider wrapped in a v6 protocol server

func NewStreamingNamespaceResource added in v2.1.18

func NewStreamingNamespaceResource() resource.Resource

NewStreamingNamespaceResource is a helper function to simplify the provider implementation.

func NewStreamingPulsarTokenResource added in v2.1.18

func NewStreamingPulsarTokenResource() resource.Resource

NewStreamingPulsarTokenResource is a helper function to simplify the provider implementation.

func NewStreamingTopicResource added in v2.2.0

func NewStreamingTopicResource() resource.Resource

NewStreamingTopicResource is a helper function to simplify the provider implementation.

func UpdateTerraformObjectWithAttr added in v2.2.0

func UpdateTerraformObjectWithAttr(ctx context.Context, obj types.Object, key string, value attr.Value) (types.Object, diag.Diagnostics)

UpdateTerraformObjectWithAttr adds an Attribute to a Terraform object

Types

type AutoTopicCreationOverridePlanModifier added in v2.2.0

type AutoTopicCreationOverridePlanModifier struct{}

AutoTopicCreationOverridePlanModifier handles special cases related to auto topic creation, such as ensuring that the number of partitions is set to null if the topic_type is set to 'non-partitioned'

func (AutoTopicCreationOverridePlanModifier) Description added in v2.2.0

func (AutoTopicCreationOverridePlanModifier) MarkdownDescription added in v2.2.0

func (AutoTopicCreationOverridePlanModifier) PlanModifyObject added in v2.2.0

type CDCStatus added in v2.2.0

type CDCStatus struct {
	OrgID           string    `json:"orgId"`
	ClusterName     string    `json:"clusterName"`
	Tenant          string    `json:"tenant"`
	Namespace       string    `json:"namespace"`
	ConnectorName   string    `json:"connectorName"`
	ConfigType      string    `json:"configType"`
	DatabaseID      string    `json:"databaseId"`
	DatabaseName    string    `json:"databaseName"`
	Keyspace        string    `json:"keyspace"`
	DatabaseTable   string    `json:"databaseTable"`
	ConnectorStatus string    `json:"connectorStatus"`
	CdcStatus       string    `json:"cdcStatus"`
	CodStatus       string    `json:"codStatus"`
	CreatedAt       time.Time `json:"createdAt"`
	UpdatedAt       time.Time `json:"updatedAt"`
	EventTopic      string    `json:"eventTopic"`
	DataTopic       string    `json:"dataTopic"`
	Instances       int       `json:"instances"`
	CPU             int       `json:"cpu"`
	Memory          int       `json:"memory"`
}

type CDCStatusResponse added in v2.2.0

type CDCStatusResponse []CDCStatus

type OrgId added in v2.1.0

type OrgId struct {
	ID string `json:"id"`
}

type PulsarNamespaceAutoTopicCreationOverride added in v2.2.0

type PulsarNamespaceAutoTopicCreationOverride struct {
	AllowAutoTopicCreation *bool   `tfsdk:"allow_auto_topic_creation" json:"allowAutoTopicCreation,omitempty"`
	TopicType              *string `tfsdk:"topic_type" json:"topicType,omitempty"`
	DefaultNumPartitions   *int64  `tfsdk:"default_num_partitions" json:"defaultNumPartitions,omitempty"`
}

type PulsarNamespaceBacklogQuota added in v2.2.0

type PulsarNamespaceBacklogQuota struct {
	Limit     *int64  `tfsdk:"limit" json:"limit,omitempty"`
	LimitSize *int64  `tfsdk:"limit_size" json:"limitSize,omitempty"`
	LimitTime *int64  `tfsdk:"limit_time" json:"limitTime,omitempty"`
	Policy    *string `tfsdk:"policy" json:"policy,omitempty"`
}

type PulsarNamespaceInactiveTopicPolicies added in v2.2.9

type PulsarNamespaceInactiveTopicPolicies struct {
	DeleteWhileInactive        *bool   `tfsdk:"delete_while_inactive" json:"deleteWhileInactive,omitempty"`
	DeleteMode                 *string `tfsdk:"delete_mode" json:"inactiveTopicDeleteMode,omitempty"`
	MaxInactiveDurationSeconds *int64  `tfsdk:"max_inactive_duration_seconds" json:"maxInactiveDurationSeconds,omitempty"`
}

type PulsarNamespacePolicies added in v2.2.0

type PulsarNamespacePolicies struct {
	IsAllowAutoUpdateSchema               *bool   `tfsdk:"is_allow_auto_update_schema" json:"is_allow_auto_update_schema,omitempty"`
	MessageTTLInSeconds                   *int32  `tfsdk:"message_ttl_in_seconds" json:"message_ttl_in_seconds,omitempty"`
	SchemaAutoUpdateCompatibilityStrategy *string `tfsdk:"schema_auto_update_compatibility_strategy" json:"schema_auto_update_compatibility_strategy,omitempty"`
	SchemaCompatibilityStrategy           *string `tfsdk:"schema_compatibility_strategy" json:"schema_compatibility_strategy,omitempty"`
	SchemaValidationEnforced              *bool   `tfsdk:"schema_validation_enforced" json:"schema_validation_enforced,omitempty"`

	AutoTopicCreationOverride         *PulsarNamespaceAutoTopicCreationOverride `tfsdk:"auto_topic_creation_override" json:"autoTopicCreationOverride,omitempty"`
	BacklogQuota                      map[string]*PulsarNamespaceBacklogQuota   `tfsdk:"backlog_quota_map" json:"backlog_quota_map,omitempty"`
	RetentionPolicies                 *PulsarNamespaceRetentionPolicies         `tfsdk:"retention_policies" json:"retention_policies,omitempty"`
	InactiveTopicPolicies             *PulsarNamespaceInactiveTopicPolicies     `tfsdk:"inactive_topic_policies" json:"inactive_topic_policies,omitempty"`
	SubscriptionExpirationTimeMinutes *int64                                    `tfsdk:"subscription_expiration_time_minutes" json:"subscription_expiration_time_minutes,omitempty"`
	OffloadThreshold                  *int64                                    `tfsdk:"offload_threshold" json:"offload_threshold,omitempty"`
}

type PulsarNamespaceRetentionPolicies added in v2.2.0

type PulsarNamespaceRetentionPolicies struct {
	RetentionTimeInMinutes *int32 `tfsdk:"retention_time_in_minutes" json:"retentionTimeInMinutes,omitempty"`
	RetentionSizeInMB      *int64 `tfsdk:"retention_size_in_mb" json:"retentionSizeInMB,omitempty"`
}

type ServerlessStreamingAvailableRegionsResult added in v2.1.0

type ServerlessStreamingAvailableRegionsResult []struct {
	Tier            string `json:"tier"`
	Description     string `json:"description"`
	CloudProvider   string `json:"cloudProvider"`
	Region          string `json:"region"`
	RegionDisplay   string `json:"regionDisplay"`
	RegionContinent string `json:"regionContinent"`
	Cost            struct {
		CostPerMinCents         int `json:"costPerMinCents"`
		CostPerHourCents        int `json:"costPerHourCents"`
		CostPerDayCents         int `json:"costPerDayCents"`
		CostPerMonthCents       int `json:"costPerMonthCents"`
		CostPerMinMRCents       int `json:"costPerMinMRCents"`
		CostPerHourMRCents      int `json:"costPerHourMRCents"`
		CostPerDayMRCents       int `json:"costPerDayMRCents"`
		CostPerMonthMRCents     int `json:"costPerMonthMRCents"`
		CostPerMinParkedCents   int `json:"costPerMinParkedCents"`
		CostPerHourParkedCents  int `json:"costPerHourParkedCents"`
		CostPerDayParkedCents   int `json:"costPerDayParkedCents"`
		CostPerMonthParkedCents int `json:"costPerMonthParkedCents"`
		CostPerNetworkGbCents   int `json:"costPerNetworkGbCents"`
		CostPerWrittenGbCents   int `json:"costPerWrittenGbCents"`
		CostPerReadGbCents      int `json:"costPerReadGbCents"`
	} `json:"cost"`
	DatabaseCountUsed               int `json:"databaseCountUsed"`
	DatabaseCountLimit              int `json:"databaseCountLimit"`
	CapacityUnitsUsed               int `json:"capacityUnitsUsed"`
	CapacityUnitsLimit              int `json:"capacityUnitsLimit"`
	DefaultStoragePerCapacityUnitGb int `json:"defaultStoragePerCapacityUnitGb"`
}

type SinkResponse added in v2.1.0

type SinkResponse struct {
	Tenant                       string                 `json:"tenant"`
	Namespace                    string                 `json:"namespace"`
	Name                         string                 `json:"name"`
	ClassName                    string                 `json:"className"`
	SourceSubscriptionName       interface{}            `json:"sourceSubscriptionName"`
	SourceSubscriptionPosition   string                 `json:"sourceSubscriptionPosition"`
	Inputs                       interface{}            `json:"inputs"`
	TopicToSerdeClassName        interface{}            `json:"topicToSerdeClassName"`
	TopicsPattern                interface{}            `json:"topicsPattern"`
	TopicToSchemaType            interface{}            `json:"topicToSchemaType"`
	TopicToSchemaProperties      interface{}            `json:"topicToSchemaProperties"`
	MaxMessageRetries            interface{}            `json:"maxMessageRetries"`
	DeadLetterTopic              interface{}            `json:"deadLetterTopic"`
	Configs                      map[string]interface{} `json:"configs"`
	Secrets                      interface{}            `json:"secrets"`
	Parallelism                  int                    `json:"parallelism"`
	ProcessingGuarantees         string                 `json:"processingGuarantees"`
	RetainOrdering               bool                   `json:"retainOrdering"`
	RetainKeyOrdering            bool                   `json:"retainKeyOrdering"`
	Resources                    interface{}            `json:"resources"`
	AutoAck                      bool                   `json:"autoAck"`
	TimeoutMs                    interface{}            `json:"timeoutMs"`
	NegativeAckRedeliveryDelayMs interface{}            `json:"negativeAckRedeliveryDelayMs"`
	Archive                      string                 `json:"archive"`
	CleanupSubscription          interface{}            `json:"cleanupSubscription"`
	RuntimeFlags                 interface{}            `json:"runtimeFlags"`
	CustomRuntimeOptions         interface{}            `json:"customRuntimeOptions"`
}

type StreamingClusters added in v2.1.0

type StreamingClusters []struct {
	ID                     string `json:"id"`
	TenantName             string `json:"tenantName"`
	ClusterName            string `json:"clusterName"`
	WebServiceURL          string `json:"webServiceUrl"`
	BrokerServiceURL       string `json:"brokerServiceUrl"`
	WebsocketURL           string `json:"websocketUrl"`
	WebsocketQueryParamURL string `json:"websocketQueryParamUrl"`
	PulsarToken            string `json:"pulsarToken"`
	Plan                   string `json:"plan"`
	PlanCode               string `json:"planCode"`
	AstraOrgGUID           string `json:"astraOrgGUID"`
	CloudProvider          string `json:"cloudProvider"`
	CloudProviderCode      string `json:"cloudProviderCode"`
	CloudRegion            string `json:"cloudRegion"`
	Status                 string `json:"status"`
	JvmVersion             string `json:"jvmVersion"`
	PulsarVersion          string `json:"pulsarVersion"`
	Email                  string `json:"Email"`
}

type StreamingNamespaceResource added in v2.2.0

type StreamingNamespaceResource struct {
	// contains filtered or unexported fields
}

StreamingNamespaceResource is the resource implementation.

func (*StreamingNamespaceResource) Configure added in v2.2.0

Configure adds the provider configured client to the data source.

func (*StreamingNamespaceResource) Create added in v2.2.0

Create the resource and sets the initial Terraform state.

func (*StreamingNamespaceResource) Delete added in v2.2.0

Delete deletes the resource and removes the Terraform state on success.

func (*StreamingNamespaceResource) ImportState added in v2.2.0

ImportState just reads the ID from the CLI and then calls Read() to get the state of the object

func (*StreamingNamespaceResource) Metadata added in v2.2.0

Metadata returns the data source type name.

func (*StreamingNamespaceResource) Read added in v2.2.0

Read the resource state from the remote resource and update the local Terraform state.

func (*StreamingNamespaceResource) Schema added in v2.2.0

Schema defines the schema for the data source.

func (*StreamingNamespaceResource) Update added in v2.2.0

Update the remote resource and sets the updated Terraform state on success.

type StreamingNamespaceResourceModel added in v2.2.0

type StreamingNamespaceResourceModel struct {
	ID        types.String `tfsdk:"id"`
	Cluster   types.String `tfsdk:"cluster"`
	Tenant    types.String `tfsdk:"tenant"`
	Namespace types.String `tfsdk:"namespace"`
	Policies  types.Object `tfsdk:"policies"`
}

StreamingNamespaceResourceModel maps the resource schema data.

type StreamingPulsarTokenResource added in v2.1.18

type StreamingPulsarTokenResource struct {
	// contains filtered or unexported fields
}

StreamingPulsarTokenResource is the resource implementation.

func (*StreamingPulsarTokenResource) Configure added in v2.1.18

Configure adds the provider configured client to the data source.

func (*StreamingPulsarTokenResource) Create added in v2.1.18

Create creates the resource and sets the initial Terraform state.

func (*StreamingPulsarTokenResource) Delete added in v2.1.18

Delete deletes the resource and removes the Terraform state on success.

func (*StreamingPulsarTokenResource) ImportState added in v2.1.18

func (*StreamingPulsarTokenResource) Metadata added in v2.1.18

Metadata returns the data source type name.

func (*StreamingPulsarTokenResource) Read added in v2.1.18

Read refreshes the Terraform state with the latest data.

func (*StreamingPulsarTokenResource) Schema added in v2.1.18

Schema defines the schema for the data source.

func (*StreamingPulsarTokenResource) Update added in v2.1.18

Update updates the resource and sets the updated Terraform state on success.

type StreamingPulsarTokenResourceModel added in v2.1.18

type StreamingPulsarTokenResourceModel struct {
	ID         types.String `tfsdk:"id"`
	Cluster    types.String `tfsdk:"cluster"`
	Tenant     types.String `tfsdk:"tenant"`
	TimeToLive types.String `tfsdk:"time_to_live"`
	Token      types.String `tfsdk:"token"`
}

StreamingPulsarTokenResourceModel maps the resource schema data.

type StreamingToken added in v2.1.18

type StreamingToken struct {
	Iat     int    `json:"iat"`
	Iss     string `json:"iss"`
	Sub     string `json:"sub"`
	Tokenid string `json:"tokenid"`
}

type StreamingTokens added in v2.1.0

type StreamingTokens []struct {
	Iat     int    `json:"iat"`
	Iss     string `json:"iss"`
	Sub     string `json:"sub"`
	Tokenid string `json:"tokenid"`
}

type StreamingTopicResource added in v2.2.0

type StreamingTopicResource struct {
	// contains filtered or unexported fields
}

StreamingTopicResource is the resource implementation.

func (*StreamingTopicResource) Configure added in v2.2.0

Configure adds the provider configured client to the data source.

func (*StreamingTopicResource) Create added in v2.2.0

Create creates the resource and sets the initial Terraform state.

func (*StreamingTopicResource) Delete added in v2.2.0

Delete deletes the resource and removes the Terraform state on success.

func (*StreamingTopicResource) ImportState added in v2.2.0

func (*StreamingTopicResource) Metadata added in v2.2.0

Metadata returns the data source type name.

func (*StreamingTopicResource) Read added in v2.2.0

Read refreshes the Terraform state with the latest data.

func (*StreamingTopicResource) Schema added in v2.2.0

Schema defines the schema for the data source.

func (*StreamingTopicResource) Update added in v2.2.0

type StreamingTopicResourceModel added in v2.2.0

type StreamingTopicResourceModel struct {
	ID                 types.String          `tfsdk:"id" json:"id,omitempty"`
	Cluster            types.String          `tfsdk:"cluster" json:"cluster,omitempty"`
	CloudProvider      types.String          `tfsdk:"cloud_provider" json:"cloud_provider,omitempty"`
	Region             types.String          `tfsdk:"region" json:"region,omitempty"`
	Tenant             types.String          `tfsdk:"tenant" json:"tenant,omitempty"`
	TenantName         types.String          `tfsdk:"tenant_name" json:"tenant_name,omitempty"`
	Namespace          types.String          `tfsdk:"namespace" json:"namespace,omitempty"`
	Topic              types.String          `tfsdk:"topic" json:"topic,omitempty"`
	Persistent         types.Bool            `tfsdk:"persistent" json:"persistent,omitempty"`
	Partitioned        types.Bool            `tfsdk:"partitioned" json:"partitioned,omitempty"`
	NumPartitions      types.Int64           `tfsdk:"num_partitions" json:"num_partitions,omitempty"`
	DeletionProtection types.Bool            `tfsdk:"deletion_protection" json:"deletion_protection,omitempty"`
	Schema             *StreamingTopicSchema `tfsdk:"schema" json:"schema,omitempty"`
	TopicFQN           types.String          `tfsdk:"topic_fqn" json:"topic_fqn,omitempty"`
}

StreamingTopicResourceModel maps the resource schema data.

type StreamingTopicSchema added in v2.2.0

type StreamingTopicSchema struct {
	Type       *string            `tfsdk:"type" json:"type"`
	Schema     *string            `tfsdk:"schema" json:"schema"`
	Properties *map[string]string `tfsdk:"properties" json:"properties"`
}

Jump to

Keyboard shortcuts

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