acctest

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PreCheck

func PreCheck(t *testing.T)

Types

type TestData

type TestData struct {
	// CloudFormationResourceType is the CloudFormation resource type, e.g. "AWS::S3::Bucket".
	CloudFormationResourceType string

	// ResourceName is the resource label (local name), e.g. "test".
	ResourceLabel string

	// ResourceName is the qualified resource name, e.g. "aws_s3_bucket.test".
	ResourceName string

	// TerraformResourceType is the Terraform resource type, e.g. "aws_s3_bucket".
	TerraformResourceType string
	// contains filtered or unexported fields
}

func NewTestData

func NewTestData(_ *testing.T, cfResourceType, tfResourceType, resourceLabel string) TestData

NewTestData returns a new TestData structure.

func (TestData) CheckDestroy

func (td TestData) CheckDestroy() resource.TestCheckFunc

CheckDestroy returns a TestCheckFunc that tests whether a resource has been destroyed in AWS.

func (TestData) CheckExistsInAWS

func (td TestData) CheckExistsInAWS() resource.TestCheckFunc

CheckExistsInAWS returns a TestCheckFunc that tests whether a resource exists in AWS.

func (TestData) DataSourceTest added in v0.0.6

func (td TestData) DataSourceTest(t *testing.T, steps []resource.TestStep)

func (*TestData) DataSourceWithEmptyResourceConfig added in v0.0.7

func (td *TestData) DataSourceWithEmptyResourceConfig() string

DataSourceWithEmptyResourceConfig returns a Terraform configuration for the data source and its respective resource.

func (*TestData) DataSourceWithNonExistentIDConfig added in v0.0.7

func (td *TestData) DataSourceWithNonExistentIDConfig() string

DataSourceWithNonExistentIDConfig returns a Terraform configuration for the data source with the id attribute set to a non-existent resource.

func (TestData) DeleteResource

func (td TestData) DeleteResource() resource.TestCheckFunc

DeleteResource returns a TestCheckFunc that deletes a resource in AWS.

func (*TestData) EmptyConfig

func (td *TestData) EmptyConfig() string

EmptyConfig returns an empty (no attributes) Terraform configuration for the resource.

func (*TestData) EmptyDataSourceConfig added in v0.0.6

func (td *TestData) EmptyDataSourceConfig() string

EmptyDataSourceConfig returns an empty (no attributes) Terraform configuration for the data source.

func (TestData) ProviderFactories added in v0.78.0

func (td TestData) ProviderFactories() map[string]func() (tfprotov6.ProviderServer, error)

func (*TestData) RandomAlphaString

func (td *TestData) RandomAlphaString(n int) string

RandomAlphaString returns a new alphabetic random string of length `n`.

func (*TestData) RandomName

func (td *TestData) RandomName() string

RandomName returns a new random name with the standard prefix `tf-acc-test`.

func (*TestData) Region added in v0.77.0

func (td *TestData) Region() string

Region returns the AWS Region in effect.

func (TestData) ResourceTest

func (td TestData) ResourceTest(t *testing.T, steps []resource.TestStep)

func (TestData) ResourceTestNoProviderFactories added in v0.78.0

func (td TestData) ResourceTestNoProviderFactories(t *testing.T, steps []resource.TestStep)

Jump to

Keyboard shortcuts

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