Skip to content

Commit 68f202f

Browse files
authored
Update Magic Modules (#94)
1 parent bcdd15e commit 68f202f

File tree

6 files changed

+49
-32
lines changed

6 files changed

+49
-32
lines changed

rules/magicmodules/google_compute_address_invalid_purpose.go renamed to rules/magicmodules/google_cloud_identity_group_invalid_initial_group_config.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,47 @@ import (
2020
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
2121
)
2222

23-
// GoogleComputeAddressInvalidPurposeRule checks the pattern is valid
24-
type GoogleComputeAddressInvalidPurposeRule struct {
23+
// GoogleCloudIdentityGroupInvalidInitialGroupConfigRule checks the pattern is valid
24+
type GoogleCloudIdentityGroupInvalidInitialGroupConfigRule struct {
2525
resourceType string
2626
attributeName string
2727
}
2828

29-
// NewGoogleComputeAddressInvalidPurposeRule returns new rule with default attributes
30-
func NewGoogleComputeAddressInvalidPurposeRule() *GoogleComputeAddressInvalidPurposeRule {
31-
return &GoogleComputeAddressInvalidPurposeRule{
32-
resourceType: "google_compute_address",
33-
attributeName: "purpose",
29+
// NewGoogleCloudIdentityGroupInvalidInitialGroupConfigRule returns new rule with default attributes
30+
func NewGoogleCloudIdentityGroupInvalidInitialGroupConfigRule() *GoogleCloudIdentityGroupInvalidInitialGroupConfigRule {
31+
return &GoogleCloudIdentityGroupInvalidInitialGroupConfigRule{
32+
resourceType: "google_cloud_identity_group",
33+
attributeName: "initial_group_config",
3434
}
3535
}
3636

3737
// Name returns the rule name
38-
func (r *GoogleComputeAddressInvalidPurposeRule) Name() string {
39-
return "google_compute_address_invalid_purpose"
38+
func (r *GoogleCloudIdentityGroupInvalidInitialGroupConfigRule) Name() string {
39+
return "google_cloud_identity_group_invalid_initial_group_config"
4040
}
4141

4242
// Enabled returns whether the rule is enabled by default
43-
func (r *GoogleComputeAddressInvalidPurposeRule) Enabled() bool {
43+
func (r *GoogleCloudIdentityGroupInvalidInitialGroupConfigRule) Enabled() bool {
4444
return true
4545
}
4646

4747
// Severity returns the rule severity
48-
func (r *GoogleComputeAddressInvalidPurposeRule) Severity() string {
48+
func (r *GoogleCloudIdentityGroupInvalidInitialGroupConfigRule) Severity() string {
4949
return tflint.ERROR
5050
}
5151

5252
// Link returns the rule reference link
53-
func (r *GoogleComputeAddressInvalidPurposeRule) Link() string {
53+
func (r *GoogleCloudIdentityGroupInvalidInitialGroupConfigRule) Link() string {
5454
return ""
5555
}
5656

5757
// Check checks the pattern is valid
58-
func (r *GoogleComputeAddressInvalidPurposeRule) Check(runner tflint.Runner) error {
58+
func (r *GoogleCloudIdentityGroupInvalidInitialGroupConfigRule) Check(runner tflint.Runner) error {
5959
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error {
6060
var val string
6161
err := runner.EvaluateExpr(attribute.Expr, &val, nil)
6262

63-
validateFunc := validation.StringInSlice([]string{"GCE_ENDPOINT", "VPC_PEERING", "SHARED_LOADBALANCER_VIP", ""}, false)
63+
validateFunc := validation.StringInSlice([]string{"INITIAL_GROUP_CONFIG_UNSPECIFIED", "WITH_INITIAL_OWNER", "EMPTY", ""}, false)
6464

6565
return runner.EnsureNoError(err, func() error {
6666
_, errors := validateFunc(val, r.attributeName)

rules/magicmodules/google_dns_record_set_invalid_type.go

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

63-
validateFunc := validation.StringInSlice([]string{"A", "AAAA", "CAA", "CNAME", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TLSA", "TXT"}, false)
63+
validateFunc := validation.StringInSlice([]string{"A", "AAAA", "CAA", "CNAME", "DNSKEY", "DS", "IPSECVPNKEY", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "SSHFP", "TLSA", "TXT"}, false)
6464

6565
return runner.EnsureNoError(err, func() error {
6666
_, errors := validateFunc(val, r.attributeName)

rules/magicmodules/google_compute_global_address_invalid_purpose.go renamed to rules/magicmodules/google_memcache_instance_invalid_memcache_version.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,47 @@ import (
2020
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
2121
)
2222

23-
// GoogleComputeGlobalAddressInvalidPurposeRule checks the pattern is valid
24-
type GoogleComputeGlobalAddressInvalidPurposeRule struct {
23+
// GoogleMemcacheInstanceInvalidMemcacheVersionRule checks the pattern is valid
24+
type GoogleMemcacheInstanceInvalidMemcacheVersionRule struct {
2525
resourceType string
2626
attributeName string
2727
}
2828

29-
// NewGoogleComputeGlobalAddressInvalidPurposeRule returns new rule with default attributes
30-
func NewGoogleComputeGlobalAddressInvalidPurposeRule() *GoogleComputeGlobalAddressInvalidPurposeRule {
31-
return &GoogleComputeGlobalAddressInvalidPurposeRule{
32-
resourceType: "google_compute_global_address",
33-
attributeName: "purpose",
29+
// NewGoogleMemcacheInstanceInvalidMemcacheVersionRule returns new rule with default attributes
30+
func NewGoogleMemcacheInstanceInvalidMemcacheVersionRule() *GoogleMemcacheInstanceInvalidMemcacheVersionRule {
31+
return &GoogleMemcacheInstanceInvalidMemcacheVersionRule{
32+
resourceType: "google_memcache_instance",
33+
attributeName: "memcache_version",
3434
}
3535
}
3636

3737
// Name returns the rule name
38-
func (r *GoogleComputeGlobalAddressInvalidPurposeRule) Name() string {
39-
return "google_compute_global_address_invalid_purpose"
38+
func (r *GoogleMemcacheInstanceInvalidMemcacheVersionRule) Name() string {
39+
return "google_memcache_instance_invalid_memcache_version"
4040
}
4141

4242
// Enabled returns whether the rule is enabled by default
43-
func (r *GoogleComputeGlobalAddressInvalidPurposeRule) Enabled() bool {
43+
func (r *GoogleMemcacheInstanceInvalidMemcacheVersionRule) Enabled() bool {
4444
return true
4545
}
4646

4747
// Severity returns the rule severity
48-
func (r *GoogleComputeGlobalAddressInvalidPurposeRule) Severity() string {
48+
func (r *GoogleMemcacheInstanceInvalidMemcacheVersionRule) Severity() string {
4949
return tflint.ERROR
5050
}
5151

5252
// Link returns the rule reference link
53-
func (r *GoogleComputeGlobalAddressInvalidPurposeRule) Link() string {
53+
func (r *GoogleMemcacheInstanceInvalidMemcacheVersionRule) Link() string {
5454
return ""
5555
}
5656

5757
// Check checks the pattern is valid
58-
func (r *GoogleComputeGlobalAddressInvalidPurposeRule) Check(runner tflint.Runner) error {
58+
func (r *GoogleMemcacheInstanceInvalidMemcacheVersionRule) Check(runner tflint.Runner) error {
5959
return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error {
6060
var val string
6161
err := runner.EvaluateExpr(attribute.Expr, &val, nil)
6262

63-
validateFunc := validation.StringInSlice([]string{"VPC_PEERING", "PRIVATE_SERVICE_CONNECT", ""}, false)
63+
validateFunc := validation.StringInSlice([]string{"MEMCACHE_1_5", ""}, false)
6464

6565
return runner.EnsureNoError(err, func() error {
6666
_, errors := validateFunc(val, r.attributeName)

rules/magicmodules/product.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ var Products = map[string]Product{
6363
{Name: "Apigee API", URL: "https://console.cloud.google.com/apis/library/apigee.googleapis.com/"},
6464
},
6565
},
66+
"google_apigee_envgroup_attachment": {
67+
APIsRequired: []APIReference{
68+
{Name: "Apigee API", URL: "https://console.cloud.google.com/apis/library/apigee.googleapis.com/"},
69+
},
70+
},
6671
"google_kms_key_ring": {
6772
APIsRequired: []APIReference{
6873
{Name: "Cloud Key Management Service (KMS) API", URL: "https://console.cloud.google.com/apis/library/cloudkms.googleapis.com/"},
@@ -344,6 +349,15 @@ var Products = map[string]Product{
344349
{Name: "Google Cloud Storage", URL: "https://console.cloud.google.com/apis/library/storage-component.googleapis.com/"},
345350
},
346351
},
352+
"google_tags_tag_key": {
353+
APIsRequired: []APIReference{},
354+
},
355+
"google_tags_tag_value": {
356+
APIsRequired: []APIReference{},
357+
},
358+
"google_tags_tag_binding": {
359+
APIsRequired: []APIReference{},
360+
},
347361
"google_cloud_run_domain_mapping": {
348362
APIsRequired: []APIReference{},
349363
},
@@ -355,6 +369,9 @@ var Products = map[string]Product{
355369
{Name: "Cloud Datastore API", URL: "https://console.cloud.google.com/apis/library/datastore.googleapis.com"},
356370
},
357371
},
372+
"google_memcache_instance": {
373+
APIsRequired: []APIReference{},
374+
},
358375
"google_iap_brand": {
359376
APIsRequired: []APIReference{
360377
{Name: "Cloud Identity-Aware Proxy", URL: "https://console.cloud.google.com/apis/library/iap.googleapis.com/"},

rules/magicmodules/provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ var Rules = []tflint.Rule{
3535
NewGoogleCloudAssetFolderFeedInvalidContentTypeRule(),
3636
NewGoogleCloudAssetOrganizationFeedInvalidContentTypeRule(),
3737
NewGoogleCloudAssetProjectFeedInvalidContentTypeRule(),
38+
NewGoogleCloudIdentityGroupInvalidInitialGroupConfigRule(),
3839
NewGoogleCloudiotDeviceInvalidLogLevelRule(),
3940
NewGoogleCloudiotRegistryInvalidLogLevelRule(),
4041
NewGoogleComputeAddressInvalidAddressTypeRule(),
4142
NewGoogleComputeAddressInvalidNameRule(),
4243
NewGoogleComputeAddressInvalidNetworkTierRule(),
43-
NewGoogleComputeAddressInvalidPurposeRule(),
4444
NewGoogleComputeBackendBucketInvalidNameRule(),
4545
NewGoogleComputeBackendBucketSignedUrlKeyInvalidNameRule(),
4646
NewGoogleComputeBackendServiceInvalidLoadBalancingSchemeRule(),
@@ -55,7 +55,6 @@ var Rules = []tflint.Rule{
5555
NewGoogleComputeForwardingRuleInvalidNetworkTierRule(),
5656
NewGoogleComputeGlobalAddressInvalidAddressTypeRule(),
5757
NewGoogleComputeGlobalAddressInvalidIpVersionRule(),
58-
NewGoogleComputeGlobalAddressInvalidPurposeRule(),
5958
NewGoogleComputeGlobalForwardingRuleInvalidIpProtocolRule(),
6059
NewGoogleComputeGlobalForwardingRuleInvalidIpVersionRule(),
6160
NewGoogleComputeGlobalForwardingRuleInvalidLoadBalancingSchemeRule(),
@@ -103,6 +102,7 @@ var Rules = []tflint.Rule{
103102
NewGoogleKmsCryptoKeyInvalidPurposeRule(),
104103
NewGoogleKmsKeyRingImportJobInvalidImportMethodRule(),
105104
NewGoogleKmsKeyRingImportJobInvalidProtectionLevelRule(),
105+
NewGoogleMemcacheInstanceInvalidMemcacheVersionRule(),
106106
NewGoogleMonitoringAlertPolicyInvalidCombinerRule(),
107107
NewGoogleMonitoringCustomServiceInvalidServiceIdRule(),
108108
NewGoogleMonitoringMetricDescriptorInvalidLaunchStageRule(),

tools/magic-modules

Submodule magic-modules updated 174 files

0 commit comments

Comments
 (0)