Documentation
¶
Index ¶
- Constants
- Variables
- func ACMCertificateDomainFromEnv(t *testing.T) string
- func ACMCertificateRandomSubDomain(rootDomain string) string
- func AccountID(ctx context.Context) string
- func AlternateRegion() string
- func AttrImportStateIdFunc(resourceName, attrName string) resource.ImportStateIdFunc
- func AttrsImportStateIdFunc(resourceName, sep string, attrNames ...string) resource.ImportStateIdFunc
- func AvailableEC2InstanceTypeForAvailabilityZone(availabilityZoneName string, preferredInstanceTypes ...string) string
- func AvailableEC2InstanceTypeForRegion(preferredInstanceTypes ...string) string
- func AvailableEC2InstanceTypeForRegionNamed(name string, preferredInstanceTypes ...string) string
- func CheckACMPCACertificateAuthorityActivateRootCA(ctx context.Context, certificateAuthority *acmpcatypes.CertificateAuthority) resource.TestCheckFunc
- func CheckACMPCACertificateAuthorityActivateSubordinateCA(ctx context.Context, ...) resource.TestCheckFunc
- func CheckACMPCACertificateAuthorityDisableCA(ctx context.Context, certificateAuthority *acmpcatypes.CertificateAuthority) resource.TestCheckFunc
- func CheckACMPCACertificateAuthorityExists(ctx context.Context, n string, ...) resource.TestCheckFunc
- func CheckCallerIdentityAccountID(ctx context.Context, n string) resource.TestCheckFunc
- func CheckDestroyNoop(*terraform.State) error
- func CheckFrameworkResourceDisappears(ctx context.Context, t *testing.T, ...) resource.TestCheckFunc
- func CheckFrameworkResourceDisappearsWithStateFunc(ctx context.Context, t *testing.T, ...) resource.TestCheckFunc
- func CheckResourceAttrAccountID(ctx context.Context, resourceName, attributeName string) resource.TestCheckFunc
- func CheckResourceAttrContains(name, key, substr string) resource.TestCheckFunc
- func CheckResourceAttrEquivalentJSON(n, key, expectedJSON string) resource.TestCheckFunc
- func CheckResourceAttrGlobalARN(ctx context.Context, ...) resource.TestCheckFunc
- func CheckResourceAttrGlobalARNAccountID(resourceName, attributeName, accountID, arnService, arnResource string) resource.TestCheckFunc
- func CheckResourceAttrGlobalARNFormat(ctx context.Context, resourceName, attributeName, arnService, arnFormat string) resource.TestCheckFunc
- func CheckResourceAttrGlobalARNNoAccount(resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc
- func CheckResourceAttrGlobalARNNoAccountFormat(resourceName, attributeName, arnService, arnFormat string) resource.TestCheckFunc
- func CheckResourceAttrGreaterThanOrEqualValue(n, key string, val int) resource.TestCheckFunc
- func CheckResourceAttrGreaterThanValue(n, key string, val int) resource.TestCheckFunc
- func CheckResourceAttrHasPrefix(name, key, prefix string) resource.TestCheckFunc
- func CheckResourceAttrHasSuffix(name, key, suffix string) resource.TestCheckFunc
- func CheckResourceAttrIsJSONString(n, key string) resource.TestCheckFunc
- func CheckResourceAttrJMES(name, key, jmesPath, value string) resource.TestCheckFunc
- func CheckResourceAttrJMESNotExists(name, key, jmesPath string) resource.TestCheckFunc
- func CheckResourceAttrJMESPair(nameFirst, keyFirst, jmesPath, nameSecond, keySecond string) resource.TestCheckFunc
- func CheckResourceAttrJSONNoDiff(n, key, expectedJSON string) resource.TestCheckFunc
- func CheckResourceAttrNameFromPrefix(resourceName string, attributeName string, prefix string) resource.TestCheckFunc
- func CheckResourceAttrNameGenerated(resourceName string, attributeName string) resource.TestCheckFunc
- func CheckResourceAttrNameGeneratedWithPrefix(resourceName string, attributeName string, prefix string) resource.TestCheckFunc
- func CheckResourceAttrNameWithSuffixFromPrefix(resourceName string, attributeName string, prefix string, suffix string) resource.TestCheckFunc
- func CheckResourceAttrNameWithSuffixGenerated(resourceName string, attributeName string, suffix string) resource.TestCheckFunc
- func CheckResourceAttrRFC3339(resourceName, attributeName string) resource.TestCheckFunc
- func CheckResourceAttrRegionalARN(ctx context.Context, ...) resource.TestCheckFunc
- func CheckResourceAttrRegionalARNAccountID(resourceName, attributeName, arnService, accountID, arnResource string) resource.TestCheckFunc
- func CheckResourceAttrRegionalARNFormat(ctx context.Context, resourceName, attributeName, arnService, arnFormat string) resource.TestCheckFunc
- func CheckResourceAttrRegionalARNIgnoreRegionAndAccount(resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc
- func CheckResourceAttrRegionalARNNoAccount(resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc
- func CheckResourceAttrRegionalHostnameService(resourceName, attributeName, serviceName string) resource.TestCheckFunc
- func CheckSDKResourceDisappears(ctx context.Context, t *testing.T, resource *schema.Resource, n string) resource.TestCheckFunc
- func CheckSDKResourceDisappearsWithProvider(ctx context.Context, provider *schema.Provider, resource *schema.Resource, ...) resource.TestCheckFunc
- func CheckSleep(t *testing.T, d time.Duration) resource.TestCheckFunc
- func CheckVPCExists(ctx context.Context, t *testing.T, n string, v *ec2types.Vpc) resource.TestCheckFunc
- func CheckWithNamedProviders(f TestCheckWithProviderFunc, providers map[string]*schema.Provider) resource.TestCheckFunc
- func CheckWithProviders(f TestCheckWithProviderFunc, providers *[]*schema.Provider) resource.TestCheckFunc
- func CheckWithRegions(f TestCheckWithRegionFunc, regions ...string) resource.TestCheckFunc
- func ComposeAggregateImportStateCheckFunc(fs ...resource.ImportStateCheckFunc) resource.ImportStateCheckFunc
- func ConfigAlternateAccountAlternateRegionProvider() string
- func ConfigAlternateAccountProvider() string
- func ConfigAlternateRegionProvider() stringdeprecated
- func ConfigAssumeRole() string
- func ConfigAssumeRolePolicy(policy string) string
- func ConfigAvailableAZsNoOptIn() string
- func ConfigAvailableAZsNoOptInDefaultExclude() string
- func ConfigAvailableAZsNoOptInDefaultExclude_RegionOverride(region string) string
- func ConfigAvailableAZsNoOptInExclude(excludeZoneIds ...string) string
- func ConfigAvailableAZsNoOptInExclude_RegionOverride(region string, excludeZoneIds ...string) string
- func ConfigBedrockAgentKnowledgeBaseS3VectorsBase(rName string) string
- func ConfigCompose(config ...string) string
- func ConfigDefaultAndIgnoreTagsKeyPrefixes1(key1, value1, keyPrefix1 string) string
- func ConfigDefaultAndIgnoreTagsKeys1(key1, value1 string) string
- func ConfigDefaultTags_Tags0() string
- func ConfigDefaultTags_Tags1(tag1, value1 string) string
- func ConfigDefaultTags_Tags2(tag1, value1, tag2, value2 string) string
- func ConfigIgnoreTagsKeyPrefixes1(keyPrefix1 string) string
- func ConfigIgnoreTagsKeys(key1 string) string
- func ConfigLambdaBase(policyName, roleName, sgName string) string
- func ConfigLatestAmazonLinux2HVMEBSARM64AMI() string
- func ConfigLatestAmazonLinux2HVMEBSX8664AMI() string
- func ConfigMultipleAccountProvider(t *testing.T, accounts int) string
- func ConfigMultipleRegionProvider(regions int) string
- func ConfigNamedAccountProvider(providerName, accessKey, profile, secretKey string) string
- func ConfigNamedAlternateAccountAlternateRegionProvider(providerName string) string
- func ConfigNamedRegionalProvider(providerName string, region string) string
- func ConfigProviderMeta() string
- func ConfigRandomPassword(overrides ...string) string
- func ConfigRegionalProvider(region string) string
- func ConfigSkipCredentialsValidationAndRequestingAccountID() string
- func ConfigSubnets(rName string, subnetCount int) string
- func ConfigSubnetsIPv6(rName string, subnetCount int) string
- func ConfigTagPolicyCompliance(severity string) string
- func ConfigTagPolicyComplianceAndDefaultTags1(severity, key1, value1 string) string
- func ConfigVPCWithSubnets(rName string, subnetCount int) string
- func ConfigVPCWithSubnetsEnableDNSHostnames(rName string, subnetCount int) string
- func ConfigVPCWithSubnetsIPv6(rName string, subnetCount int) string
- func ConfigVPCWithSubnets_RegionOverride(rName string, subnetCount int, region string) string
- func ConfigWithEchoProvider(ephemeralResourceData string) string
- func Context(t *testing.T) context.Context
- func CrossRegionAttrImportStateIdFunc(resourceName, attrName string) resource.ImportStateIdFunc
- func CrossRegionImportStateIdFunc(resourceName string) resource.ImportStateIdFunc
- func CrossRegionImportStateIdFuncAdapter(resourceName string, f Func) resource.ImportStateIdFunc
- func DeleteResource(ctx context.Context, resource *schema.Resource, d *schema.ResourceData, ...) error
- func ErrorCheck(t *testing.T, serviceIDs ...string) resource.ErrorCheckFunc
- func ErrorCheckSequence(funcs ...resource.ErrorCheckFunc) resource.ErrorCheckFunc
- func ErrorCheckSkipMessagesContaining(t *testing.T, needles ...string) resource.ErrorCheckFunc
- func ErrorCheckSkipMessagesMatches(t *testing.T, rs ...*regexp.Regexp) resource.ErrorCheckFunc
- func ExpectErrorAttrAtLeastOneOf(attrs ...string) *regexp.Regexp
- func ExpectErrorAttrMinItems(attr string, expected, actual int) *regexp.Regexp
- func FourthRegion() string
- func GlobalARN(arnService, arnResource string) globalARNCheck
- func ImportCheckNoResourceAttr(key string) resource.ImportStateCheckFunc
- func ImportCheckResourceAttr(key, expected string) resource.ImportStateCheckFunc
- func ImportCheckResourceAttrSet(key string) resource.ImportStateCheckFunc
- func ImportMatchResourceAttr(key string, r *regexp.Regexp) resource.ImportStateCheckFunc
- func ImportStateIDAccountID(ctx context.Context) resource.ImportStateIdFunc
- func IsIsolatedPartition(partition string) bool
- func IsIsolatedRegion(region string) bool
- func IsStandardPartition(partitionID string) bool
- func IsStandardRegion(region string) bool
- func ListOfStrings[E ~string](s ...E) string
- func MatchResourceAttrAccountID(resourceName, attributeName string) resource.TestCheckFunc
- func MatchResourceAttrGlobalARN(ctx context.Context, resourceName, attributeName, arnService string, ...) resource.TestCheckFunc
- func MatchResourceAttrGlobalARNNoAccount(resourceName, attributeName, arnService string, ...) resource.TestCheckFunc
- func MatchResourceAttrGlobalHostname(resourceName, attributeName, serviceName string, ...) resource.TestCheckFunc
- func MatchResourceAttrRegionalARN(ctx context.Context, resourceName, attributeName, arnService string, ...) resource.TestCheckFunc
- func MatchResourceAttrRegionalARNAccountID(resourceName, attributeName, arnService, accountID string, ...) resource.TestCheckFunc
- func MatchResourceAttrRegionalARNNoAccount(resourceName, attributeName, arnService string, ...) resource.TestCheckFunc
- func MatchResourceAttrRegionalARNRegion(ctx context.Context, resourceName, attributeName, arnService, region string, ...) resource.TestCheckFunc
- func MatchResourceAttrRegionalHostname(resourceName, attributeName, serviceName string, ...) resource.TestCheckFunc
- func NamedProvider(name string, providers map[string]*schema.Provider) *schema.Provider
- func ParallelTest(ctx context.Context, t *testing.T, c resource.TestCase)
- func Partition() string
- func PartitionDNSSuffix() string
- func PartitionRegions() []string
- func PartitionReverseDNSPrefix() string
- func PreCheck(ctx context.Context, t *testing.T)
- func PreCheckAPIGatewayTypeEDGE(t *testing.T)
- func PreCheckAlternateAccount(t *testing.T)
- func PreCheckAlternateRegion(t *testing.T, regions ...string)
- func PreCheckAssumeRoleARN(t *testing.T)
- func PreCheckCognitoIdentityProvider(ctx context.Context, t *testing.T)
- func PreCheckDirectoryService(ctx context.Context, t *testing.T)
- func PreCheckDirectoryServiceSimpleDirectory(ctx context.Context, t *testing.T)
- func PreCheckFourthAccount(t *testing.T)
- func PreCheckFourthRegion(t *testing.T, regions ...string)
- func PreCheckHasIAMRole(ctx context.Context, t *testing.T, roleName string)
- func PreCheckIAMServiceLinkedRole(ctx context.Context, t *testing.T, pathPrefix string)
- func PreCheckIAMServiceLinkedRoleWithProvider(ctx context.Context, t *testing.T, providerF ProviderFunc, pathPrefix string)
- func PreCheckInspector2(ctx context.Context, t *testing.T)
- func PreCheckMultipleRegion(t *testing.T, regions int)
- func PreCheckOrganizationManagementAccount(ctx context.Context, t *testing.T)
- func PreCheckOrganizationManagementAccountWithProvider(ctx context.Context, t *testing.T, providerF ProviderFunc)
- func PreCheckOrganizationMemberAccount(ctx context.Context, t *testing.T)
- func PreCheckOrganizationMemberAccountWithProvider(ctx context.Context, t *testing.T, providerF ProviderFunc)
- func PreCheckOrganizationsAccount(ctx context.Context, t *testing.T)
- func PreCheckOrganizationsEnabled(ctx context.Context, t *testing.T) *organizationstypes.Organization
- func PreCheckOrganizationsEnabledServicePrincipal(ctx context.Context, t *testing.T, servicePrincipalName string)
- func PreCheckOrganizationsEnabledWithProvider(ctx context.Context, t *testing.T, providerF ProviderFunc) *organizationstypes.Organization
- func PreCheckOutpostsOutposts(ctx context.Context, t *testing.T)
- func PreCheckPartition(t *testing.T, partition string)
- func PreCheckPartitionHasService(t *testing.T, serviceID string)
- func PreCheckPartitionNot(t *testing.T, partitions ...string)
- func PreCheckPinpointApp(ctx context.Context, t *testing.T)
- func PreCheckRAMSharingWithOrganizationEnabled(ctx context.Context, t *testing.T)
- func PreCheckRAMSharingWithOrganizationEnabledWithProvider(ctx context.Context, t *testing.T, providerF ProviderFunc)
- func PreCheckRegion(t *testing.T, regions ...string)
- func PreCheckRegionNot(t *testing.T, regions ...string)
- func PreCheckRegionOptIn(ctx context.Context, t *testing.T, region string)
- func PreCheckResourceGroupsTaggingAPIRequiredTags(ctx context.Context, t *testing.T)
- func PreCheckSSOAdminInstances(ctx context.Context, t *testing.T)
- func PreCheckSSOAdminInstancesWithRegion(ctx context.Context, t *testing.T, region string)
- func PreCheckSameOrganization(ctx context.Context, t *testing.T, providerFs ...ProviderFunc)
- func PreCheckSkipError(err error) bool
- func PreCheckThirdAccount(t *testing.T)
- func PreCheckThirdRegion(t *testing.T, regions ...string)
- func PreCheckWAFV2CloudFrontScope(ctx context.Context, t *testing.T)
- func PrimaryInstanceState(s *terraform.State, name string) (*terraform.InstanceState, error)
- func ProtoV5FactoriesAlternate(ctx context.Context, t *testing.T) map[string]func() (tfprotov5.ProviderServer, error)
- func ProtoV5FactoriesAlternateAccountAndAlternateRegion(ctx context.Context, t *testing.T) map[string]func() (tfprotov5.ProviderServer, error)
- func ProtoV5FactoriesMultipleRegions(ctx context.Context, t *testing.T, n int) map[string]func() (tfprotov5.ProviderServer, error)
- func ProtoV5FactoriesNamed(ctx context.Context, t *testing.T, providers map[string]*schema.Provider, ...) map[string]func() (tfprotov5.ProviderServer, error)
- func ProtoV5FactoriesNamedAlternate(ctx context.Context, t *testing.T, providers map[string]*schema.Provider) map[string]func() (tfprotov5.ProviderServer, error)
- func ProtoV5FactoriesPlusProvidersAlternate(ctx context.Context, t *testing.T, providers *[]*schema.Provider) map[string]func() (tfprotov5.ProviderServer, error)
- func ProtoV5FactoriesPlusProvidersThird(ctx context.Context, t *testing.T, providers *[]*schema.Provider) map[string]func() (tfprotov5.ProviderServer, error)
- func ProtoV6ProviderFactories(_ context.Context, providerNames ...string) map[string]func() (tfprotov6.ProviderServer, error)
- func ProviderAccountID(ctx context.Context, provider *schema.Provider) string
- func ProviderMeta(_ context.Context, t *testing.T) *conns.AWSClient
- func RandInt(t *testing.T) int
- func RandIntRange(t *testing.T, minInt int, maxInt int) int
- func RandomDomain() domainName
- func RandomDomainName() string
- func RandomEmailAddress(domainName string) string
- func RandomFQDomainName() string
- func RandomSubdomain() string
- func RandomWithPrefix(t *testing.T, prefix string) string
- func Region() string
- func RegionsInPartition(partitionName string) []string
- func RegisterServiceErrorCheckFunc(serviceID string, f ServiceErrorCheckFunc)
- func RunLimitedConcurrencyTests2Levels(t *testing.T, semaphore tfsync.Semaphore, ...)
- func RunSerialTests1Level(t *testing.T, testCases map[string]func(*testing.T), d time.Duration)
- func RunSerialTests2Levels(t *testing.T, testCases map[string]map[string]func(*testing.T), ...)
- func S3BucketHasTag(ctx context.Context, bucketName, key, value string) resource.TestCheckFunc
- func Skip(t *testing.T, message string)
- func SkipIfEnvVarNotSet(t *testing.T, key string) string
- func SkipIfExeNotOnPath(t *testing.T, file string) string
- func SkipIfNotRunningAcceptanceTests(t *testing.T)
- func TLSECDSAPrivateKeyPEM(t *testing.T, curveName string) string
- func TLSECDSAPublicKeyPEM(t *testing.T, keyPem string) (string, string)
- func TLSPEMEscapeNewlines(pem string) string
- func TLSPEMRemoveNewlines(pem string) string
- func TLSPEMRemovePublicKeyEncapsulationBoundaries(pem string) string
- func TLSPEMRemoveRSAPrivateKeyEncapsulationBoundaries(pem string) string
- func TLSRSAPrivateKeyPEM(t *testing.T, bits int) string
- func TLSRSAPublicKeyPEM(t *testing.T, keyPem string) string
- func TLSRSAX509CertificateRequestPEM(t *testing.T, keyBits int, commonName string) (string, string)
- func TLSRSAX509LocallySignedCertificatePEM(t *testing.T, caKeyPem, caCertificatePem, keyPem, commonName string) string
- func TLSRSAX509SelfSignedCACertificateForRolesAnywhereTrustAnchorPEM(t *testing.T, keyPem string) string
- func TLSRSAX509SelfSignedCACertificatePEM(t *testing.T, keyPem string) string
- func TLSRSAX509SelfSignedCertificatePEM(t *testing.T, keyPem, commonName string) string
- func Test(ctx context.Context, t *testing.T, c resource.TestCase)
- func ThirdRegion() string
- type Func
- type ProviderFunc
- type ServiceErrorCheckFunc
- type TestCheckWithProviderFunc
- type TestCheckWithRegionFunc
Constants ¶
const ( // Provider name for single configuration testing ProviderName = "aws" // Provider name for alternate configuration testing ProviderNameAlternate = "awsalternate" // Provider name for echo provider // used for testing ephemeral resources ProviderNameEcho = "echo" // Provider name for alternate account and alternate region configuration testing ProviderNameAlternateAccountAlternateRegion = "awsalternateaccountalternateregion" // Provider name for alternate account and same region configuration testing ProviderNameAlternateAccountSameRegion = "awsalternateaccountsameregion" // Provider name for same account and alternate region configuration testing ProviderNameSameAccountAlternateRegion = "awssameaccountalternateregion" // Provider name for third configuration testing ProviderNameThird = "awsthird" // Provider name for fourth configuration testing ProviderNameFourth = "awsfourth" ResourcePrefix = "tf-acc-test" CertificateIssueTimeout = 5 * time.Minute )
const ( Ct12Digit = "123456789012" CtBasic = "basic" CtCertificatePEM = "certificate_pem" CtDisappears = "disappears" CtFalse = "false" CtFalseCaps = "FALSE" CtKey1 = "key1" CtKey2 = "key2" CtName = "name" CtOverlapKey1 = "overlapkey1" CtOverlapKey2 = "overlapkey2" CtPrivateKeyPEM = "private_key_pem" CtProviderKey1 = "providerkey1" CtProviderTags = "provider_tags" CtProviderValue1 = "providervalue1" CtProviderValue1Again = "providervalue1again" CtProviderValue1Updated = "providervalue1updated" CtRName = "rName" CtResourceKey1 = "resourcekey1" CtResourceKey2 = "resourcekey2" CtResourceOwner = "resource_owner" CtResourceTags = "resource_tags" CtResourceValue1 = "resourcevalue1" CtResourceValue1Again = "resourcevalue1again" CtResourceValue1Updated = "resourcevalue1updated" CtResourceValue2 = "resourcevalue2" CtResourceValue2Updated = "resourcevalue2updated" CtRulePound = "rule.#" CtTagsAllPercent = "tags_all.%" CtTagsKey1 = "tags.key1" CtTagsKey2 = "tags.key2" CtTagsPercent = "tags.%" CtTrue = "true" CtTrueCaps = "TRUE" CtValue1 = "value1" CtValue1Updated = "value1updated" CtValue2 = "value2" )
const ( PEMBlockTypeCertificate = `CERTIFICATE` PEMBlockTypeCertificateRequest = `CERTIFICATE REQUEST` PEMBlockTypeECPrivateKey = `EC PRIVATE KEY` PEMBlockTypeRSAPrivateKey = `RSA PRIVATE KEY` PEMBlockTypePublicKey = `PUBLIC KEY` )
const DefaultEmailAddress = "[email protected]"
DefaultEmailAddress is the default email address to set as a resource or data source parameter for acceptance tests.
const RFC3339RegexPattern = `` /* 148-byte string literal not displayed */
Variables ¶
var (
ProtoV5ProviderFactories map[string]func() (tfprotov5.ProviderServer, error) = protoV5ProviderFactoriesInit(context.Background(), ProviderName)
)
ProtoV5ProviderFactories is a static map containing only the main provider instance
Use other ProviderFactories functions, such as FactoriesAlternate, for tests requiring special provider configurations.
var (
Provider *schema.Provider = errs.Must(sdkv2.NewProvider(context.Background()))
)
Provider is the "default" provider instance.
This Provider can be used in testing code for API calls without requiring the use of saving and referencing specific ProviderFactories instances.
PreCheck(t) must be called before using this provider instance.
Functions ¶
func ACMCertificateRandomSubDomain ¶
ACM domain names cannot be longer than 64 characters Other resources, e.g. Cognito User Pool Domains, limit this to 63
func AccountID ¶
AccountID returns the account ID of Provider Must be used within a resource.TestCheckFunc
func AlternateRegion ¶
func AlternateRegion() string
func AttrImportStateIdFunc ¶
func AttrImportStateIdFunc(resourceName, attrName string) resource.ImportStateIdFunc
AttrImportStateIdFunc is a resource.ImportStateIdFunc that returns the value of the specified attribute
func AttrsImportStateIdFunc ¶
func AttrsImportStateIdFunc(resourceName, sep string, attrNames ...string) resource.ImportStateIdFunc
AttrsImportStateIdFunc is a resource.ImportStateIdFunc that returns the values of the specified attributes concatenated with a separator
func AvailableEC2InstanceTypeForAvailabilityZone ¶
func AvailableEC2InstanceTypeForAvailabilityZone(availabilityZoneName string, preferredInstanceTypes ...string) string
AvailableEC2InstanceTypeForAvailabilityZone returns the configuration for a data source that describes the first available EC2 instance type offering in the specified availability zone from a list of preferred instance types. The first argument is either an Availability Zone name or Terraform configuration reference to one, e.g.
- data.aws_availability_zones.available.names[0]
- aws_subnet.test.availability_zone
- us-west-2a
The data source is named 'available'.
func AvailableEC2InstanceTypeForRegion ¶
AvailableEC2InstanceTypeForRegion returns the configuration for a data source that describes the first available EC2 instance type offering in the current region from a list of preferred instance types. The data source is named 'available'.
func AvailableEC2InstanceTypeForRegionNamed ¶
AvailableEC2InstanceTypeForRegionNamed returns the configuration for a data source that describes the first available EC2 instance type offering in the current region from a list of preferred instance types. The data source name is configurable.
func CheckACMPCACertificateAuthorityActivateRootCA ¶
func CheckACMPCACertificateAuthorityActivateRootCA(ctx context.Context, certificateAuthority *acmpcatypes.CertificateAuthority) resource.TestCheckFunc
func CheckACMPCACertificateAuthorityActivateSubordinateCA ¶
func CheckACMPCACertificateAuthorityActivateSubordinateCA(ctx context.Context, rootCertificateAuthority, certificateAuthority *acmpcatypes.CertificateAuthority) resource.TestCheckFunc
func CheckACMPCACertificateAuthorityDisableCA ¶
func CheckACMPCACertificateAuthorityDisableCA(ctx context.Context, certificateAuthority *acmpcatypes.CertificateAuthority) resource.TestCheckFunc
func CheckACMPCACertificateAuthorityExists ¶
func CheckACMPCACertificateAuthorityExists(ctx context.Context, n string, certificateAuthority *acmpcatypes.CertificateAuthority) resource.TestCheckFunc
func CheckCallerIdentityAccountID ¶
func CheckCallerIdentityAccountID(ctx context.Context, n string) resource.TestCheckFunc
func CheckDestroyNoop ¶
CheckDestroyNoop is a TestCheckFunc to be used as a TestCase's CheckDestroy when no such check can be made.
func CheckFrameworkResourceDisappears ¶
func CheckFrameworkResourceDisappears( ctx context.Context, t *testing.T, factory func(context.Context) (fwresource.ResourceWithConfigure, error), n string, ) resource.TestCheckFunc
CheckFrameworkResourceDisappears destroys an existing resource out of band
By default, this check will only copy root-level string arguments into the state used to delete the remote resource. For resources requiring nested or non-string arguments to be available for the delete operation, consider using CheckFrameworkResourceDisappearsWithStateFunc with a custom state function instead.
func CheckFrameworkResourceDisappearsWithStateFunc ¶
func CheckFrameworkResourceDisappearsWithStateFunc( ctx context.Context, t *testing.T, factory func(context.Context) (fwresource.ResourceWithConfigure, error), n string, stateFunc func(ctx context.Context, state *tfsdk.State, is *terraform.InstanceState) error, ) resource.TestCheckFunc
CheckFrameworkResourceDisappearsWithStateFunc destroys an existing resource out of band, constructing state from the provided state function
func CheckResourceAttrAccountID ¶
func CheckResourceAttrAccountID(ctx context.Context, resourceName, attributeName string) resource.TestCheckFunc
CheckResourceAttrAccountID ensures the Terraform state exactly matches the account ID
func CheckResourceAttrContains ¶
func CheckResourceAttrContains(name, key, substr string) resource.TestCheckFunc
CheckResourceAttrContains ensures the Terraform state value contains the specified substr.
func CheckResourceAttrEquivalentJSON ¶
func CheckResourceAttrEquivalentJSON(n, key, expectedJSON string) resource.TestCheckFunc
CheckResourceAttrEquivalentJSON is a TestCheckFunc that compares a JSON value with an expected value. Both JSON values are normalized before being compared.
func CheckResourceAttrGlobalARN ¶
func CheckResourceAttrGlobalARN(ctx context.Context, resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc
CheckResourceAttrGlobalARN ensures the Terraform state exactly matches a formatted ARN without region
func CheckResourceAttrGlobalARNAccountID ¶
func CheckResourceAttrGlobalARNAccountID(resourceName, attributeName, accountID, arnService, arnResource string) resource.TestCheckFunc
CheckResourceAttrGlobalARNAccountID ensures the Terraform state exactly matches a formatted ARN without region and with specific account ID
func CheckResourceAttrGlobalARNFormat ¶
func CheckResourceAttrGlobalARNFormat(ctx context.Context, resourceName, attributeName, arnService, arnFormat string) resource.TestCheckFunc
func CheckResourceAttrGlobalARNNoAccount ¶
func CheckResourceAttrGlobalARNNoAccount(resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc
CheckResourceAttrGlobalARNNoAccount ensures the Terraform state exactly matches a formatted ARN without region or account ID
func CheckResourceAttrGlobalARNNoAccountFormat ¶
func CheckResourceAttrGlobalARNNoAccountFormat(resourceName, attributeName, arnService, arnFormat string) resource.TestCheckFunc
func CheckResourceAttrGreaterThanOrEqualValue ¶
func CheckResourceAttrGreaterThanOrEqualValue(n, key string, val int) resource.TestCheckFunc
func CheckResourceAttrGreaterThanValue ¶
func CheckResourceAttrGreaterThanValue(n, key string, val int) resource.TestCheckFunc
func CheckResourceAttrHasPrefix ¶
func CheckResourceAttrHasPrefix(name, key, prefix string) resource.TestCheckFunc
CheckResourceAttrHasPrefix ensures the Terraform state value has the specified prefix.
func CheckResourceAttrHasSuffix ¶
func CheckResourceAttrHasSuffix(name, key, suffix string) resource.TestCheckFunc
CheckResourceAttrHasSuffix ensures the Terraform state value has the specified suffix.
func CheckResourceAttrIsJSONString ¶
func CheckResourceAttrIsJSONString(n, key string) resource.TestCheckFunc
func CheckResourceAttrJMES ¶
func CheckResourceAttrJMES(name, key, jmesPath, value string) resource.TestCheckFunc
func CheckResourceAttrJMESNotExists ¶
func CheckResourceAttrJMESNotExists(name, key, jmesPath string) resource.TestCheckFunc
func CheckResourceAttrJMESPair ¶
func CheckResourceAttrJMESPair(nameFirst, keyFirst, jmesPath, nameSecond, keySecond string) resource.TestCheckFunc
func CheckResourceAttrJSONNoDiff ¶
func CheckResourceAttrJSONNoDiff(n, key, expectedJSON string) resource.TestCheckFunc
func CheckResourceAttrNameFromPrefix ¶
func CheckResourceAttrNameFromPrefix(resourceName string, attributeName string, prefix string) resource.TestCheckFunc
CheckResourceAttrNameFromPrefix verifies that the state attribute value matches name generated from given prefix
func CheckResourceAttrNameGenerated ¶
func CheckResourceAttrNameGenerated(resourceName string, attributeName string) resource.TestCheckFunc
CheckResourceAttrNameGenerated verifies that the state attribute value matches name automatically generated without prefix
func CheckResourceAttrNameGeneratedWithPrefix ¶
func CheckResourceAttrNameGeneratedWithPrefix(resourceName string, attributeName string, prefix string) resource.TestCheckFunc
CheckResourceAttrNameGeneratedWithPrefix verifies that the state attribute value matches name automatically generated with prefix
func CheckResourceAttrNameWithSuffixFromPrefix ¶
func CheckResourceAttrNameWithSuffixFromPrefix(resourceName string, attributeName string, prefix string, suffix string) resource.TestCheckFunc
CheckResourceAttrNameWithSuffixFromPrefix verifies that the state attribute value matches name with suffix generated from given prefix
func CheckResourceAttrNameWithSuffixGenerated ¶
func CheckResourceAttrNameWithSuffixGenerated(resourceName string, attributeName string, suffix string) resource.TestCheckFunc
CheckResourceAttrNameWithSuffixGenerated verifies that the state attribute value matches name with suffix automatically generated without prefix
func CheckResourceAttrRFC3339 ¶
func CheckResourceAttrRFC3339(resourceName, attributeName string) resource.TestCheckFunc
CheckResourceAttrRFC3339 ensures the Terraform state matches a RFC3339 value This TestCheckFunc will likely be moved to the Terraform Plugin SDK in the future.
func CheckResourceAttrRegionalARN ¶
func CheckResourceAttrRegionalARN(ctx context.Context, resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc
CheckResourceAttrRegionalARN ensures the Terraform state exactly matches a formatted ARN with region
func CheckResourceAttrRegionalARNAccountID ¶
func CheckResourceAttrRegionalARNAccountID(resourceName, attributeName, arnService, accountID, arnResource string) resource.TestCheckFunc
CheckResourceAttrRegionalARNAccountID ensures the Terraform state exactly matches a formatted ARN with region and specific account ID
func CheckResourceAttrRegionalARNFormat ¶
func CheckResourceAttrRegionalARNFormat(ctx context.Context, resourceName, attributeName, arnService, arnFormat string) resource.TestCheckFunc
func CheckResourceAttrRegionalARNIgnoreRegionAndAccount ¶
func CheckResourceAttrRegionalARNIgnoreRegionAndAccount(resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc
CheckResourceAttrRegionalARNIgnoreRegionAndAccount ensures the Terraform state exactly matches a formatted ARN with region without specifying the region or account
func CheckResourceAttrRegionalARNNoAccount ¶
func CheckResourceAttrRegionalARNNoAccount(resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc
CheckResourceAttrRegionalARNNoAccount ensures the Terraform state exactly matches a formatted ARN with region but without account ID
func CheckResourceAttrRegionalHostnameService ¶
func CheckResourceAttrRegionalHostnameService(resourceName, attributeName, serviceName string) resource.TestCheckFunc
CheckResourceAttrRegionalHostnameService ensures the Terraform state exactly matches a service DNS hostname with region and partition DNS suffix
For example: ec2.us-west-2.amazonaws.com
func CheckSleep ¶
CheckSleep returns a TestCheckFunc that pauses the current goroutine for at least the duration d.
func CheckVPCExists ¶
func CheckWithNamedProviders ¶
func CheckWithNamedProviders(f TestCheckWithProviderFunc, providers map[string]*schema.Provider) resource.TestCheckFunc
func CheckWithProviders ¶
func CheckWithProviders(f TestCheckWithProviderFunc, providers *[]*schema.Provider) resource.TestCheckFunc
func CheckWithRegions ¶
func CheckWithRegions(f TestCheckWithRegionFunc, regions ...string) resource.TestCheckFunc
func ComposeAggregateImportStateCheckFunc ¶
func ComposeAggregateImportStateCheckFunc(fs ...resource.ImportStateCheckFunc) resource.ImportStateCheckFunc
ComposeAggregateImportStateCheckFunc lets you compose multiple ImportStateCheckFunc into a single ImportStateCheckFunc.
func ConfigAlternateAccountAlternateRegionProvider ¶
func ConfigAlternateAccountAlternateRegionProvider() string
func ConfigAlternateAccountProvider ¶
func ConfigAlternateAccountProvider() string
func ConfigAlternateRegionProvider
deprecated
func ConfigAlternateRegionProvider() string
Deprecated: Use ConfigMultipleRegionProvider instead
func ConfigAssumeRole ¶
func ConfigAssumeRole() string
func ConfigAssumeRolePolicy ¶
func ConfigAvailableAZsNoOptIn ¶
func ConfigAvailableAZsNoOptIn() string
func ConfigAvailableAZsNoOptInDefaultExclude ¶
func ConfigAvailableAZsNoOptInDefaultExclude() string
func ConfigCompose ¶
ConfigCompose can be called to concatenate multiple strings to build test configurations
func ConfigDefaultTags_Tags0 ¶
func ConfigDefaultTags_Tags0() string
func ConfigDefaultTags_Tags1 ¶
func ConfigDefaultTags_Tags2 ¶
func ConfigIgnoreTagsKeys ¶
func ConfigLambdaBase ¶
func ConfigLatestAmazonLinux2HVMEBSARM64AMI ¶
func ConfigLatestAmazonLinux2HVMEBSARM64AMI() string
ConfigLatestAmazonLinux2HVMEBSARM64AMI returns the configuration for a data source that describes the latest Amazon Linux 2 arm64 AMI using HVM virtualization and an EBS root device. The data source is named 'amzn2-ami-minimal-hvm-ebs-arm64'.
func ConfigLatestAmazonLinux2HVMEBSX8664AMI ¶
func ConfigLatestAmazonLinux2HVMEBSX8664AMI() string
ConfigLatestAmazonLinux2HVMEBSX8664AMI returns the configuration for a data source that describes the latest Amazon Linux 2 x86_64 AMI using HVM virtualization and an EBS root device. The data source is named 'amzn2-ami-minimal-hvm-ebs-x86_64'.
func ConfigNamedAccountProvider ¶
ConfigNamedAccountProvider creates a new provider named configuration with a region.
This can be used to build multiple provider configuration testing.
func ConfigNamedRegionalProvider ¶
ConfigNamedRegionalProvider creates a new named provider configuration with a region.
This can be used to build multiple provider configuration testing.
func ConfigProviderMeta ¶
func ConfigProviderMeta() string
ConfigProviderMeta returns a terraform block with provider_meta configured
func ConfigRandomPassword ¶
ConfigRandomPassword returns the configuration for an ephemeral resource that describes a random password.
The ephemeral resource is named 'test'. Use ephemeral.aws_secretsmanager_random_password.test.random_password to reference the password value, assigning it to a write-only argument ("_wo").
The function accepts a variable number of string arguments in the format "key=value". The following keys are supported:
- password_length: The length of the password. Default is 20.
- exclude_punctuation: Whether to exclude punctuation characters. Default is true.
- exclude_characters: A string of characters to exclude from the password.
- exclude_lowercase: Whether to exclude lowercase letters. Default is false.
- exclude_numbers: Whether to exclude numbers. Default is false.
- exclude_uppercase: Whether to exclude uppercase letters. Default is false.
- include_space: Whether to include a space character. Default is false.
- require_each_included_type: Whether to require at least one character from each included type. Default is false.
Called without overrides, the function returns the default configuration:
ephemeral "aws_secretsmanager_random_password" "test" {
password_length = 20
exclude_punctuation = true
}
func ConfigRegionalProvider ¶
ConfigRegionalProvider creates a new provider configuration with a region.
This can only be used for single provider configuration testing as it overwrites the "aws" provider configuration.
func ConfigSkipCredentialsValidationAndRequestingAccountID ¶
func ConfigSkipCredentialsValidationAndRequestingAccountID() string
func ConfigSubnets ¶
func ConfigSubnetsIPv6 ¶
func ConfigTagPolicyCompliance ¶
ConfigTagPolicyCompliance enables tag policy enforcement with the provided severity
func ConfigTagPolicyComplianceAndDefaultTags1 ¶
ConfigTagPolicyComplianceAndDefaultTags1 enables tag policy enforcement with the provided severity and a default tag
func ConfigVPCWithSubnets ¶
func ConfigWithEchoProvider ¶
func CrossRegionAttrImportStateIdFunc ¶
func CrossRegionAttrImportStateIdFunc(resourceName, attrName string) resource.ImportStateIdFunc
CrossRegionAttrImportStateIdFunc is a resource.ImportStateIdFunc that returns the value of the specified attribute and appends the region
func CrossRegionImportStateIdFunc ¶
func CrossRegionImportStateIdFunc(resourceName string) resource.ImportStateIdFunc
CrossRegionImportStateIdFunc is a resource.ImportStateIdFunc that appends the region
func CrossRegionImportStateIdFuncAdapter ¶
func CrossRegionImportStateIdFuncAdapter(resourceName string, f Func) resource.ImportStateIdFunc
CrossRegionImportStateIdFuncAdapter adapts an ImportStateIdFunc by appending the region
func DeleteResource ¶
func ErrorCheck ¶
func ErrorCheck(t *testing.T, serviceIDs ...string) resource.ErrorCheckFunc
func ErrorCheckSequence ¶
func ErrorCheckSequence(funcs ...resource.ErrorCheckFunc) resource.ErrorCheckFunc
func ErrorCheckSkipMessagesContaining ¶
func ErrorCheckSkipMessagesContaining(t *testing.T, needles ...string) resource.ErrorCheckFunc
ErrorCheckSkipMessagesContaining skips tests based on error messages that contain one of the specified needles.
func ErrorCheckSkipMessagesMatches ¶
ErrorCheckSkipMessagesMatches skips tests based on error messages that match one of the specified regular expressions.
func ExpectErrorAttrMinItems ¶
func FourthRegion ¶
func FourthRegion() string
func ImportCheckNoResourceAttr ¶
func ImportCheckNoResourceAttr(key string) resource.ImportStateCheckFunc
func ImportCheckResourceAttr ¶
func ImportCheckResourceAttr(key, expected string) resource.ImportStateCheckFunc
func ImportCheckResourceAttrSet ¶
func ImportCheckResourceAttrSet(key string) resource.ImportStateCheckFunc
func ImportMatchResourceAttr ¶
func ImportMatchResourceAttr(key string, r *regexp.Regexp) resource.ImportStateCheckFunc
func ImportStateIDAccountID ¶
func ImportStateIDAccountID(ctx context.Context) resource.ImportStateIdFunc
func IsIsolatedPartition ¶
func IsIsolatedRegion ¶
func IsStandardPartition ¶
func IsStandardRegion ¶
func ListOfStrings ¶
func MatchResourceAttrAccountID ¶
func MatchResourceAttrAccountID(resourceName, attributeName string) resource.TestCheckFunc
MatchResourceAttrAccountID ensures the Terraform state regexp matches an account ID
func MatchResourceAttrGlobalARN ¶
func MatchResourceAttrGlobalARN(ctx context.Context, resourceName, attributeName, arnService string, arnResourceRegexp *regexp.Regexp) resource.TestCheckFunc
MatchResourceAttrGlobalARN ensures the Terraform state regexp matches a formatted ARN without region
func MatchResourceAttrGlobalARNNoAccount ¶
func MatchResourceAttrGlobalARNNoAccount(resourceName, attributeName, arnService string, arnResourceRegexp *regexp.Regexp) resource.TestCheckFunc
MatchResourceAttrGlobalARNNoAccount ensures the Terraform state regexp matches a formatted ARN without region or account ID
func MatchResourceAttrGlobalHostname ¶
func MatchResourceAttrGlobalHostname(resourceName, attributeName, serviceName string, hostnamePrefixRegexp *regexp.Regexp) resource.TestCheckFunc
MatchResourceAttrGlobalHostname ensures the Terraform state regexp matches a formatted DNS hostname with partition DNS suffix and without region
func MatchResourceAttrRegionalARN ¶
func MatchResourceAttrRegionalARN(ctx context.Context, resourceName, attributeName, arnService string, arnResourceRegexp *regexp.Regexp) resource.TestCheckFunc
MatchResourceAttrRegionalARN ensures the Terraform state regexp matches a formatted ARN with region
func MatchResourceAttrRegionalARNAccountID ¶
func MatchResourceAttrRegionalARNAccountID(resourceName, attributeName, arnService, accountID string, arnResourceRegexp *regexp.Regexp) resource.TestCheckFunc
MatchResourceAttrRegionalARNAccountID ensures the Terraform state regexp matches a formatted ARN with region and specific account ID
func MatchResourceAttrRegionalARNNoAccount ¶
func MatchResourceAttrRegionalARNNoAccount(resourceName, attributeName, arnService string, arnResourceRegexp *regexp.Regexp) resource.TestCheckFunc
MatchResourceAttrRegionalARNNoAccount ensures the Terraform state regexp matches a formatted ARN with region but without account ID
func MatchResourceAttrRegionalARNRegion ¶
func MatchResourceAttrRegionalARNRegion(ctx context.Context, resourceName, attributeName, arnService, region string, arnResourceRegexp *regexp.Regexp) resource.TestCheckFunc
MatchResourceAttrRegionalARNRegion ensures the Terraform state regexp matches a formatted ARN with the specified region
func MatchResourceAttrRegionalHostname ¶
func MatchResourceAttrRegionalHostname(resourceName, attributeName, serviceName string, hostnamePrefixRegexp *regexp.Regexp) resource.TestCheckFunc
MatchResourceAttrRegionalHostname ensures the Terraform state regexp matches a formatted DNS hostname with region and partition DNS suffix
func NamedProvider ¶
func ParallelTest ¶
ParallelTest wraps resource.ParallelTest, initializing VCR if enabled
func PartitionDNSSuffix ¶
func PartitionDNSSuffix() string
func PartitionRegions ¶
func PartitionRegions() []string
func PartitionReverseDNSPrefix ¶
func PartitionReverseDNSPrefix() string
func PreCheck ¶
PreCheck verifies and sets required provider testing configuration
This PreCheck function should be present in every acceptance test. It allows test configurations to omit a provider configuration with region and ensures testing functions that attempt to call AWS APIs are previously configured.
These verifications and configuration are preferred at this level to prevent provider developers from experiencing less clear errors for every test.
func PreCheckAPIGatewayTypeEDGE ¶
PreCheckAPIGatewayTypeEDGE checks if endpoint config type EDGE can be used in a test and skips test if not (i.e., not in standard partition).
func PreCheckAlternateRegion ¶
PreCheckAlternateRegion checks that the alternate test region is one of the specified AWS Regions.
func PreCheckAssumeRoleARN ¶
func PreCheckDirectoryServiceSimpleDirectory ¶
Certain regions such as AWS GovCloud (US) do not support Simple AD directories and we do not have a good read-only way to determine this situation. Here we opt to perform a creation that will fail so we can determine Simple AD support.
func PreCheckFourthRegion ¶
PreCheckFourthRegion checks that the fourth test region is one of the specified AWS Regions.
func PreCheckHasIAMRole ¶
func PreCheckMultipleRegion ¶
func PreCheckOrganizationManagementAccountWithProvider ¶
func PreCheckOrganizationManagementAccountWithProvider(ctx context.Context, t *testing.T, providerF ProviderFunc)
func PreCheckOrganizationMemberAccountWithProvider ¶
func PreCheckOrganizationMemberAccountWithProvider(ctx context.Context, t *testing.T, providerF ProviderFunc)
func PreCheckOrganizationsEnabled ¶
func PreCheckOrganizationsEnabled(ctx context.Context, t *testing.T) *organizationstypes.Organization
func PreCheckOrganizationsEnabledWithProvider ¶
func PreCheckOrganizationsEnabledWithProvider(ctx context.Context, t *testing.T, providerF ProviderFunc) *organizationstypes.Organization
func PreCheckPartition ¶
PreCheckPartition checks that the test partition is the specified partition.
func PreCheckPartitionNot ¶
PreCheckPartitionNot checks that the test partition is not one of the specified partitions.
func PreCheckRAMSharingWithOrganizationEnabledWithProvider ¶
func PreCheckRAMSharingWithOrganizationEnabledWithProvider(ctx context.Context, t *testing.T, providerF ProviderFunc)
func PreCheckRegion ¶
PreCheckRegion checks that the test region is one of the specified AWS Regions.
func PreCheckRegionNot ¶
PreCheckRegionNot checks that the test region is not one of the specified AWS Regions.
func PreCheckRegionOptIn ¶
func PreCheckSameOrganization ¶
func PreCheckSameOrganization(ctx context.Context, t *testing.T, providerFs ...ProviderFunc)
func PreCheckSkipError ¶
Check service API call error for reasons to skip acceptance testing These include missing API endpoints and unsupported API calls
func PreCheckThirdAccount ¶
func PreCheckThirdRegion ¶
PreCheckThirdRegion checks that the third test region is one of the specified AWS Regions.
func PrimaryInstanceState ¶
Copied and inlined from the SDK testing code
func ProtoV5FactoriesAlternateAccountAndAlternateRegion ¶
func ProtoV5FactoriesAlternateAccountAndAlternateRegion(ctx context.Context, t *testing.T) map[string]func() (tfprotov5.ProviderServer, error)
ProtoV5FactoriesAlternateAccountAndAlternateRegion creates ProtoV5ProviderFactories for cross-account and cross-region configurations
Usage typically paired with PreCheckMultipleRegion, PreCheckAlternateAccount, and ConfigAlternateAccountAndAlternateRegionProvider.
func ProtoV5FactoriesMultipleRegions ¶
func ProtoV5FactoriesMultipleRegions(ctx context.Context, t *testing.T, n int) map[string]func() (tfprotov5.ProviderServer, error)
ProtoV5FactoriesMultipleRegions creates ProtoV5ProviderFactories for the specified number of region configurations
Usage typically paired with PreCheckMultipleRegion and ConfigMultipleRegionProvider.
func ProtoV5FactoriesNamed ¶
func ProtoV5FactoriesPlusProvidersAlternate ¶
func ProtoV5FactoriesPlusProvidersAlternate(ctx context.Context, t *testing.T, providers *[]*schema.Provider) map[string]func() (tfprotov5.ProviderServer, error)
ProtoV5FactoriesPlusProvidersAlternate creates ProtoV5ProviderFactories for cross-account and cross-region configurations and also returns Providers suitable for use with AWS APIs.
For cross-region testing: Typically paired with PreCheckMultipleRegion and ConfigAlternateRegionProvider.
For cross-account testing: Typically paired with PreCheckAlternateAccount and ConfigAlternateAccountProvider.
func ProtoV6ProviderFactories ¶
func ProtoV6ProviderFactories(_ context.Context, providerNames ...string) map[string]func() (tfprotov6.ProviderServer, error)
ProtoV6ProviderFactories initializes v6 provider factories currently only initializes echo provider for testing ephemeral resources
func ProviderAccountID ¶
ProviderAccountID returns the account ID of an AWS provider
func ProviderMeta ¶
ProviderMeta returns the current provider's state (AKA "meta" or "conns.AWSClient")
func RandIntRange ¶
RandIntRange is a VCR-friendly replacement for acctest.RandIntRange
func RandomDomain ¶
func RandomDomain() domainName
func RandomDomainName ¶
func RandomDomainName() string
RandomDomainName creates a random two-level domain name in the form "<random>.test" The top level domain ".test" is reserved by IANA for testing purposes: https://datatracker.ietf.org/doc/html/rfc6761
func RandomEmailAddress ¶
RandomEmailAddress generates a random email address in the form "tf-acc-test-<random>@<domain>"
func RandomFQDomainName ¶
func RandomFQDomainName() string
RandomFQDomainName creates a random fully-qualified two-level domain name in the form "<random>.test." The top level domain ".test" is reserved by IANA for testing purposes: https://datatracker.ietf.org/doc/html/rfc6761
func RandomSubdomain ¶
func RandomSubdomain() string
RandomSubdomain creates a random three-level domain name in the form "<random>.<random>.test" The top level domain ".test" is reserved by IANA for testing purposes: https://datatracker.ietf.org/doc/html/rfc6761
func RandomWithPrefix ¶
RandomWithPrefix is a VCR-friendly replacement for acctest.RandomWithPrefix
func RegionsInPartition ¶
func RegisterServiceErrorCheckFunc ¶
func RegisterServiceErrorCheckFunc(serviceID string, f ServiceErrorCheckFunc)
func RunLimitedConcurrencyTests2Levels ¶
func RunLimitedConcurrencyTests2Levels(t *testing.T, semaphore tfsync.Semaphore, testCases map[string]map[string]func(*testing.T, tfsync.Semaphore))
RunLimitedConcurrencyTests2Levels runs test cases with concurrency limited via `semaphore`.
func RunSerialTests1Level ¶
RunSerialTests1Level runs test cases in parallel, optionally sleeping between each.
func RunSerialTests2Levels ¶
func RunSerialTests2Levels(t *testing.T, testCases map[string]map[string]func(*testing.T), d time.Duration)
RunSerialTests2Levels runs test cases in parallel, optionally sleeping between each.
func S3BucketHasTag ¶
func S3BucketHasTag(ctx context.Context, bucketName, key, value string) resource.TestCheckFunc
func Skip ¶
Skip implements a wrapper for (*testing.T).Skip() to prevent unused linting reports
Reference: https://github.com/dominikh/go-tools/issues/633#issuecomment-606560616
func SkipIfEnvVarNotSet ¶
SkipIfEnvVarNotSet skips the current test if the specified environment variable is not set. The variable's value is returned.
func SkipIfExeNotOnPath ¶
SkipIfExeNotOnPath skips the current test if the specified executable is not found in the directories named by the PATH environment variable. The absolute path to the executable is returned.
func SkipIfNotRunningAcceptanceTests ¶
SkipIfNotRunningAcceptanceTests skips the current test if it's not an acceptance test (TF_ACC is set in the environment).
func TLSECDSAPrivateKeyPEM ¶
TLSECDSAPublicKeyPEM generates an ECDSA private key PEM string using the specified elliptic curve. Wrap with TLSPEMEscapeNewlines() to allow simple fmt.Sprintf() configurations such as: private_key_pem = "%[1]s"
func TLSECDSAPublicKeyPEM ¶
TLSECDSAPublicKeyPEM generates an ECDSA public key PEM string and fingerprint.
func TLSPEMEscapeNewlines ¶
func TLSPEMRemoveNewlines ¶
func TLSPEMRemovePublicKeyEncapsulationBoundaries ¶
TLSPEMRemovePublicKeyEncapsulationBoundaries removes public key pre and post encapsulation boundaries from a PEM string.
func TLSPEMRemoveRSAPrivateKeyEncapsulationBoundaries ¶
TLSPEMRemoveRSAPrivateKeyEncapsulationBoundaries removes RSA private key pre and post encapsulation boundaries from a PEM string.
func TLSRSAPrivateKeyPEM ¶
TLSRSAPrivateKeyPEM generates a RSA private key PEM string. Wrap with TLSPEMEscapeNewlines() to allow simple fmt.Sprintf() configurations such as: private_key_pem = "%[1]s"
func TLSRSAPublicKeyPEM ¶
TLSRSAPublicKeyPEM generates a RSA public key PEM string. Wrap with TLSPEMEscapeNewlines() to allow simple fmt.Sprintf() configurations such as: public_key_pem = "%[1]s"
func TLSRSAX509CertificateRequestPEM ¶
TLSRSAX509CertificateRequestPEM generates a x509 certificate request PEM string and a RSA private key PEM string. Wrap with TLSPEMEscapeNewlines() to allow simple fmt.Sprintf() configurations such as: certificate_signing_request_pem = "%[1]s" private_key_pem = "%[2]s"
func TLSRSAX509LocallySignedCertificatePEM ¶
func TLSRSAX509LocallySignedCertificatePEM(t *testing.T, caKeyPem, caCertificatePem, keyPem, commonName string) string
TLSRSAX509LocallySignedCertificatePEM generates a local CA x509 certificate PEM string. Wrap with TLSPEMEscapeNewlines() to allow simple fmt.Sprintf() configurations such as: certificate_pem = "%[1]s"
func TLSRSAX509SelfSignedCACertificateForRolesAnywhereTrustAnchorPEM ¶
func TLSRSAX509SelfSignedCACertificateForRolesAnywhereTrustAnchorPEM(t *testing.T, keyPem string) string
TLSRSAX509SelfSignedCACertificateForRolesAnywhereTrustAnchorPEM generates a x509 CA certificate PEM string. The CA certificate is suitable for use as an IAM RolesAnywhere Trust Anchor. See https://docs.aws.amazon.com/rolesanywhere/latest/userguide/trust-model.html#signature-verification. Wrap with TLSPEMEscapeNewlines() to allow simple fmt.Sprintf() configurations such as: root_certificate_pem = "%[1]s"
func TLSRSAX509SelfSignedCACertificatePEM ¶
TLSRSAX509SelfSignedCACertificatePEM generates a x509 CA certificate PEM string. Wrap with TLSPEMEscapeNewlines() to allow simple fmt.Sprintf() configurations such as: root_certificate_pem = "%[1]s"
func TLSRSAX509SelfSignedCertificatePEM ¶
TLSRSAX509SelfSignedCertificatePEM generates a x509 certificate PEM string. Wrap with TLSPEMEscapeNewlines() to allow simple fmt.Sprintf() configurations such as: private_key_pem = "%[1]s"
func ThirdRegion ¶
func ThirdRegion() string
Types ¶
type Func ¶
type Func func(resourceName string) resource.ImportStateIdFunc
type ProviderFunc ¶
var ( DefaultProviderFunc ProviderFunc = func() *schema.Provider { return Provider } )
func NamedProviderFunc ¶
func NamedProviderFunc(name string, providers map[string]*schema.Provider) ProviderFunc
func RegionProviderFunc ¶
type ServiceErrorCheckFunc ¶
type ServiceErrorCheckFunc func(*testing.T) resource.ErrorCheckFunc