Documentation ¶
Index ¶
- Constants
- Variables
- func APIClient() (*egoscale.Client, error)
- func AccPreCheck(t *testing.T)
- func AttrFromState(s *terraform.State, r, a string) (string, error)
- func CheckAntiAffinityGroupDestroy(res *egoscale.AntiAffinityGroup) resource.TestCheckFunc
- func CheckAntiAffinityGroupExists(r string, res *egoscale.AntiAffinityGroup) resource.TestCheckFunc
- func CheckElasticIPDestroy(elasticIP *egoscale.ElasticIP) resource.TestCheckFunc
- func CheckElasticIPExists(r string, elasticIP *egoscale.ElasticIP) resource.TestCheckFunc
- func CheckInstanceDestroy(testInstance *egoscale.Instance) resource.TestCheckFunc
- func CheckInstanceExists(r string, testInstance *egoscale.Instance) resource.TestCheckFunc
- func CheckInstancePoolDestroy(pool *egoscale.InstancePool) resource.TestCheckFunc
- func CheckInstancePoolExists(r string, pool *egoscale.InstancePool) resource.TestCheckFunc
- func CheckPrivateNetworkDestroy(privateNetwork *egoscale.PrivateNetwork) resource.TestCheckFunc
- func CheckPrivateNetworkExists(r string, privateNetwork *egoscale.PrivateNetwork) resource.TestCheckFunc
- func CheckResourceAttributes(want TestAttrs, got map[string]string) error
- func CheckResourceState(r string, tests ...TestResourceStateValidationFunc) resource.TestCheckFunc
- func CheckSSHKeyDestroy(sshKey *egoscale.SSHKey) resource.TestCheckFunc
- func CheckSSHKeyExists(r string, sshKey *egoscale.SSHKey) resource.TestCheckFunc
- func CheckSecurityGroupDestroy(securityGroup *egoscale.SecurityGroup) resource.TestCheckFunc
- func CheckSecurityGroupExists(r string, securityGroup *egoscale.SecurityGroup) resource.TestCheckFunc
- func ParseTestdataConfig(path string, spec *TestdataSpec) string
- func Providers() map[string]func() (*schema.Provider, error)
- func TestEnvironment() string
- func ValidateComputeInstanceType(v interface{}, _ cty.Path) diag.Diagnostics
- func ValidateComputeUserData(v interface{}, _ cty.Path) diag.Diagnostics
- func ValidatePortRange(i interface{}, k string) (s []string, es []error)
- func ValidateString(str string) schema.SchemaValidateDiagFunc
- type DataSourceNlbServiceListModel
- type DataSourceTemplateModel
- type ResourceAPIKeyModel
- type ResourceIAMOrgPolicyModel
- type ResourceIAMPolicyServiceRules
- type ResourceIAMPolicyServicesModel
- type ResourceIAMRole
- type ResourceInstancePoolModel
- type ResourceNLBModel
- type ResourceNLBServiceModel
- type TestAttrs
- type TestResourceStateValidationFunc
- type TestdataSpec
Constants ¶
const ( Prefix = "test-terraform-exoscale" TestUsername = "test-exo-username" TestDescription = "Created by the terraform-exoscale provider" TestZoneName = "bg-sof-1" TestInstanceTemplateName = "Linux Ubuntu 20.04 LTS 64-bit" TestInstanceTemplateUsername = "ubuntu" TestInstanceTemplateFilter = "featured" TestInstanceTemplateVisibility = "public" TestInstanceTypeIDTiny = "b6cd1ff5-3a2f-4e9d-a4d1-8988c1191fe8" TestInstanceTypeIDSmall = "21624abb-764e-4def-81d7-9fc54b5957fb" TestInstanceTypeIDMedium = "b6e9d1e8-89fc-4db3-aaa4-9b4c5b1d0844" )
Variables ¶
var TestAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){ "exoscale": func() (tfprotov6.ProviderServer, error) { ctx := context.Background() upgradedProvider, err := tf5to6server.UpgradeServer( ctx, exoscale.Provider().GRPCProvider, ) if err != nil { return nil, err } newProvider := providerserver.NewProtocol6(&provider.ExoscaleProvider{}) providers := []func() tfprotov6.ProviderServer{ func() tfprotov6.ProviderServer { return upgradedProvider }, newProvider, } return tf6muxserver.NewMuxServer(ctx, providers...) }, }
TestAccProtoV6ProviderFactories are used to instantiate a provider during acceptance testing. The factory function will be invoked for every Terraform CLI command executed to create a provider server to which the CLI can reattach.
Functions ¶
func AccPreCheck ¶
func AttrFromState ¶
AttrFromState returns the value of the attribute a for the resource r from the current global state s.
func CheckAntiAffinityGroupDestroy ¶
func CheckAntiAffinityGroupDestroy(res *egoscale.AntiAffinityGroup) resource.TestCheckFunc
func CheckAntiAffinityGroupExists ¶
func CheckAntiAffinityGroupExists(r string, res *egoscale.AntiAffinityGroup) resource.TestCheckFunc
func CheckElasticIPDestroy ¶
func CheckElasticIPDestroy(elasticIP *egoscale.ElasticIP) resource.TestCheckFunc
func CheckElasticIPExists ¶
func CheckElasticIPExists(r string, elasticIP *egoscale.ElasticIP) resource.TestCheckFunc
func CheckInstanceDestroy ¶
func CheckInstanceDestroy(testInstance *egoscale.Instance) resource.TestCheckFunc
func CheckInstanceExists ¶
func CheckInstanceExists(r string, testInstance *egoscale.Instance) resource.TestCheckFunc
func CheckInstancePoolDestroy ¶
func CheckInstancePoolDestroy(pool *egoscale.InstancePool) resource.TestCheckFunc
func CheckInstancePoolExists ¶
func CheckInstancePoolExists(r string, pool *egoscale.InstancePool) resource.TestCheckFunc
func CheckPrivateNetworkDestroy ¶
func CheckPrivateNetworkDestroy(privateNetwork *egoscale.PrivateNetwork) resource.TestCheckFunc
func CheckPrivateNetworkExists ¶
func CheckPrivateNetworkExists(r string, privateNetwork *egoscale.PrivateNetwork) resource.TestCheckFunc
func CheckResourceAttributes ¶
checkResourceAttributes compares a map of resource attributes against a map of expected resource attributes and performs validation on the values.
func CheckResourceState ¶
func CheckResourceState(r string, tests ...TestResourceStateValidationFunc) resource.TestCheckFunc
checkResourceState executes the specified TestResourceStateValidationFunc functions against the state of the resource matching the specified identifier r (e.g. "exoscale_compute.test"), and returns an error if any test function returns an error.
func CheckSSHKeyDestroy ¶
func CheckSSHKeyDestroy(sshKey *egoscale.SSHKey) resource.TestCheckFunc
func CheckSSHKeyExists ¶
func CheckSSHKeyExists(r string, sshKey *egoscale.SSHKey) resource.TestCheckFunc
func CheckSecurityGroupDestroy ¶
func CheckSecurityGroupDestroy(securityGroup *egoscale.SecurityGroup) resource.TestCheckFunc
func CheckSecurityGroupExists ¶
func CheckSecurityGroupExists(r string, securityGroup *egoscale.SecurityGroup) resource.TestCheckFunc
func ParseTestdataConfig ¶ added in v0.58.0
func ParseTestdataConfig(path string, spec *TestdataSpec) string
ParseTestdataConfig loads configuration template and replaces Zone and test ID placeholders. To reduce some error handling boilerplate funcion panics on failure to parse the template.
func TestEnvironment ¶
func TestEnvironment() string
func ValidateComputeInstanceType ¶
func ValidateComputeInstanceType(v interface{}, _ cty.Path) diag.Diagnostics
ValidateComputeInstanceType validates that the given field contains a valid Exoscale Compute instance type.
func ValidateComputeUserData ¶
func ValidateComputeUserData(v interface{}, _ cty.Path) diag.Diagnostics
ValidateComputeUserData validates that the given field contains a valid data.
func ValidatePortRange ¶
ValidatePortRange validates that the given field contains a port range.
func ValidateString ¶
func ValidateString(str string) schema.SchemaValidateDiagFunc
ValidateString validates that the given field is a string and matches the expected value.
Types ¶
type DataSourceNlbServiceListModel ¶ added in v0.52.0
type DataSourceNlbServiceListModel struct { ResourceName string Zone string ID string Name string RawConfig string }
DataSourceNlbServiceListModel maps to datasource_nlb_service_list.tmpl
type DataSourceTemplateModel ¶ added in v0.52.0
type DataSourceTemplateModel struct { ResourceName string Zone string ID string Name string Visibility string }
DataSourceTemplateModel maps to datasource_template.tmpl
type ResourceAPIKeyModel ¶ added in v0.53.0
ResourceAPIKeyModel maps to resource_iam_api_key.tmpl
type ResourceIAMOrgPolicyModel ¶ added in v0.53.0
type ResourceIAMOrgPolicyModel struct { ResourceName string DefaultServiceStrategy string Services map[string]ResourceIAMPolicyServicesModel }
ResourceIAMOrgPolicyModel maps to resource_iam_org_policy.tmpl
type ResourceIAMPolicyServiceRules ¶ added in v0.53.0
ResourceIAMPolicyServiceRules defines nested structure within IAM Policy Service.
type ResourceIAMPolicyServicesModel ¶ added in v0.53.0
type ResourceIAMPolicyServicesModel struct { Type string Rules []ResourceIAMPolicyServiceRules }
ResourceIAMPolicyServicesModel defines nested structure within IAM Policy.
type ResourceIAMRole ¶ added in v0.53.0
type ResourceIAMRole struct { ResourceName string Name string Description string Editable bool Labels map[string]string Permissions string Policy *ResourceIAMOrgPolicyModel }
ResourceIAMRole maps to resource_iam_role.tmpl
type ResourceInstancePoolModel ¶ added in v0.52.0
type ResourceInstancePoolModel struct { ResourceName string Zone string Name string Size int64 TemplateID string Type string DiskSize int64 }
ResourceInstancePoolModel maps to resource_instance_pool.tmpl
type ResourceNLBModel ¶ added in v0.52.0
type ResourceNLBModel struct { ResourceName string Zone string Name string Description string Labels string }
ResourceNLBModel maps to resource_nlb.tmpl
type ResourceNLBServiceModel ¶ added in v0.52.0
type ResourceNLBServiceModel struct { ResourceName string Zone string Name string NLBID string InstancePoolID string Port int64 TargetPort int64 Description string Protocol string Strategy string HealthcheckPort int64 HealthcheckInterval int64 HealthcheckMode string HealthcheckRetries int64 HealthcheckTimeout int64 HealthcheckTLSSNI string HealthcheckURI string }
ResourceNLBServiceModel maps to resource_nlb_service.tmpl
type TestAttrs ¶
type TestAttrs map[string]schema.SchemaValidateDiagFunc
testAttrs represents a map of expected resource attributes during acceptance tests.
type TestResourceStateValidationFunc ¶
type TestResourceStateValidationFunc func(state *terraform.InstanceState) error
testResourceStateValidationFunc represents a resource state validation function.
func CheckResourceStateValidateAttributes ¶
func CheckResourceStateValidateAttributes(want TestAttrs) TestResourceStateValidationFunc
CheckResourceStateValidateAttributes compares a map of resource attributes against a map of expected resource attributes and performs validation on the values.
type TestdataSpec ¶ added in v0.58.0
TestdataSpec embeds ID/Zone into testdata templates.