Documentation ¶
Index ¶
- Variables
- func CheckDeleted(d *schema.ResourceData, err error, msg string) error
- func GetEnterpriseProjectID(d *schema.ResourceData, config *config.Config) string
- func GetRegion(d *schema.ResourceData, config *config.Config) string
- func InitDataSourceCheck(sourceName string) *resourceCheck
- func InitResourceCheck(resourceName string, resourceObject interface{}, getResourceFunc ServiceFunc) *resourceCheck
- func RandomAccResourceName() string
- func RandomAccResourceNameWithDash() string
- func RandomCidr() string
- func RandomCidrAndGatewayIp() (string, string)
- func ReplaceVarsForTest(rs *terraform.ResourceState, linkTmpl string) (string, error)
- func TestAccPreCheck(t *testing.T)
- func TestAccPreCheckAcceptBackup(t *testing.T)
- func TestAccPreCheckAdminOnly(t *testing.T)
- func TestAccPreCheckCertificateFull(t *testing.T)
- func TestAccPreCheckCertificateWithoutRootCA(t *testing.T)
- func TestAccPreCheckChargingMode(t *testing.T)
- func TestAccPreCheckCodeArtsDeployResourcePoolID(t *testing.T)
- func TestAccPreCheckDeprecated(t *testing.T)
- func TestAccPreCheckDestProjectIds(t *testing.T)
- func TestAccPreCheckEpsID(t *testing.T)
- func TestAccPreCheckFgsTrigger(t *testing.T)
- func TestAccPreCheckGMCertificate(t *testing.T)
- func TestAccPreCheckKms(t *testing.T)
- func TestAccPreCheckMigrateEpsID(t *testing.T)
- func TestAccPreCheckMutilAZ(t *testing.T)
- func TestAccPreCheckOBS(t *testing.T)
- func TestAccPreCheckOBSBucket(t *testing.T)
- func TestAccPreCheckOBSEndpoint(t *testing.T)
- func TestAccPreCheckProject(t *testing.T)
- func TestAccPreCheckProjectID(t *testing.T)
- func TestAccPreCheckRdsInstanceId(t *testing.T)
- func TestAccPreCheckReplication(t *testing.T)
- func TestAccPreCheckSWRDomian(t *testing.T)
- func TestAccPreCheckSecurityGroupId(t *testing.T)
- func TestAccPreCheckSubnetId(t *testing.T)
- func TestAccPreCheckUpdateCertificateContent(t *testing.T)
- func TestAccPreCheckVpcId(t *testing.T)
- func TestAccPrecheckDomainId(t *testing.T)
- func TestAccPrecheckSFSTurboBackupId(t *testing.T)
- func TestBaseComputeResources(name string) string
- func TestBaseNetwork(name string) string
- func TestCheckResourceAttrWithVariable(resourceName, key, varStr string) resource.TestCheckFunc
- func TestSecGroup(name string) string
- func TestVpc(name string) string
- func UnsubscribePrePaidResource(d *schema.ResourceData, config *config.Config, resourceIDs []string) error
- type ResourceCheck
- type ServiceFunc
Constants ¶
This section is empty.
Variables ¶
var ( SBC_REGION_NAME = os.Getenv("SBC_REGION_NAME") SBC_ENTERPRISE_PROJECT_ID = os.Getenv("SBC_ENTERPRISE_PROJECT_ID") SBC_ENTERPRISE_PROJECT_ID_TEST = os.Getenv("SBC_ENTERPRISE_PROJECT_ID_TEST") SBC_PROJECT_ID = os.Getenv("SBC_PROJECT_ID") SBC_DEPRECATED_ENVIRONMENT = os.Getenv("SBC_DEPRECATED_ENVIRONMENT") SBC_ADMIN = os.Getenv("SBC_ADMIN") SBC_DOMAIN_ID = os.Getenv("SBC_DOMAIN_ID") SBC_DOMAIN_NAME = os.Getenv("SBC_DOMAIN_NAME") SBC_ACCESS_KEY = os.Getenv("SBC_ACCESS_KEY") SBC_SECRET_KEY = os.Getenv("SBC_SECRET_KEY") SBC_DLI_FLINK_JAR_OBS_PATH = os.Getenv("SBC_DLI_FLINK_JAR_OBS_PATH") SBC_SWR_SHARING_ACCOUNT = os.Getenv("SBC_SWR_SHARING_ACCOUNT") SBC_FGS_TRIGGER_LTS_AGENCY = os.Getenv("SBC_FGS_TRIGGER_LTS_AGENCY") SBC_OBS_BUCKET_NAME = os.Getenv("SBC_OBS_BUCKET_NAME") SBC_DWS_MUTIL_AZS = os.Getenv("SBC_DWS_MUTIL_AZS") SBC_ENTERPRISE_MIGRATE_PROJECT_ID_TEST = os.Getenv("SBC_ENTERPRISE_MIGRATE_PROJECT_ID_TEST") SBC_CHARGING_MODE = os.Getenv("SBC_CHARGING_MODE") SBC_KMS_ENVIRONMENT = os.Getenv("SBC_KMS_ENVIRONMENT") SBC_SHARED_BACKUP_ID = os.Getenv("SBC_SHARED_BACKUP_ID") SBC_DEST_PROJECT_ID = os.Getenv("SBC_DEST_PROJECT_ID") SBC_DEST_PROJECT_ID_TEST = os.Getenv("SBC_DEST_PROJECT_ID_TEST") SBC_DEST_REGION = os.Getenv("SBC_DEST_REGION") SBC_CERTIFICATE_CONTENT = os.Getenv("SBC_CERTIFICATE_CONTENT") SBC_CERTIFICATE_CONTENT_UPDATE = os.Getenv("SBC_CERTIFICATE_CONTENT_UPDATE") SBC_CERTIFICATE_PRIVATE_KEY = os.Getenv("SBC_CERTIFICATE_PRIVATE_KEY") SBC_NEW_CERTIFICATE_CONTENT = os.Getenv("SBC_NEW_CERTIFICATE_CONTENT") SBC_NEW_CERTIFICATE_PRIVATE_KEY = os.Getenv("SBC_NEW_CERTIFICATE_PRIVATE_KEY") SBC_CERTIFICATE_ROOT_CA = os.Getenv("SBC_CERTIFICATE_ROOT_CA") SBC_NEW_CERTIFICATE_ROOT_CA = os.Getenv("SBC_NEW_CERTIFICATE_ROOT_CA") SBC_GM_CERTIFICATE_CONTENT = os.Getenv("SBC_GM_CERTIFICATE_CONTENT") SBC_GM_CERTIFICATE_PRIVATE_KEY = os.Getenv("SBC_GM_CERTIFICATE_PRIVATE_KEY") SBC_GM_ENC_CERTIFICATE_CONTENT = os.Getenv("SBC_GM_ENC_CERTIFICATE_CONTENT") SBC_GM_ENC_CERTIFICATE_PRIVATE_KEY = os.Getenv("SBC_GM_ENC_CERTIFICATE_PRIVATE_KEY") SBC_GM_CERTIFICATE_CHAIN = os.Getenv("SBC_GM_CERTIFICATE_CHAIN") SBC_NEW_GM_CERTIFICATE_CONTENT = os.Getenv("SBC_NEW_GM_CERTIFICATE_CONTENT") SBC_NEW_GM_CERTIFICATE_PRIVATE_KEY = os.Getenv("SBC_NEW_GM_CERTIFICATE_PRIVATE_KEY") SBC_NEW_GM_ENC_CERTIFICATE_CONTENT = os.Getenv("SBC_NEW_GM_ENC_CERTIFICATE_CONTENT") SBC_NEW_GM_ENC_CERTIFICATE_PRIVATE_KEY = os.Getenv("SBC_NEW_GM_ENC_CERTIFICATE_PRIVATE_KEY") SBC_NEW_GM_CERTIFICATE_CHAIN = os.Getenv("SBC_NEW_GM_CERTIFICATE_CHAIN") SBC_CODEARTS_RESOURCE_POOL_ID = os.Getenv("SBC_CODEARTS_RESOURCE_POOL_ID") SBC_RDS_INSTANCE_ID = os.Getenv("SBC_RDS_INSTANCE_ID") SBC_OBS_ENDPOINT = os.Getenv("SBC_OBS_ENDPOINT") SBC_SFS_TURBO_BACKUP_ID = os.Getenv("SBC_SFS_TURBO_BACKUP_ID") SBC_VPC_ID = os.Getenv("SBC_VPC_ID") SBC_SUBNET_ID = os.Getenv("SBC_SUBNET_ID") SBC_SECURITY_GROUP_ID = os.Getenv("SBC_SECURITY_GROUP_ID") )
var TestAccProvider *schema.Provider
TestAccProvider is the "main" provider instance
var TestAccProviderFactories map[string]func() (*schema.Provider, error)
TestAccProviderFactories is a static map containing only the main provider instance
Functions ¶
func CheckDeleted ¶ added in v1.11.0
func CheckDeleted(d *schema.ResourceData, err error, msg string) error
CheckDeleted checks the error to see if it's a 404 (Not Found) and, if so, sets the resource ID to the empty string instead of throwing an error.
func GetEnterpriseProjectID ¶ added in v1.11.0
func GetEnterpriseProjectID(d *schema.ResourceData, config *config.Config) string
GetEnterpriseProjectID returns the enterprise_project_id that was specified in the resource. If it was not set, the provider-level value is checked. The provider-level value can either be set by the `enterprise_project_id` argument or by SBC_ENTERPRISE_PROJECT_ID.
func GetRegion ¶ added in v1.11.0
func GetRegion(d *schema.ResourceData, config *config.Config) string
GetRegion returns the region that was specified in the resource. If a region was not set, the provider-level region is checked. The provider-level region can either be set by the region argument or by SBC_REGION_NAME.
func InitDataSourceCheck ¶
func InitDataSourceCheck(sourceName string) *resourceCheck
InitDataSourceCheck build a 'resourceCheck' object. Only used to check datasource attributes.
Parameters: resourceName: The resource name is used to check in the terraform.State.e.g. : sbercloud_waf_domain.domain_1. Return: *resourceCheck: resourceCheck object
func InitResourceCheck ¶
func InitResourceCheck(resourceName string, resourceObject interface{}, getResourceFunc ServiceFunc) *resourceCheck
InitResourceCheck build a 'resourceCheck' object. The common test methods are provided in 'resourceCheck'.
Parameters: resourceName: The resource name is used to check in the terraform.State.e.g. : sbercloud_waf_domain.domain_1. resourceObject: Resource object, used to check whether the resource exists in SberCloud. getResourceFunc: The function used to get the resource object. Return: *resourceCheck: resourceCheck object
func RandomAccResourceName ¶
func RandomAccResourceName() string
func RandomAccResourceNameWithDash ¶
func RandomAccResourceNameWithDash() string
func RandomCidr ¶
func RandomCidr() string
func RandomCidrAndGatewayIp ¶
func ReplaceVarsForTest ¶ added in v1.11.2
func ReplaceVarsForTest(rs *terraform.ResourceState, linkTmpl string) (string, error)
func TestAccPreCheck ¶
func TestAccPreCheckAcceptBackup ¶ added in v1.12.2
func TestAccPreCheckCertificateFull ¶ added in v1.12.3
lintignore:AT003
func TestAccPreCheckCertificateWithoutRootCA ¶ added in v1.12.3
lintignore:AT003
func TestAccPreCheckChargingMode ¶ added in v1.12.1
lintignore:AT003
func TestAccPreCheckCodeArtsDeployResourcePoolID ¶ added in v1.12.3
lintignore:AT003
func TestAccPreCheckDestProjectIds ¶ added in v1.12.2
func TestAccPreCheckEpsID ¶
func TestAccPreCheckFgsTrigger ¶ added in v1.11.0
func TestAccPreCheckGMCertificate ¶ added in v1.12.3
lintignore:AT003
func TestAccPreCheckKms ¶ added in v1.12.2
func TestAccPreCheckMigrateEpsID ¶ added in v1.12.1
func TestAccPreCheckMutilAZ ¶ added in v1.12.2
func TestAccPreCheckOBS ¶ added in v1.10.0
func TestAccPreCheckOBSBucket ¶ added in v1.11.0
func TestAccPreCheckOBSEndpoint ¶ added in v1.12.4
func TestAccPreCheckProject ¶
func TestAccPreCheckProjectID ¶ added in v1.12.0
func TestAccPreCheckRdsInstanceId ¶ added in v1.12.4
func TestAccPreCheckReplication ¶ added in v1.12.2
func TestAccPreCheckSWRDomian ¶ added in v1.11.0
func TestAccPreCheckSecurityGroupId ¶ added in v1.12.4
func TestAccPreCheckSubnetId ¶ added in v1.12.4
func TestAccPreCheckUpdateCertificateContent ¶ added in v1.12.3
func TestAccPreCheckVpcId ¶ added in v1.12.4
func TestAccPrecheckDomainId ¶ added in v1.12.0
func TestAccPrecheckSFSTurboBackupId ¶ added in v1.12.4
func TestBaseComputeResources ¶ added in v1.11.4
TestBaseComputeResources vpc, subnet, security group, availability zone, keypair, image, flavor
func TestBaseNetwork ¶ added in v1.11.0
func TestCheckResourceAttrWithVariable ¶
func TestCheckResourceAttrWithVariable(resourceName, key, varStr string) resource.TestCheckFunc
TestCheckResourceAttrWithVariable validates the variable in state for the given name/key combination.
Parameters: resourceName: The resource name is used to check in the terraform.State. key: The field name of the resource. variable: The variable name of the value to be checked. variable such like ${sbercloud_waf_certificate.certificate_1.id} or ${data.sbercloud_waf_policies.policies_2.policies.0.id}
func TestSecGroup ¶ added in v1.11.0
TestSecGroup can be referred as `sbercloud_networking_secgroup.test`
func TestVpc ¶ added in v1.11.0
TestVpc can be referred as `sbercloud_vpc.test` and `sbercloud_vpc_subnet.test`
func UnsubscribePrePaidResource ¶ added in v1.11.0
func UnsubscribePrePaidResource(d *schema.ResourceData, config *config.Config, resourceIDs []string) error
UnsubscribePrePaidResource impl the action of unsubscribe resource
Types ¶
type ResourceCheck ¶ added in v1.11.4
type ResourceCheck struct {
// contains filtered or unexported fields
}
ResourceCheck resource check object
func (*ResourceCheck) CheckResourceDestroy ¶ added in v1.11.4
func (rc *ResourceCheck) CheckResourceDestroy() resource.TestCheckFunc
CheckResourceDestroy check whether resources destroyed
type ServiceFunc ¶
type ServiceFunc func(*config.Config, *terraform.ResourceState) (interface{}, error)
ServiceFunc the SberCloud resource query functions.