@@ -20,44 +20,44 @@ import (
20
20
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
21
21
)
22
22
23
- // GoogleCertificateManagerCertificateInvalidScopeRule checks the pattern is valid
24
- type GoogleCertificateManagerCertificateInvalidScopeRule struct {
23
+ // GoogleApigeeOrganizationInvalidRetentionRule checks the pattern is valid
24
+ type GoogleApigeeOrganizationInvalidRetentionRule struct {
25
25
tflint.DefaultRule
26
26
27
27
resourceType string
28
28
attributeName string
29
29
}
30
30
31
- // NewGoogleCertificateManagerCertificateInvalidScopeRule returns new rule with default attributes
32
- func NewGoogleCertificateManagerCertificateInvalidScopeRule () * GoogleCertificateManagerCertificateInvalidScopeRule {
33
- return & GoogleCertificateManagerCertificateInvalidScopeRule {
34
- resourceType : "google_certificate_manager_certificate " ,
35
- attributeName : "scope " ,
31
+ // NewGoogleApigeeOrganizationInvalidRetentionRule returns new rule with default attributes
32
+ func NewGoogleApigeeOrganizationInvalidRetentionRule () * GoogleApigeeOrganizationInvalidRetentionRule {
33
+ return & GoogleApigeeOrganizationInvalidRetentionRule {
34
+ resourceType : "google_apigee_organization " ,
35
+ attributeName : "retention " ,
36
36
}
37
37
}
38
38
39
39
// Name returns the rule name
40
- func (r * GoogleCertificateManagerCertificateInvalidScopeRule ) Name () string {
41
- return "google_certificate_manager_certificate_invalid_scope "
40
+ func (r * GoogleApigeeOrganizationInvalidRetentionRule ) Name () string {
41
+ return "google_apigee_organization_invalid_retention "
42
42
}
43
43
44
44
// Enabled returns whether the rule is enabled by default
45
- func (r * GoogleCertificateManagerCertificateInvalidScopeRule ) Enabled () bool {
45
+ func (r * GoogleApigeeOrganizationInvalidRetentionRule ) Enabled () bool {
46
46
return true
47
47
}
48
48
49
49
// Severity returns the rule severity
50
- func (r * GoogleCertificateManagerCertificateInvalidScopeRule ) Severity () tflint.Severity {
50
+ func (r * GoogleApigeeOrganizationInvalidRetentionRule ) Severity () tflint.Severity {
51
51
return tflint .ERROR
52
52
}
53
53
54
54
// Link returns the rule reference link
55
- func (r * GoogleCertificateManagerCertificateInvalidScopeRule ) Link () string {
55
+ func (r * GoogleApigeeOrganizationInvalidRetentionRule ) Link () string {
56
56
return ""
57
57
}
58
58
59
59
// Check checks the pattern is valid
60
- func (r * GoogleCertificateManagerCertificateInvalidScopeRule ) Check (runner tflint.Runner ) error {
60
+ func (r * GoogleApigeeOrganizationInvalidRetentionRule ) Check (runner tflint.Runner ) error {
61
61
resources , err := runner .GetResourceContent (r .resourceType , & hclext.BodySchema {
62
62
Attributes : []hclext.AttributeSchema {{Name : r .attributeName }},
63
63
}, nil )
@@ -74,7 +74,7 @@ func (r *GoogleCertificateManagerCertificateInvalidScopeRule) Check(runner tflin
74
74
var val string
75
75
err := runner .EvaluateExpr (attribute .Expr , & val , nil )
76
76
77
- validateFunc := validation .StringInSlice ([]string {"DEFAULT " , "EDGE_CACHE " , "" }, false )
77
+ validateFunc := validation .StringInSlice ([]string {"DELETION_RETENTION_UNSPECIFIED " , "MINIMUM " , "" }, false )
78
78
79
79
err = runner .EnsureNoError (err , func () error {
80
80
_ , errors := validateFunc (val , r .attributeName )
0 commit comments