Skip to content

Commit 32b41dc

Browse files
committed
add warning for terraform plan also
1 parent 8862364 commit 32b41dc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

aquasec/resource_application_scope.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@ func resourceApplicationScope() *schema.Resource {
2424
Schema: map[string]*schema.Schema{
2525
"name": {
2626
Type: schema.TypeString,
27-
Description: "Name of an application scope.",
27+
Description: "You are using a legacy resource. Consider migrating to 'aquasec_application_scope_saas'.",
2828
Required: true,
2929
ForceNew: true,
30+
ValidateFunc: func(val interface{}, key string) ([]string, []error) {
31+
if isSaasEnv() {
32+
return []string{
33+
"You are using aquasec_application_scope with an Aqua SaaS instance. Please migrate to aquasec_application_scope_saas, designed specifically for Aqua SaaS customers and supporting the entire SaaS platform beyond workload protection.",
34+
}, nil
35+
}
36+
return nil, nil
37+
},
3038
},
3139
"description": {
3240
Type: schema.TypeString,

aquasec/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func isResourceExist(response string) bool {
241241
if strings.Contains(response, "404") {
242242
return false
243243
} else {
244-
return true
244+
return false
245245
}
246246
}
247247

0 commit comments

Comments
 (0)