provider

package
v0.15.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LogDataSourceMachine = "datasource-machine"
	LogDataSourceModel   = "datasource-model"
	LogDataSourceOffer   = "datasource-offer"
	LogDataSourceSecret  = "datasource-secret"

	LogResourceApplication     = "resource-application"
	LogResourceAccessModel     = "resource-access-model"
	LogResourceCredential      = "resource-credential"
	LogResourceKubernetesCloud = "resource-kubernetes-cloud"
	LogResourceMachine         = "resource-machine"
	LogResourceModel           = "resource-model"
	LogResourceOffer           = "resource-offer"
	LogResourceSSHKey          = "resource-sshkey"
	LogResourceUser            = "resource-user"
	LogResourceSecret          = "resource-secret"
	LogResourceAccessSecret    = "resource-access-secret"

	LogResourceJAASAccessModel      = "resource-jaas-access-model"
	LogResourceJAASAccessCloud      = "resource-jaas-access-cloud"
	LogResourceJAASAccessGroup      = "resource-jaas-access-group"
	LogResourceJAASAccessOffer      = "resource-jaas-access-offer"
	LogResourceJAASAccessController = "resource-jaas-access-controller"
	LogResourceJAASAccessSvcAcc     = "resource-jaas-access-service-account"
	LogResourceJAASGroup            = "resource-jaas-group"
)

model names for logging @module=juju.<subsystem> e.g.:

@module=juju.resource-application
View Source
const (
	JujuControllerEnvKey   = "JUJU_CONTROLLER_ADDRESSES"
	JujuUsernameEnvKey     = "JUJU_USERNAME"
	JujuPasswordEnvKey     = "JUJU_PASSWORD"
	JujuCACertEnvKey       = "JUJU_CA_CERT"
	JujuClientIDEnvKey     = "JUJU_CLIENT_ID"
	JujuClientSecretEnvKey = "JUJU_CLIENT_SECRET"

	JujuController   = "controller_addresses"
	JujuUsername     = "username"
	JujuPassword     = "password"
	JujuClientID     = "client_id"
	JujuClientSecret = "client_secret"
	JujuCACert       = "ca_certificate"

	TwoSourcesAuthWarning = "Two sources of identity for controller login"
)
View Source
const (
	CharmKey            = "charm"
	CidrsKey            = "cidrs"
	ConfigKey           = "config"
	EndpointsKey        = "endpoints"
	ExposeKey           = "expose"
	SpacesKey           = "spaces"
	EndpointBindingsKey = "endpoint_bindings"
	ResourceKey         = "resources"
	StorageKey          = "storage"
)
View Source
const (
	NameKey           = "name"
	ModelKey          = "model"
	ConstraintsKey    = "constraints"
	DisksKey          = "disks"
	SeriesKey         = "series"
	PlacementKey      = "placement"
	BaseKey           = "base"
	MachineIDKey      = "machine_id"
	SSHAddressKey     = "ssh_address"
	PrivateKeyFileKey = "private_key_file"
	PublicKeyFileKey  = "public_key_file"
)
View Source
const LogResourceIntegration = "resource-integration"

Variables

This section is empty.

Functions

func IsMachineNotFound added in v0.7.0

func IsMachineNotFound(err error) bool

func NewAccessModelResource added in v0.9.0

func NewAccessModelResource() resource.Resource

func NewAccessSecretResource added in v0.12.0

func NewAccessSecretResource() resource.Resource

func NewApplicationResource added in v0.9.0

func NewApplicationResource() resource.Resource

func NewCredentialResource added in v0.9.0

func NewCredentialResource() resource.Resource

func NewIntegrationResource added in v0.9.0

func NewIntegrationResource() resource.Resource

func NewJAASAccessCloudResource added in v0.15.0

func NewJAASAccessCloudResource() resource.Resource

NewJAASAccessCloudResource returns a new resource for JAAS cloud access.

func NewJAASAccessControllerResource added in v0.15.0

func NewJAASAccessControllerResource() resource.Resource

NewJAASAccessControllerResource returns a new resource for JAAS controller access.

func NewJAASAccessGroupResource added in v0.15.0

func NewJAASAccessGroupResource() resource.Resource

NewJAASAccessGroupResource returns a new resource for JAAS group access.

func NewJAASAccessModelResource added in v0.15.0

func NewJAASAccessModelResource() resource.Resource

NewJAASAccessModelResource returns a new resource for JAAS model access.

func NewJAASAccessOfferResource added in v0.15.0

func NewJAASAccessOfferResource() resource.Resource

NewJAASAccessOfferResource returns a new resource for JAAS offer access.

func NewJAASAccessServiceAccountResource added in v0.15.0

func NewJAASAccessServiceAccountResource() resource.Resource

NewJAASAccessServiceAccountResource returns a new resource for JAAS service account access.

func NewJAASGroupResource added in v0.15.0

func NewJAASGroupResource() resource.Resource

NewJAASGroupResource returns a new instance of the JAAS group resource.

func NewJujuProvider added in v0.9.0

func NewJujuProvider(version string) provider.Provider

NewJujuProvider returns a framework style terraform provider.

func NewKubernetesCloudResource added in v0.15.0

func NewKubernetesCloudResource() resource.Resource

func NewMachineDataSource added in v0.9.0

func NewMachineDataSource() datasource.DataSourceWithConfigure

func NewMachineResource added in v0.9.0

func NewMachineResource() resource.Resource

func NewModelDataSource added in v0.9.0

func NewModelDataSource() datasource.DataSourceWithConfigure

func NewModelResource added in v0.9.0

func NewModelResource() resource.Resource

func NewOfferDataSource added in v0.9.0

func NewOfferDataSource() datasource.DataSource

func NewOfferResource added in v0.9.0

func NewOfferResource() resource.Resource

func NewSSHKeyResource added in v0.9.0

func NewSSHKeyResource() resource.Resource

func NewSecretDataSource added in v0.12.0

func NewSecretDataSource() datasource.DataSource

func NewSecretResource added in v0.12.0

func NewSecretResource() resource.Resource

func NewUserResource added in v0.9.0

func NewUserResource() resource.Resource

func ValidatorMatchString added in v0.15.0

func ValidatorMatchString(isValid func(string) bool, message string) validator.String

ValidatorMatchString returns an AttributeValidator which ensures that any configured field is valid according to the validation function passed in.

message will be used when printing error messages for invalid values.

Types

type AvoidJAASValidator added in v0.15.0

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

AvoidJAASValidator enforces that the resource is not used with JAAS. Useful to direct users to more capable resources.

func NewAvoidJAASValidator added in v0.15.0

func NewAvoidJAASValidator(client *juju.Client, preferredObject string) AvoidJAASValidator

NewAvoidJAASValidator creates a new validator that can be used with resources or data sources to enforce that the resource cannot be used with JAAS. Provide a non-empty string for preferredObject to point users to an alternate object in the error messsage. If preferredObject is empty, no hint on an alternate object will be offered in the error message.

func (AvoidJAASValidator) Description added in v0.15.0

func (v AvoidJAASValidator) Description(ctx context.Context) string

Description returns a plain text description of the validator's behavior, suitable for a practitioner to understand its impact.

func (AvoidJAASValidator) MarkdownDescription added in v0.15.0

func (v AvoidJAASValidator) MarkdownDescription(_ context.Context) string

MarkdownDescription returns a markdown formatted description of the validator's behavior, suitable for a practitioner to understand its impact.

func (AvoidJAASValidator) ValidateDataSource added in v0.15.0

ValidateResource performs the validation on the data source.

func (AvoidJAASValidator) ValidateResource added in v0.15.0

ValidateResource performs the validation on the resource.

type Getter added in v0.15.0

type Getter interface {
	Get(ctx context.Context, target interface{}) diag.Diagnostics
}

Getter is used to get details from a plan or state object. Implemented by Terraform's [State] and [Plan] types.

type RequiresJAASValidator added in v0.15.0

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

RequiresJAASValidator enforces that the resource can only be used with JAAS.

func NewRequiresJAASValidator added in v0.15.0

func NewRequiresJAASValidator(client *juju.Client) RequiresJAASValidator

NewRequiresJAASValidator returns a new validator that enforces a resource can only be created against JAAS.

func (RequiresJAASValidator) Description added in v0.15.0

func (v RequiresJAASValidator) Description(ctx context.Context) string

Description returns a plain text description of the validator's behavior, suitable for a practitioner to understand its impact.

func (RequiresJAASValidator) MarkdownDescription added in v0.15.0

func (v RequiresJAASValidator) MarkdownDescription(_ context.Context) string

MarkdownDescription returns a markdown formatted description of the validator's behavior, suitable for a practitioner to understand its impact.

func (RequiresJAASValidator) ValidateDataSource added in v0.15.0

ValidateResource performs the validation on the data source.

func (RequiresJAASValidator) ValidateResource added in v0.15.0

ValidateResource performs the validation on the resource.

type Setter added in v0.15.0

type Setter interface {
	Set(ctx context.Context, target interface{}) diag.Diagnostics
}

Setter is used to set details on a state object. Implemented by Terraform's [State] type.

type StringIsChannelValidator added in v0.12.0

type StringIsChannelValidator struct{}

func (StringIsChannelValidator) Description added in v0.12.0

Description returns a plain text description of the validator's behavior, suitable for a practitioner to understand its impact.

func (StringIsChannelValidator) MarkdownDescription added in v0.12.0

func (v StringIsChannelValidator) MarkdownDescription(context.Context) string

MarkdownDescription returns a markdown formatted description of the validator's behavior, suitable for a practitioner to understand its impact.

func (StringIsChannelValidator) ValidateString added in v0.12.0

Validate runs the main validation logic of the validator, reading configuration data out of `req` and updating `resp` with diagnostics.

type StringIsResourceKeyValidator added in v0.14.0

type StringIsResourceKeyValidator struct{}

func (StringIsResourceKeyValidator) Description added in v0.14.0

Description returns a plain text description of the validator's behavior, suitable for a practitioner to understand its impact.

func (StringIsResourceKeyValidator) MarkdownDescription added in v0.14.0

func (v StringIsResourceKeyValidator) MarkdownDescription(context.Context) string

MarkdownDescription returns a markdown formatted description of the validator's behavior, suitable for a practitioner to understand its impact.

func (StringIsResourceKeyValidator) ValidateMap added in v0.14.0

ValidateMap Validate runs the main validation logic of the validator, reading configuration data out of `req` and updating `resp` with diagnostics.

Jump to

Keyboard shortcuts

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