-
Notifications
You must be signed in to change notification settings - Fork 512
Expand file tree
/
Copy pathinstance_profile_provider_config_test.go
More file actions
43 lines (38 loc) · 1.1 KB
/
instance_profile_provider_config_test.go
File metadata and controls
43 lines (38 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package aws_test
import (
"fmt"
"regexp"
"testing"
"github.com/databricks/terraform-provider-databricks/internal/acceptance"
)
func instanceProfileProviderConfigTemplate(providerConfig string) string {
return fmt.Sprintf(`
resource "databricks_instance_profile" "this" {
instance_profile_arn = "arn:aws:iam::999999999999:instance-profile/fake-profile"
skip_validation = true
%s
}
`, providerConfig)
}
func TestAccInstanceProfile_ProviderConfig_Invalid(t *testing.T) {
acceptance.WorkspaceLevel(t, acceptance.Step{
Template: instanceProfileProviderConfigTemplate(`
provider_config {
workspace_id = "invalid"
}
`),
ExpectError: regexp.MustCompile(`workspace_id must be a positive integer without leading zeros`),
PlanOnly: true,
})
}
func TestAccInstanceProfile_ProviderConfig_EmptyID(t *testing.T) {
acceptance.WorkspaceLevel(t, acceptance.Step{
Template: instanceProfileProviderConfigTemplate(`
provider_config {
workspace_id = ""
}
`),
ExpectError: regexp.MustCompile(`expected "provider_config.0.workspace_id" to not be an empty string`),
PlanOnly: true,
})
}