Documentation
¶
Index ¶
- Constants
- func CheckApiRecordMach(resourceName string, apiClient *client.Client) resource.TestCheckFunc
- func New(version string, clientFactory APIClientFactory) func() provider.Provider
- func RecordResourceFactory(m *sync.Mutex) func() resource.Resource
- type APIClientFactory
- type GoDaddyDNSProvider
- func (p *GoDaddyDNSProvider) Configure(ctx context.Context, req provider.ConfigureRequest, ...)
- func (p *GoDaddyDNSProvider) DataSources(ctx context.Context) []func() datasource.DataSource
- func (p *GoDaddyDNSProvider) Metadata(ctx context.Context, req provider.MetadataRequest, ...)
- func (p *GoDaddyDNSProvider) Resources(ctx context.Context) []func() resource.Resource
- func (p *GoDaddyDNSProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
- type GoDaddyDNSProviderModel
- type RecordResource
- func (r *RecordResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *RecordResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *RecordResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *RecordResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *RecordResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *RecordResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *RecordResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *RecordResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Constants ¶
const GODADDY_API_URL = "https://api.godaddy.com"
testing api at ote is useless
const IMPORT_SEP = ":"
import separator
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
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 (p *GoDaddyDNSProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse)
func (*GoDaddyDNSProvider) DataSources ¶
func (p *GoDaddyDNSProvider) DataSources(ctx context.Context) []func() datasource.DataSource
func (*GoDaddyDNSProvider) Metadata ¶
func (p *GoDaddyDNSProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse)
func (*GoDaddyDNSProvider) Resources ¶
func (p *GoDaddyDNSProvider) Resources(ctx context.Context) []func() resource.Resource
func (*GoDaddyDNSProvider) Schema ¶
func (p *GoDaddyDNSProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
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 (r *RecordResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*RecordResource) Create ¶
func (r *RecordResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
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 (r *RecordResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*RecordResource) ImportState ¶
func (r *RecordResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
terraform import godaddy-dns_record.new-cname domain:CNAME:_test:testing.com
func (*RecordResource) Metadata ¶
func (r *RecordResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*RecordResource) Read ¶
func (r *RecordResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*RecordResource) Schema ¶
func (r *RecordResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*RecordResource) Update ¶
func (r *RecordResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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)