Documentation ¶
Index ¶
- Constants
- func AwsProviderVersionsTest(t *testing.T, srcDir string, variables map[string]interface{}, ...)
- func CloudflareProviderVersionsTest(t *testing.T, srcDir string, variables map[string]interface{}, ...)
- func DownloadProviderVersion(t *testing.T, version string, sourceAddress string, providerName string) string
- func DownloadProviderVersionE(version string, sourceAddress string, providerName string) (binaryPath string, err error)
- func DownloadRequiredProviders(t *testing.T, srcDir string, provider string)
- func DownloadTerraformVersion(t *testing.T, version string) string
- func DownloadTerraformVersionE(version string) (binaryPath string, err error)
- func GetAvailableVersions(t *testing.T, release string) []string
- func GetAvailableVersionsE(release string) ([]string, error)
- func GetBinaryPath() (cachePath string)
- func GetBinaryUrl(version string, providerName string) (string, error)
- func GetEcrRepository(t *testing.T, name string) ecrTypes.Repository
- func GetMatchingVersions(t *testing.T, constraint string, versions []string) []string
- func GetMatchingVersionsE(constraint string, versions []string) ([]string, error)
- func GetProviderConstraint(t *testing.T, srcDir, provider string) string
- func GetProviderConstraintE(srcDir, provider string) (string, error)
- func GetSourceAddress(t *testing.T, srcDir, provider string) string
- func GetSourceAddressE(srcDir, provider string, attrribute string) (string, error)
- func GetSsmParameter(t *testing.T, name string) string
- func GetTerraformBinaryUrlE(version string) (string, error)
- func GetTerraformVersionConstraint(t *testing.T, srcDir string) string
- func GetTerraformVersionConstraintE(srcDir string) (string, error)
- func IterateTerraformInDirectory(dir string, fn func(filename string, f *hclwrite.File) error) error
- func TerraformVersionsTest(t *testing.T, srcDir string, variables map[string]interface{}, ...)
- func UpdateModuleSourceAndVersion(t *testing.T, srcDir, module, src, ver string)
- func UpdateModuleSourceAndVersionE(srcDir, module, src, ver string) error
- func UpdateModuleSourceToAbsolutePath(t *testing.T, srcDir, module, path string)
- func UpdateModuleSourceToPath(t *testing.T, srcDir, module, path string)
- func UpdateModuleSourceToPathE(srcDir, module, path string) error
- func UpdateModuleSourcesToLocalPaths(t *testing.T, dst string)
- func UpdateProviderVersion(t *testing.T, dir, provider, version string, providerSource string)
- func UpdateProviderVersionE(dir, provider, version string, providerSource string) error
- type ModuleMetadata
- type ModuleMetadataCatalog
Constants ¶
const (
CloudflareZoneID string = "8a48b990c00669d41f08e99c184f43dc"
)
const (
SSMParameterCloudflareAuthToken string = "TF_CLOUDFLARE_API_TOKEN"
)
Variables ¶
This section is empty.
Functions ¶
func AwsProviderVersionsTest ¶
func DownloadProviderVersion ¶
func DownloadProviderVersion(t *testing.T, version string, sourceAddress string, providerName string) string
DownloadProviderVersion will download the specified version of provider into the ~/.terraform.d/plugin-cache directory.
Usage: * version is the version of provider to download. * sourceAddress is the sourceAddress of provider to download. * providerName is the name of provider to download.
func DownloadProviderVersionE ¶
func DownloadProviderVersionE(version string, sourceAddress string, providerName string) (binaryPath string, err error)
DownloadProviderVersionE will download the specified version of the provider into the ~/.terraform.d/plugin-cache directory Usage: * version is the version of provider to download. * sourceAddress is the sourceAddress of provider to download. * providerName is the name of provider to download.
func DownloadRequiredProviders ¶
DownloadRequiredProviders will download the specified version of provider into the ~/.terraform.d/plugin-cache directory.
Usage: * provider is the name of provider to download.
func DownloadTerraformVersion ¶
DownloadTerraformVersion will download the specified version of Terraform into the ~/.terraform.versions directory.
Usage: * version is the version of Terraform to download.
func DownloadTerraformVersionE ¶
DownloadTerraformVersionE will download the specified version of Terraform into the ~/.terraform.versions directory
Usage: * version is the version of Terraform to download.
func GetAvailableVersions ¶
GetAvailableVersions returns all the released versions of a provider or the Terraform binary or fails the test if something goes wrong
func GetAvailableVersionsE ¶
GetAvailableVersionsE returns all of the versions available for the given provider or the Terraform binary, or returns an error if something goes wrong
func GetBinaryPath ¶
func GetBinaryPath() (cachePath string)
GetBinaryPath will return the cache path required to store the provider cache
Usage: * cachePath is the path required to store the provider cache
func GetBinaryUrl ¶
GetBinaryUrlE will return the correct download URL for the provider binary version requested based on the operating system and architecture by fetching it from the Hashicorp releases API
Usage: * version is the version of provider to download.
func GetEcrRepository ¶
func GetEcrRepository(t *testing.T, name string) ecrTypes.Repository
GetEcrRepository returns the given ECR repository
func GetMatchingVersions ¶
GetMatchingVersions returns a slice of all the given versions that meet the given constraint or fails the test if something goes wrong
func GetMatchingVersionsE ¶
GetMatchingVersionsE returns a slice of the matching version strings that meet the constraint criteria given, or an error if something goes wrong
func GetProviderConstraint ¶
GetProviderConstraint returns the version string for the given provider or fails the test if the provider is not found
func GetProviderConstraintE ¶
GetProviderConstraintE returns the version string for the given provider or an error if the provider cannot be found
func GetSourceAddress ¶
GetSourceAddress returns the source string for the given provider or fails the test if the provider is not found Usage: * provider is the name of provider to download.
func GetSourceAddressE ¶
GetSourceAddressE returns the source string for the given provider or an error if the provider cannot be found Usage: * attrribute is the name of attrribute to return.
func GetSsmParameter ¶
GetSsmParameter returns the value of the given parameter as stored in SSM Parameter Store. It will fail the test if a parameter is not found.
func GetTerraformBinaryUrlE ¶
GetTerraformBinaryUrlE will return the correct download URL for the terraform binary version requested based on the operating system and architecture by fetching it from the Hashicorp releases API
Usage: * version is the version of Terraform to download.
func GetTerraformVersionConstraint ¶
GetTerraformVersionConstraint returns the Terraform version string for the given module or fails the test if the version is not found
func GetTerraformVersionConstraintE ¶
GetTerraformVersionConstraintE returns the Terraform version string for the given module or an error if the provider cannot be found
func IterateTerraformInDirectory ¶
func IterateTerraformInDirectory(dir string, fn func(filename string, f *hclwrite.File) error) error
IterateTerraformInDirectory will iterate over the files in a directory, running the callback function for every Terraform file found.
func TerraformVersionsTest ¶
func UpdateModuleSourceAndVersion ¶
UpdateModuleSourceAndVersion will update the specified modules source and version with the given values.
Usage:
- t is the test runner instance.
- srcDir is the directory that contains the Terraform source files to update.
- module is the name of the module block to update. Use "*" as a wildcard to update all modules
- src is the new source to update the module to
- ver is the new version to update the module to. Use "" to remove the version string.
func UpdateModuleSourceAndVersionE ¶
UpdateModuleSourceAndVersionE will update the specified modules source and version with the given values.
Usage:
- srcDir is the directory that contains the Terraform source files to update.
- module is the name of the module block to update. Use "*" as a wildcard to update all modules
- src is the new source to update the module to
- ver is the new version to update the module to. Use "" to remove the version string.
func UpdateModuleSourceToAbsolutePath ¶
UpdateModuleSourceToAbsolutePath will update the specified modules source to the given path by turning it into an absolute path to enable testing examples by changing the repository location from the remote source to the given local one with changes.
Usage:
- t is the test runner instance.
- srcDir is the directory that contains the Terraform source files to update.
- module is the name of the module block to update. Use "*" as a wildcard to update all modules
- path is the relative path to update the module source argument to
func UpdateModuleSourceToPath ¶
UpdateModuleSourceToPath will update the specified modules source to the given path to enable testing examples by changing the repository location from the remote source to the given local one with changes.
Usage:
- t is the test runner instance.
- srcDir is the directory that contains the Terraform source files to update.
- module is the name of the module block to update. Use "*" as a wildcard to update all modules
- path is the relative path to update the module source argument to
func UpdateModuleSourceToPathE ¶
UpdateModuleSourceToPathE will update the specified modules source to the given path to enable testing examples by changing the repository location from the remote source to the given local one with changes. It will return an error if unable to do so.
Usage:
- srcDir is the directory that contains the Terraform source files to update.
- module is the name of the module block to update. Use "*" as a wildcard to update all modules
- path is the relative path to update the module source argument to
func UpdateProviderVersion ¶
UpdateProviderVersion will update the specified provider's version with the given value.
Usage: * dir is the directory that contains the Terraform source files to update. * provider is the name of the provider to update. * version is the new version to update the provider to. * providerSource is the source of the provider being tested.
func UpdateProviderVersionE ¶
UpdateProviderVersionE will update the specified provider's version with the given value.
Usage: * dir is the directory that contains the Terraform source files to update. * provider is the name of the provider to update. * version is the new version to update the provider to. * providerSource is the source of the provider being tested.
Types ¶
type ModuleMetadata ¶
type ModuleMetadataCatalog ¶
type ModuleMetadataCatalog struct { Meta []ModuleMetadata // contains filtered or unexported fields }
func GetModuleMetadataCatalog ¶
func GetModuleMetadataCatalog() (*ModuleMetadataCatalog, error)
func (*ModuleMetadataCatalog) Init ¶
func (mmc *ModuleMetadataCatalog) Init() error
func (*ModuleMetadataCatalog) Resolve ¶
func (mmc *ModuleMetadataCatalog) Resolve(src string) (string, bool)
func (*ModuleMetadataCatalog) SetRoot ¶
func (mmc *ModuleMetadataCatalog) SetRoot(root string)