provider

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const GODADDY_API_URL = "https://api.godaddy.com"

testing api at ote is useless

View Source
const IMPORT_SEP = ":"

import separator

View Source
const TEST_DOMAIN = "veksh.in"

Variables

This section is empty.

Functions

func CheckApiRecordMach

func CheckApiRecordMach(resourceName string, apiClient *client.Client) resource.TestCheckFunc

check that actual record (from API query) matches resource state

func New

func New(version string, clientFactory APIClientFactory) func() provider.Provider

func RecordResourceFactory added in v0.3.1

func RecordResourceFactory(m *sync.Mutex) func() resource.Resource

Types

type APIClientFactory

type APIClientFactory func(apiURL, apiKey, apiSecret string) (model.DNSApiClient, error)

type GoDaddyDNSProvider

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

func (*GoDaddyDNSProvider) Configure

func (*GoDaddyDNSProvider) DataSources

func (p *GoDaddyDNSProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*GoDaddyDNSProvider) Metadata

func (*GoDaddyDNSProvider) Resources

func (p *GoDaddyDNSProvider) Resources(ctx context.Context) []func() resource.Resource

func (*GoDaddyDNSProvider) Schema

type GoDaddyDNSProviderModel

type GoDaddyDNSProviderModel struct {
	APIKey    types.String `tfsdk:"api_key"`
	APISecret types.String `tfsdk:"api_secret"`
}

have to match schema

type RecordResource

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

RecordResource defines the implementation of GoDaddy DNS RR

func (*RecordResource) Configure

func (*RecordResource) Create

create will complain (and fail with client error) if same record is already present (mb as a result of calling "apply" with updated config with old record already gone) so state must be manually imported to continue (could step around this, but this will contradict terraform ideology -- see below)

func (*RecordResource) Delete

func (*RecordResource) ImportState

terraform import godaddy-dns_record.new-cname domain:CNAME:_test:testing.com

func (*RecordResource) Metadata

func (*RecordResource) Read

func (*RecordResource) Schema

func (*RecordResource) Update

updating will fail if resource is already changed externally: old record will be "gone" after refresh, so actually "create" will be called for new one (and see above): i.e. changing "A -> 1.1.1.1" to "A -> 2.2.2.2" first in domain and then in main.tf will result in an error (refresh will mark it as gone and will try to create new) so, do not do that :) the way to settle things down in this case is "refresh" (will mark old as gone) + "import" to new (so state will be ok)

Jump to

Keyboard shortcuts

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