nbconfig

package
v2.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NBConfigAttributes = map[string]schema.Attribute{
	"id": schema.Int64Attribute{
		Description: "The ID of the NodeBalancer config.",
		Required:    true,
	},
	"nodebalancer_id": schema.Int64Attribute{
		Description: "The ID of the NodeBalancer to access.",
		Required:    true,
	},
	"protocol": schema.StringAttribute{
		Description: "The protocol this port is configured to serve. If this is set to https you must include " +
			"an ssl_cert and an ssl_key.",
		Computed: true,
	},
	"proxy_protocol": schema.StringAttribute{
		Description: "The version of ProxyProtocol to use for the underlying NodeBalancer. This requires " +
			"protocol to be `tcp`. Valid values are `none`, `v1`, and `v2`.",
		Computed: true,
	},
	"port": schema.Int64Attribute{
		Description: "The TCP port this Config is for. These values must be unique across configs on a single " +
			"NodeBalancer (you can't have two configs for port 80, for example). While some ports imply some " +
			"protocols, no enforcement is done and you may configure your NodeBalancer however is useful to you. " +
			"For example, while port 443 is generally used for HTTPS, you do not need SSL configured to have a " +
			"NodeBalancer listening on port 443.",
		Computed: true,
	},
	"check_interval": schema.Int64Attribute{
		Description: "How often, in seconds, to check that backends are up and serving requests.",
		Computed:    true,
	},
	"check_timeout": schema.Int64Attribute{
		Description: "How long, in seconds, to wait for a check attempt before considering it failed. (1-30)",
		Computed:    true,
	},
	"check_attempts": schema.Int64Attribute{
		Description: "How many times to attempt a check before considering a backend to be down. (1-30)",
		Computed:    true,
	},
	"algorithm": schema.StringAttribute{
		Description: "What algorithm this NodeBalancer should use for routing traffic to backends: roundrobin, " +
			"leastconn, source",
		Computed: true,
	},
	"stickiness": schema.StringAttribute{
		Description: "Controls how session stickiness is handled on this port: 'none', 'table', 'http_cookie'",
		Computed:    true,
	},
	"check": schema.StringAttribute{
		Description: "The type of check to perform against backends to ensure they are serving requests. " +
			"This is used to determine if backends are up or down. If none no check is performed. " +
			"connection requires only a connection to the backend to succeed. http and http_body rely on the " +
			"backend serving HTTP, and that the response returned matches what is expected.",
		Computed: true,
	},
	"check_path": schema.StringAttribute{
		Description: "The URL path to check on each backend. If the backend does not respond to this request " +
			"it is considered to be down.",
		Computed: true,
	},
	"check_body": schema.StringAttribute{
		Description: "This value must be present in the response body of the check in order for it to pass. " +
			"If this value is not present in the response body of a check request, the backend is considered to be down",
		Computed: true,
	},
	"check_passive": schema.BoolAttribute{
		Description: "If true, any response from this backend with a 5xx status code will be enough for it to " +
			"be considered unhealthy and taken out of rotation.",
		Computed: true,
	},
	"cipher_suite": schema.StringAttribute{
		Description: "What ciphers to use for SSL connections served by this NodeBalancer. `legacy` is " +
			"considered insecure and should only be used if necessary.",
		Computed: true,
	},
	"ssl_commonname": schema.StringAttribute{
		Description: "The read-only common name automatically derived from the SSL certificate assigned to " +
			"this NodeBalancerConfig. Please refer to this field to verify that the appropriate certificate " +
			"is assigned to your NodeBalancerConfig.",
		Computed: true,
	},
	"ssl_fingerprint": schema.StringAttribute{
		Description: "The read-only fingerprint automatically derived from the SSL certificate assigned to " +
			"this NodeBalancerConfig. Please refer to this field to verify that the appropriate certificate " +
			"is assigned to your NodeBalancerConfig.",
		Computed: true,
	},
	"node_status": schema.ListAttribute{
		Description: "A structure containing information about the health of the backends for this port. " +
			"This information is updated periodically as checks are performed against backends.",
		Computed:    true,
		ElementType: statusObjectType,
	},
}
View Source
var NodeStatusTypeV0 = types.StringType
View Source
var NodeStatusTypeV1 = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"up":   types.Int64Type,
		"down": types.Int64Type,
	},
}

Functions

func NewDataSource

func NewDataSource() datasource.DataSource

func NewResource added in v2.20.0

func NewResource() resource.Resource

Types

type DataSource

type DataSource struct {
	helper.BaseDataSource
}

func (*DataSource) Read

type DataSourceModel

type DataSourceModel struct {
	ID             types.Int64  `tfsdk:"id"`
	NodeBalancerID types.Int64  `tfsdk:"nodebalancer_id"`
	Protocol       types.String `tfsdk:"protocol"`
	ProxyProtocol  types.String `tfsdk:"proxy_protocol"`
	Port           types.Int64  `tfsdk:"port"`
	CheckInterval  types.Int64  `tfsdk:"check_interval"`
	CheckTimeout   types.Int64  `tfsdk:"check_timeout"`
	CheckAttempts  types.Int64  `tfsdk:"check_attempts"`
	Algorithm      types.String `tfsdk:"algorithm"`
	Stickiness     types.String `tfsdk:"stickiness"`
	Check          types.String `tfsdk:"check"`
	CheckPath      types.String `tfsdk:"check_path"`
	CheckBody      types.String `tfsdk:"check_body"`
	CheckPassive   types.Bool   `tfsdk:"check_passive"`
	CipherSuite    types.String `tfsdk:"cipher_suite"`
	SSLCommonName  types.String `tfsdk:"ssl_commonname"`
	SSLFingerprint types.String `tfsdk:"ssl_fingerprint"`
	NodesStatus    types.List   `tfsdk:"node_status"`
}

func (*DataSourceModel) ParseNodebalancerConfig added in v2.12.0

func (data *DataSourceModel) ParseNodebalancerConfig(
	config *linodego.NodeBalancerConfig,
) diag.Diagnostics

type Resource

type Resource struct {
	helper.BaseResource
}

func (*Resource) Create added in v2.20.0

func (r *Resource) Create(
	ctx context.Context,
	req resource.CreateRequest,
	resp *resource.CreateResponse,
)

func (*Resource) Delete added in v2.20.0

func (r *Resource) Delete(
	ctx context.Context,
	req resource.DeleteRequest,
	resp *resource.DeleteResponse,
)

func (*Resource) ImportState added in v2.20.0

func (r *Resource) ImportState(
	ctx context.Context,
	req resource.ImportStateRequest,
	resp *resource.ImportStateResponse,
)

func (*Resource) Read added in v2.20.0

func (r *Resource) Read(
	ctx context.Context,
	req resource.ReadRequest,
	resp *resource.ReadResponse,
)

func (*Resource) Update added in v2.20.0

func (r *Resource) Update(
	ctx context.Context,
	req resource.UpdateRequest,
	resp *resource.UpdateResponse,
)

func (*Resource) UpgradeState added in v2.20.0

func (r *Resource) UpgradeState(context.Context) map[int64]resource.StateUpgrader

type ResourceModelV0 added in v2.20.0

type ResourceModelV0 struct {
	ID             types.String `tfsdk:"id"`
	NodeBalancerID types.Int64  `tfsdk:"nodebalancer_id"`
	Protocol       types.String `tfsdk:"protocol"`
	ProxyProtocol  types.String `tfsdk:"proxy_protocol"`
	Port           types.Int64  `tfsdk:"port"`
	CheckInterval  types.Int64  `tfsdk:"check_interval"`
	CheckTimeout   types.Int64  `tfsdk:"check_timeout"`
	CheckAttempts  types.Int64  `tfsdk:"check_attempts"`
	Algorithm      types.String `tfsdk:"algorithm"`
	Stickiness     types.String `tfsdk:"stickiness"`
	Check          types.String `tfsdk:"check"`
	CheckPath      types.String `tfsdk:"check_path"`
	CheckBody      types.String `tfsdk:"check_body"`
	CheckPassive   types.Bool   `tfsdk:"check_passive"`
	CipherSuite    types.String `tfsdk:"cipher_suite"`
	SSLCommonName  types.String `tfsdk:"ssl_commonname"`
	SSLFingerprint types.String `tfsdk:"ssl_fingerprint"`
	NodesStatus    types.Map    `tfsdk:"node_status"`
	SSLCert        types.String `tfsdk:"ssl_cert"`
	SSLKey         types.String `tfsdk:"ssl_key"`
}

type ResourceModelV1 added in v2.20.0

type ResourceModelV1 struct {
	ID             types.String `tfsdk:"id"`
	NodeBalancerID types.Int64  `tfsdk:"nodebalancer_id"`
	Protocol       types.String `tfsdk:"protocol"`
	ProxyProtocol  types.String `tfsdk:"proxy_protocol"`
	Port           types.Int64  `tfsdk:"port"`
	CheckInterval  types.Int64  `tfsdk:"check_interval"`
	CheckTimeout   types.Int64  `tfsdk:"check_timeout"`
	CheckAttempts  types.Int64  `tfsdk:"check_attempts"`
	Algorithm      types.String `tfsdk:"algorithm"`
	Stickiness     types.String `tfsdk:"stickiness"`
	Check          types.String `tfsdk:"check"`
	CheckPath      types.String `tfsdk:"check_path"`
	CheckBody      types.String `tfsdk:"check_body"`
	CheckPassive   types.Bool   `tfsdk:"check_passive"`
	CipherSuite    types.String `tfsdk:"cipher_suite"`
	SSLCommonName  types.String `tfsdk:"ssl_commonname"`
	SSLFingerprint types.String `tfsdk:"ssl_fingerprint"`
	NodesStatus    types.List   `tfsdk:"node_status"`
	SSLCert        types.String `tfsdk:"ssl_cert"`
	SSLKey         types.String `tfsdk:"ssl_key"`
}

func (*ResourceModelV1) CopyFrom added in v2.20.0

func (data *ResourceModelV1) CopyFrom(other ResourceModelV1, preserveKnown bool)

func (*ResourceModelV1) FlattenNodeBalancerConfig added in v2.20.0

func (data *ResourceModelV1) FlattenNodeBalancerConfig(
	config *linodego.NodeBalancerConfig, preserveKnown bool,
) diag.Diagnostics

func (*ResourceModelV1) GetNodeBalancerConfigCreateOptions added in v2.20.0

func (data *ResourceModelV1) GetNodeBalancerConfigCreateOptions(
	ctx context.Context, diags *diag.Diagnostics,
) *linodego.NodeBalancerConfigCreateOptions

func (*ResourceModelV1) GetNodeBalancerConfigUpdateOptions added in v2.20.0

func (data *ResourceModelV1) GetNodeBalancerConfigUpdateOptions(
	ctx context.Context, diags *diag.Diagnostics,
) *linodego.NodeBalancerConfigUpdateOptions

func (*ResourceModelV1) UpgradeFromV0 added in v2.20.0

func (v1 *ResourceModelV1) UpgradeFromV0(
	ctx context.Context, v0 ResourceModelV0,
) diag.Diagnostics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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