Skip to content

Commit 5aeb62b

Browse files
authored
Update Magic Modules (#105)
1 parent 0399ca2 commit 5aeb62b

8 files changed

+326
-2
lines changed

rules/magicmodules/google_apigee_instance_invalid_peering_cidr_range.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (r *GoogleApigeeInstanceInvalidPeeringCidrRangeRule) Check(runner tflint.Ru
6060
var val string
6161
err := runner.EvaluateExpr(attribute.Expr, &val, nil)
6262

63-
validateFunc := validation.StringInSlice([]string{"SLASH_16", "SLASH_20", ""}, false)
63+
validateFunc := validation.StringInSlice([]string{"SLASH_16", "SLASH_20", "SLASH_23", ""}, false)
6464

6565
return runner.EnsureNoError(err, func() error {
6666
_, errors := validateFunc(val, r.attributeName)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// ----------------------------------------------------------------------------
2+
//
3+
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
4+
//
5+
// ----------------------------------------------------------------------------
6+
//
7+
// This file is automatically generated by Magic Modules and manual
8+
// changes will be clobbered when the file is regenerated.
9+
//
10+
// Please read more about how to change this file in
11+
// .github/CONTRIBUTING.md.
12+
//
13+
// ----------------------------------------------------------------------------
14+
15+
package magicmodules
16+
17+
import (
18+
hcl "github.com/hashicorp/hcl/v2"
19+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
20+
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
21+
)
22+
23+
// GooglePrivatecaCaPoolInvalidTierRule checks the pattern is valid
24+
type GooglePrivatecaCaPoolInvalidTierRule struct {
25+
resourceType string
26+
attributeName string
27+
}
28+
29+
// NewGooglePrivatecaCaPoolInvalidTierRule returns new rule with default attributes
30+
func NewGooglePrivatecaCaPoolInvalidTierRule() *GooglePrivatecaCaPoolInvalidTierRule {
31+
return &GooglePrivatecaCaPoolInvalidTierRule{
32+
resourceType: "google_privateca_ca_pool",
33+
attributeName: "tier",
34+
}
35+
}
36+
37+
// Name returns the rule name
38+
func (r *GooglePrivatecaCaPoolInvalidTierRule) Name() string {
39+
return "google_privateca_ca_pool_invalid_tier"
40+
}
41+
42+
// Enabled returns whether the rule is enabled by default
43+
func (r *GooglePrivatecaCaPoolInvalidTierRule) Enabled() bool {
44+
return true
45+
}
46+
47+
// Severity returns the rule severity
48+
func (r *GooglePrivatecaCaPoolInvalidTierRule) Severity() string {
49+
return tflint.ERROR
50+
}
51+
52+
// Link returns the rule reference link
53+
func (r *GooglePrivatecaCaPoolInvalidTierRule) Link() string {
54+
return ""
55+
}
56+
57+
// Check checks the pattern is valid
58+
func (r *GooglePrivatecaCaPoolInvalidTierRule) Check(runner tflint.Runner) error {
59+
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error {
60+
var val string
61+
err := runner.EvaluateExpr(attribute.Expr, &val, nil)
62+
63+
validateFunc := validation.StringInSlice([]string{"ENTERPRISE", "DEVOPS"}, false)
64+
65+
return runner.EnsureNoError(err, func() error {
66+
_, errors := validateFunc(val, r.attributeName)
67+
for _, err := range errors {
68+
runner.EmitIssueOnExpr(r, err.Error(), attribute.Expr)
69+
}
70+
return nil
71+
})
72+
})
73+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// ----------------------------------------------------------------------------
2+
//
3+
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
4+
//
5+
// ----------------------------------------------------------------------------
6+
//
7+
// This file is automatically generated by Magic Modules and manual
8+
// changes will be clobbered when the file is regenerated.
9+
//
10+
// Please read more about how to change this file in
11+
// .github/CONTRIBUTING.md.
12+
//
13+
// ----------------------------------------------------------------------------
14+
15+
package magicmodules
16+
17+
import (
18+
hcl "github.com/hashicorp/hcl/v2"
19+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
20+
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
21+
)
22+
23+
// GooglePrivatecaCertificateAuthorityInvalidTierRule checks the pattern is valid
24+
type GooglePrivatecaCertificateAuthorityInvalidTierRule struct {
25+
resourceType string
26+
attributeName string
27+
}
28+
29+
// NewGooglePrivatecaCertificateAuthorityInvalidTierRule returns new rule with default attributes
30+
func NewGooglePrivatecaCertificateAuthorityInvalidTierRule() *GooglePrivatecaCertificateAuthorityInvalidTierRule {
31+
return &GooglePrivatecaCertificateAuthorityInvalidTierRule{
32+
resourceType: "google_privateca_certificate_authority",
33+
attributeName: "tier",
34+
}
35+
}
36+
37+
// Name returns the rule name
38+
func (r *GooglePrivatecaCertificateAuthorityInvalidTierRule) Name() string {
39+
return "google_privateca_certificate_authority_invalid_tier"
40+
}
41+
42+
// Enabled returns whether the rule is enabled by default
43+
func (r *GooglePrivatecaCertificateAuthorityInvalidTierRule) Enabled() bool {
44+
return true
45+
}
46+
47+
// Severity returns the rule severity
48+
func (r *GooglePrivatecaCertificateAuthorityInvalidTierRule) Severity() string {
49+
return tflint.ERROR
50+
}
51+
52+
// Link returns the rule reference link
53+
func (r *GooglePrivatecaCertificateAuthorityInvalidTierRule) Link() string {
54+
return ""
55+
}
56+
57+
// Check checks the pattern is valid
58+
func (r *GooglePrivatecaCertificateAuthorityInvalidTierRule) Check(runner tflint.Runner) error {
59+
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error {
60+
var val string
61+
err := runner.EvaluateExpr(attribute.Expr, &val, nil)
62+
63+
validateFunc := validation.StringInSlice([]string{"ENTERPRISE", "DEVOPS", ""}, false)
64+
65+
return runner.EnsureNoError(err, func() error {
66+
_, errors := validateFunc(val, r.attributeName)
67+
for _, err := range errors {
68+
runner.EmitIssueOnExpr(r, err.Error(), attribute.Expr)
69+
}
70+
return nil
71+
})
72+
})
73+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// ----------------------------------------------------------------------------
2+
//
3+
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
4+
//
5+
// ----------------------------------------------------------------------------
6+
//
7+
// This file is automatically generated by Magic Modules and manual
8+
// changes will be clobbered when the file is regenerated.
9+
//
10+
// Please read more about how to change this file in
11+
// .github/CONTRIBUTING.md.
12+
//
13+
// ----------------------------------------------------------------------------
14+
15+
package magicmodules
16+
17+
import (
18+
hcl "github.com/hashicorp/hcl/v2"
19+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
20+
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
21+
)
22+
23+
// GooglePrivatecaCertificateAuthorityInvalidTypeRule checks the pattern is valid
24+
type GooglePrivatecaCertificateAuthorityInvalidTypeRule struct {
25+
resourceType string
26+
attributeName string
27+
}
28+
29+
// NewGooglePrivatecaCertificateAuthorityInvalidTypeRule returns new rule with default attributes
30+
func NewGooglePrivatecaCertificateAuthorityInvalidTypeRule() *GooglePrivatecaCertificateAuthorityInvalidTypeRule {
31+
return &GooglePrivatecaCertificateAuthorityInvalidTypeRule{
32+
resourceType: "google_privateca_certificate_authority",
33+
attributeName: "type",
34+
}
35+
}
36+
37+
// Name returns the rule name
38+
func (r *GooglePrivatecaCertificateAuthorityInvalidTypeRule) Name() string {
39+
return "google_privateca_certificate_authority_invalid_type"
40+
}
41+
42+
// Enabled returns whether the rule is enabled by default
43+
func (r *GooglePrivatecaCertificateAuthorityInvalidTypeRule) Enabled() bool {
44+
return true
45+
}
46+
47+
// Severity returns the rule severity
48+
func (r *GooglePrivatecaCertificateAuthorityInvalidTypeRule) Severity() string {
49+
return tflint.ERROR
50+
}
51+
52+
// Link returns the rule reference link
53+
func (r *GooglePrivatecaCertificateAuthorityInvalidTypeRule) Link() string {
54+
return ""
55+
}
56+
57+
// Check checks the pattern is valid
58+
func (r *GooglePrivatecaCertificateAuthorityInvalidTypeRule) Check(runner tflint.Runner) error {
59+
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error {
60+
var val string
61+
err := runner.EvaluateExpr(attribute.Expr, &val, nil)
62+
63+
validateFunc := validation.StringInSlice([]string{"SELF_SIGNED", "SUBORDINATE", ""}, false)
64+
65+
return runner.EnsureNoError(err, func() error {
66+
_, errors := validateFunc(val, r.attributeName)
67+
for _, err := range errors {
68+
runner.EmitIssueOnExpr(r, err.Error(), attribute.Expr)
69+
}
70+
return nil
71+
})
72+
})
73+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// ----------------------------------------------------------------------------
2+
//
3+
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
4+
//
5+
// ----------------------------------------------------------------------------
6+
//
7+
// This file is automatically generated by Magic Modules and manual
8+
// changes will be clobbered when the file is regenerated.
9+
//
10+
// Please read more about how to change this file in
11+
// .github/CONTRIBUTING.md.
12+
//
13+
// ----------------------------------------------------------------------------
14+
15+
package magicmodules
16+
17+
import (
18+
hcl "github.com/hashicorp/hcl/v2"
19+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
20+
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
21+
)
22+
23+
// GoogleRedisInstanceInvalidTransitEncryptionModeRule checks the pattern is valid
24+
type GoogleRedisInstanceInvalidTransitEncryptionModeRule struct {
25+
resourceType string
26+
attributeName string
27+
}
28+
29+
// NewGoogleRedisInstanceInvalidTransitEncryptionModeRule returns new rule with default attributes
30+
func NewGoogleRedisInstanceInvalidTransitEncryptionModeRule() *GoogleRedisInstanceInvalidTransitEncryptionModeRule {
31+
return &GoogleRedisInstanceInvalidTransitEncryptionModeRule{
32+
resourceType: "google_redis_instance",
33+
attributeName: "transit_encryption_mode",
34+
}
35+
}
36+
37+
// Name returns the rule name
38+
func (r *GoogleRedisInstanceInvalidTransitEncryptionModeRule) Name() string {
39+
return "google_redis_instance_invalid_transit_encryption_mode"
40+
}
41+
42+
// Enabled returns whether the rule is enabled by default
43+
func (r *GoogleRedisInstanceInvalidTransitEncryptionModeRule) Enabled() bool {
44+
return true
45+
}
46+
47+
// Severity returns the rule severity
48+
func (r *GoogleRedisInstanceInvalidTransitEncryptionModeRule) Severity() string {
49+
return tflint.ERROR
50+
}
51+
52+
// Link returns the rule reference link
53+
func (r *GoogleRedisInstanceInvalidTransitEncryptionModeRule) Link() string {
54+
return ""
55+
}
56+
57+
// Check checks the pattern is valid
58+
func (r *GoogleRedisInstanceInvalidTransitEncryptionModeRule) Check(runner tflint.Runner) error {
59+
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error {
60+
var val string
61+
err := runner.EvaluateExpr(attribute.Expr, &val, nil)
62+
63+
validateFunc := validation.StringInSlice([]string{"SERVER_AUTHENTICATION", "DISABLED", ""}, false)
64+
65+
return runner.EnsureNoError(err, func() error {
66+
_, errors := validateFunc(val, r.attributeName)
67+
for _, err := range errors {
68+
runner.EmitIssueOnExpr(r, err.Error(), attribute.Expr)
69+
}
70+
return nil
71+
})
72+
})
73+
}

rules/magicmodules/product.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ var Products = map[string]Product{
3232
{Name: "Cloud Resource Manager API", URL: "https://console.cloud.google.com/apis/library/cloudresourcemanager.googleapis.com/"},
3333
},
3434
},
35+
"google_privateca_certificate_authority": {
36+
APIsRequired: []APIReference{
37+
{Name: "Certificate Authority API", URL: "https://console.cloud.google.com/apis/api/privateca.googleapis.com"},
38+
},
39+
},
40+
"google_privateca_certificate": {
41+
APIsRequired: []APIReference{
42+
{Name: "Certificate Authority API", URL: "https://console.cloud.google.com/apis/api/privateca.googleapis.com"},
43+
},
44+
},
45+
"google_privateca_ca_pool": {
46+
APIsRequired: []APIReference{
47+
{Name: "Certificate Authority API", URL: "https://console.cloud.google.com/apis/api/privateca.googleapis.com"},
48+
},
49+
},
3550
"google_binary_authorization_attestor": {
3651
APIsRequired: []APIReference{},
3752
},
@@ -237,6 +252,11 @@ var Products = map[string]Product{
237252
{Name: "App Engine Admin API", URL: "https://console.cloud.google.com/apis/library/appengine.googleapis.com/"},
238253
},
239254
},
255+
"google_app_engine_service_network_settings": {
256+
APIsRequired: []APIReference{
257+
{Name: "App Engine Admin API", URL: "https://console.cloud.google.com/apis/library/appengine.googleapis.com/"},
258+
},
259+
},
240260
"google_filestore_instance": {
241261
APIsRequired: []APIReference{},
242262
},
@@ -387,6 +407,9 @@ var Products = map[string]Product{
387407
{Name: "Cloud Identity-Aware Proxy", URL: "https://console.cloud.google.com/apis/library/iap.googleapis.com/"},
388408
},
389409
},
410+
"google_vertex_ai_dataset": {
411+
APIsRequired: []APIReference{},
412+
},
390413
"google_cloud_asset_project_feed": {
391414
APIsRequired: []APIReference{
392415
{Name: "Cloud Asset API", URL: "https://console.cloud.google.com/apis/library/cloudasset.googleapis.com/"},
@@ -798,6 +821,11 @@ var Products = map[string]Product{
798821
"google_tpu_node": {
799822
APIsRequired: []APIReference{},
800823
},
824+
"google_dialogflow_cx_agent": {
825+
APIsRequired: []APIReference{
826+
{Name: "Dialogflow API", URL: "https://console.cloud.google.com/apis/library/dialogflow.googleapis.com"},
827+
},
828+
},
801829
"google_monitoring_alert_policy": {
802830
APIsRequired: []APIReference{
803831
{Name: "Stackdriver Monitoring API", URL: "https://console.cloud.google.com/apis/library/monitoring.googleapis.com/"},

rules/magicmodules/provider.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,14 @@ var Rules = []tflint.Rule{
115115
NewGoogleNotebooksInstanceInvalidDataDiskTypeRule(),
116116
NewGoogleNotebooksInstanceInvalidDiskEncryptionRule(),
117117
NewGoogleOsConfigPatchDeploymentInvalidPatchDeploymentIdRule(),
118+
NewGooglePrivatecaCaPoolInvalidTierRule(),
119+
NewGooglePrivatecaCertificateAuthorityInvalidTierRule(),
120+
NewGooglePrivatecaCertificateAuthorityInvalidTypeRule(),
118121
NewGooglePubsubSchemaInvalidTypeRule(),
119122
NewGoogleRedisInstanceInvalidConnectModeRule(),
120123
NewGoogleRedisInstanceInvalidNameRule(),
121124
NewGoogleRedisInstanceInvalidTierRule(),
125+
NewGoogleRedisInstanceInvalidTransitEncryptionModeRule(),
122126
NewGoogleSccSourceInvalidDisplayNameRule(),
123127
NewGoogleSpannerDatabaseInvalidNameRule(),
124128
NewGoogleSpannerInstanceInvalidNameRule(),

tools/magic-modules

Submodule magic-modules updated 203 files

0 commit comments

Comments
 (0)