Documentation ¶
Index ¶
- func GenSchemaBot(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)
- func New() tfsdk.Provider
- type Bot
- type CredentialSource
- type CredentialSources
- type CredentialsFromIdentityFileBase64
- type CredentialsFromIdentityFilePath
- type CredentialsFromIdentityFileString
- type CredentialsFromKeyAndCertBase64
- type CredentialsFromKeyAndCertPath
- type CredentialsFromNativeMachineID
- type CredentialsFromProfile
- type Provider
- func (p *Provider) Close() error
- func (p *Provider) Configure(ctx context.Context, req tfsdk.ConfigureProviderRequest, ...)
- func (p *Provider) GetDataSources(_ context.Context) (map[string]tfsdk.DataSourceType, diag.Diagnostics)
- func (p *Provider) GetResources(_ context.Context) (map[string]tfsdk.ResourceType, diag.Diagnostics)
- func (p *Provider) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagnostics)
- func (p *Provider) IsConfigured(diags diag.Diagnostics) bool
- type RetryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenSchemaBot ¶
Types ¶
type Bot ¶
type Bot struct { ID types.String `tfsdk:"id"` Name types.String `tfsdk:"name"` Roles []types.String `tfsdk:"roles"` TokenID types.String `tfsdk:"token_id"` Traits types.Map `tfsdk:"traits"` TTL types.String `tfsdk:"token_ttl"` UserName types.String `tfsdk:"user_name"` RoleName types.String `tfsdk:"role_name"` }
Bot is a deserializes representation of the terraform state for this resource.
type CredentialSource ¶
type CredentialSource interface { Name() string IsActive(providerData) (bool, string) Credentials(context.Context, providerData) (client.Credentials, error) }
CredentialSource is a potential way for the Terraform provider to obtain the client.Credentials needed to connect to the Teleport cluster. A CredentialSource is active if the user specified configuration specific to this source. Only active CredentialSources are considered by the Provider.
type CredentialSources ¶
type CredentialSources []CredentialSource
CredentialSources is a list of CredentialSource
func (CredentialSources) ActiveSources ¶
func (s CredentialSources) ActiveSources(ctx context.Context, config providerData) (CredentialSources, diag.Diagnostics)
ActiveSources returns the list of active sources, and an error diagnostic if no source is active. The error diagnostic explains why every source is inactive.
func (CredentialSources) BuildClient ¶
func (s CredentialSources) BuildClient(ctx context.Context, clientCfg client.Config, providerCfg providerData) (*client.Client, diag.Diagnostics)
BuildClient sequentially builds credentials for every source and tries to use them to connect to Teleport. Any CredentialSource failing to return a Credential and a tls.Config causes a hard failure. If we have a valid credential but cannot connect, we send a warning and continue with the next credential (this is for backward compatibility). Expired credentials are skipped for the sake of UX. This is the most common failure mode and we can return an error quickly instead of hanging for 30 whole seconds.
type CredentialsFromIdentityFileBase64 ¶
type CredentialsFromIdentityFileBase64 struct{}
CredentialsFromIdentityFileBase64 builds credentials from an identity file passed as a base64-encoded string.
func (CredentialsFromIdentityFileBase64) Credentials ¶
func (CredentialsFromIdentityFileBase64) Credentials(ctx context.Context, config providerData) (client.Credentials, error)
Credentials implements CredentialSource and returns a client.Credentials for the provider.
func (CredentialsFromIdentityFileBase64) IsActive ¶
func (CredentialsFromIdentityFileBase64) IsActive(config providerData) (bool, string)
IsActive implements CredentialSource and returns if the source is active and why.
func (CredentialsFromIdentityFileBase64) Name ¶
func (CredentialsFromIdentityFileBase64) Name() string
Name implements CredentialSource and returns the source name.
type CredentialsFromIdentityFilePath ¶
type CredentialsFromIdentityFilePath struct{}
CredentialsFromIdentityFilePath builds credentials from an identity file path.
func (CredentialsFromIdentityFilePath) Credentials ¶
func (CredentialsFromIdentityFilePath) Credentials(ctx context.Context, config providerData) (client.Credentials, error)
Credentials implements CredentialSource and returns a client.Credentials for the provider.
func (CredentialsFromIdentityFilePath) IsActive ¶
func (CredentialsFromIdentityFilePath) IsActive(config providerData) (bool, string)
IsActive implements CredentialSource and returns if the source is active and why.
func (CredentialsFromIdentityFilePath) Name ¶
func (CredentialsFromIdentityFilePath) Name() string
Name implements CredentialSource and returns the source name.
type CredentialsFromIdentityFileString ¶
type CredentialsFromIdentityFileString struct{}
CredentialsFromIdentityFileString builds credentials from an identity file passed as a string.
func (CredentialsFromIdentityFileString) Credentials ¶
func (CredentialsFromIdentityFileString) Credentials(ctx context.Context, config providerData) (client.Credentials, error)
Credentials implements CredentialSource and returns a client.Credentials for the provider.
func (CredentialsFromIdentityFileString) IsActive ¶
func (CredentialsFromIdentityFileString) IsActive(config providerData) (bool, string)
IsActive implements CredentialSource and returns if the source is active and why.
func (CredentialsFromIdentityFileString) Name ¶
func (CredentialsFromIdentityFileString) Name() string
Name implements CredentialSource and returns the source name.
type CredentialsFromKeyAndCertBase64 ¶
type CredentialsFromKeyAndCertBase64 struct{}
CredentialsFromKeyAndCertBase64 builds credentials from key, cert, and CA cert base64.
func (CredentialsFromKeyAndCertBase64) Credentials ¶
func (CredentialsFromKeyAndCertBase64) Credentials(ctx context.Context, config providerData) (client.Credentials, error)
Credentials implements CredentialSource and returns a client.Credentials for the provider.
func (CredentialsFromKeyAndCertBase64) IsActive ¶
func (CredentialsFromKeyAndCertBase64) IsActive(config providerData) (bool, string)
IsActive implements CredentialSource and returns if the source is active and why.
func (CredentialsFromKeyAndCertBase64) Name ¶
func (CredentialsFromKeyAndCertBase64) Name() string
Name implements CredentialSource and returns the source name.
type CredentialsFromKeyAndCertPath ¶
type CredentialsFromKeyAndCertPath struct{}
CredentialsFromKeyAndCertPath builds credentials from key, cert and ca cert paths.
func (CredentialsFromKeyAndCertPath) Credentials ¶
func (CredentialsFromKeyAndCertPath) Credentials(ctx context.Context, config providerData) (client.Credentials, error)
Credentials implements CredentialSource and returns a client.Credentials for the provider.
func (CredentialsFromKeyAndCertPath) IsActive ¶
func (CredentialsFromKeyAndCertPath) IsActive(config providerData) (bool, string)
IsActive implements CredentialSource and returns if the source is active and why.
func (CredentialsFromKeyAndCertPath) Name ¶
func (CredentialsFromKeyAndCertPath) Name() string
Name implements CredentialSource and returns the source name.
type CredentialsFromNativeMachineID ¶
type CredentialsFromNativeMachineID struct{}
CredentialsFromNativeMachineID builds credentials by performing a MachineID join and
func (CredentialsFromNativeMachineID) Credentials ¶
func (CredentialsFromNativeMachineID) Credentials(ctx context.Context, config providerData) (client.Credentials, error)
Credentials implements CredentialSource and returns a client.Credentials for the provider.
func (CredentialsFromNativeMachineID) IsActive ¶
func (CredentialsFromNativeMachineID) IsActive(config providerData) (bool, string)
IsActive implements CredentialSource and returns if the source is active and why.
func (CredentialsFromNativeMachineID) Name ¶
func (CredentialsFromNativeMachineID) Name() string
Name implements CredentialSource and returns the source name.
type CredentialsFromProfile ¶
type CredentialsFromProfile struct {
// contains filtered or unexported fields
}
CredentialsFromProfile builds credentials from a local tsh profile.
func (CredentialsFromProfile) Credentials ¶
func (CredentialsFromProfile) Credentials(ctx context.Context, config providerData) (client.Credentials, error)
Credentials implements CredentialSource and returns a client.Credentials for the provider.
func (CredentialsFromProfile) IsActive ¶
func (c CredentialsFromProfile) IsActive(config providerData) (bool, string)
IsActive implements CredentialSource and returns if the source is active and why.
func (CredentialsFromProfile) Name ¶
func (c CredentialsFromProfile) Name() string
Name implements CredentialSource and returns the source name.
type Provider ¶
type Provider struct { Client *client.Client RetryConfig RetryConfig // contains filtered or unexported fields }
Provider Teleport Provider
func (*Provider) Close ¶
Close closes the provider's client and cancels its context. This is needed in the tests to avoid accumulating clients and running out of file descriptors.
func (*Provider) Configure ¶
func (p *Provider) Configure(ctx context.Context, req tfsdk.ConfigureProviderRequest, resp *tfsdk.ConfigureProviderResponse)
Configure configures the Teleport client
func (*Provider) GetDataSources ¶
func (p *Provider) GetDataSources(_ context.Context) (map[string]tfsdk.DataSourceType, diag.Diagnostics)
GetDataSources returns the map of provider data sources
func (*Provider) GetResources ¶
func (p *Provider) GetResources(_ context.Context) (map[string]tfsdk.ResourceType, diag.Diagnostics)
GetResources returns the map of provider resources
func (*Provider) IsConfigured ¶
func (p *Provider) IsConfigured(diags diag.Diagnostics) bool
IsConfigured checks if provider is configured, adds diagnostics if not
Source Files ¶
- credentials.go
- data_source_teleport_access_list.go
- data_source_teleport_access_monitoring_rule.go
- data_source_teleport_app.go
- data_source_teleport_auth_preference.go
- data_source_teleport_cluster_maintenance_config.go
- data_source_teleport_cluster_networking_config.go
- data_source_teleport_database.go
- data_source_teleport_device_trust.go
- data_source_teleport_github_connector.go
- data_source_teleport_installer.go
- data_source_teleport_login_rule.go
- data_source_teleport_oidc_connector.go
- data_source_teleport_okta_import_rule.go
- data_source_teleport_provision_token.go
- data_source_teleport_role.go
- data_source_teleport_saml_connector.go
- data_source_teleport_server.go
- data_source_teleport_session_recording_config.go
- data_source_teleport_static_host_user.go
- data_source_teleport_trusted_cluster.go
- data_source_teleport_user.go
- errors.go
- provider.go
- resource_teleport_access_list.go
- resource_teleport_access_monitoring_rule.go
- resource_teleport_app.go
- resource_teleport_auth_preference.go
- resource_teleport_bot.go
- resource_teleport_cluster_maintenance_config.go
- resource_teleport_cluster_networking_config.go
- resource_teleport_database.go
- resource_teleport_device_trust.go
- resource_teleport_github_connector.go
- resource_teleport_installer.go
- resource_teleport_login_rule.go
- resource_teleport_oidc_connector.go
- resource_teleport_okta_import_rule.go
- resource_teleport_provision_token.go
- resource_teleport_role.go
- resource_teleport_saml_connector.go
- resource_teleport_server.go
- resource_teleport_session_recording_config.go
- resource_teleport_static_host_user.go
- resource_teleport_trusted_cluster.go
- resource_teleport_user.go