Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump aws-sdk-go submodule and Terraform provider schema #188

Merged
merged 2 commits into from
Oct 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ These rules enforce best practices and naming conventions:
|aws_elastic_beanstalk_environment_invalid_version_label|✔|
|aws_elasticache_cluster_invalid_az_mode|✔|
|aws_elasticsearch_domain_invalid_domain_name|✔|
|aws_elasticsearch_domain_invalid_elasticsearch_version|✔|
|aws_elasticsearch_domain_policy_invalid_domain_name|✔|
|aws_elastictranscoder_pipeline_invalid_aws_kms_key_arn|✔|
|aws_elastictranscoder_pipeline_invalid_input_bucket|✔|
Expand Down
2 changes: 1 addition & 1 deletion rules/models/aws-sdk-go
Submodule aws-sdk-go updated 611 files
1 change: 1 addition & 0 deletions rules/models/aws_alb_target_group_invalid_target_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func NewAwsALBTargetGroupInvalidTargetTypeRule() *AwsALBTargetGroupInvalidTarget
"instance",
"ip",
"lambda",
"alb",
},
}
}
Expand Down
1 change: 1 addition & 0 deletions rules/models/aws_ami_invalid_architecture.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func NewAwsAMIInvalidArchitectureRule() *AwsAMIInvalidArchitectureRule {
"i386",
"x86_64",
"arm64",
"x86_64_mac",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func NewAwsAppautoscalingPolicyInvalidScalableDimensionRule() *AwsAppautoscaling
"kafka:broker-storage:VolumeSize",
"elasticache:replication-group:NodeGroups",
"elasticache:replication-group:Replicas",
"neptune:cluster:ReadReplicaCount",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func NewAwsAppautoscalingPolicyInvalidServiceNamespaceRule() *AwsAppautoscalingP
"cassandra",
"kafka",
"elasticache",
"neptune",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func NewAwsAppautoscalingScheduledActionInvalidScalableDimensionRule() *AwsAppau
"kafka:broker-storage:VolumeSize",
"elasticache:replication-group:NodeGroups",
"elasticache:replication-group:Replicas",
"neptune:cluster:ReadReplicaCount",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func NewAwsAppautoscalingScheduledActionInvalidServiceNamespaceRule() *AwsAppaut
"cassandra",
"kafka",
"elasticache",
"neptune",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func NewAwsAppautoscalingTargetInvalidScalableDimensionRule() *AwsAppautoscaling
"kafka:broker-storage:VolumeSize",
"elasticache:replication-group:NodeGroups",
"elasticache:replication-group:Replicas",
"neptune:cluster:ReadReplicaCount",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func NewAwsAppautoscalingTargetInvalidServiceNamespaceRule() *AwsAppautoscalingT
"cassandra",
"kafka",
"elasticache",
"neptune",
},
}
}
Expand Down
1 change: 1 addition & 0 deletions rules/models/aws_appsync_datasource_invalid_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func NewAwsAppsyncDatasourceInvalidTypeRule() *AwsAppsyncDatasourceInvalidTypeRu
"NONE",
"HTTP",
"RELATIONAL_DATABASE",
"AMAZON_OPENSEARCH_SERVICE",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// This file generated by `generator/`. DO NOT EDIT

package models

import (
"fmt"
"log"
"regexp"

hcl "github.com/hashicorp/hcl/v2"
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
)

// AwsElasticsearchDomainInvalidElasticsearchVersionRule checks the pattern is valid
type AwsElasticsearchDomainInvalidElasticsearchVersionRule struct {
resourceType string
attributeName string
pattern *regexp.Regexp
}

// NewAwsElasticsearchDomainInvalidElasticsearchVersionRule returns new rule with default attributes
func NewAwsElasticsearchDomainInvalidElasticsearchVersionRule() *AwsElasticsearchDomainInvalidElasticsearchVersionRule {
return &AwsElasticsearchDomainInvalidElasticsearchVersionRule{
resourceType: "aws_elasticsearch_domain",
attributeName: "elasticsearch_version",
pattern: regexp.MustCompile(`^[0-9]{1}\.[0-9]{1,2}$|^OpenSearch_[0-9]{1,2}\.[0-9]{1,2}$`),
}
}

// Name returns the rule name
func (r *AwsElasticsearchDomainInvalidElasticsearchVersionRule) Name() string {
return "aws_elasticsearch_domain_invalid_elasticsearch_version"
}

// Enabled returns whether the rule is enabled by default
func (r *AwsElasticsearchDomainInvalidElasticsearchVersionRule) Enabled() bool {
return true
}

// Severity returns the rule severity
func (r *AwsElasticsearchDomainInvalidElasticsearchVersionRule) Severity() string {
return tflint.ERROR
}

// Link returns the rule reference link
func (r *AwsElasticsearchDomainInvalidElasticsearchVersionRule) Link() string {
return ""
}

// Check checks the pattern is valid
func (r *AwsElasticsearchDomainInvalidElasticsearchVersionRule) Check(runner tflint.Runner) error {
log.Printf("[TRACE] Check `%s` rule", r.Name())

return runner.WalkResourceAttributes(r.resourceType, r.attributeName, func(attribute *hcl.Attribute) error {
var val string
err := runner.EvaluateExpr(attribute.Expr, &val, nil)

return runner.EnsureNoError(err, func() error {
if !r.pattern.MatchString(val) {
runner.EmitIssueOnExpr(
r,
fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^[0-9]{1}\.[0-9]{1,2}$|^OpenSearch_[0-9]{1,2}\.[0-9]{1,2}$`),
attribute.Expr,
)
}
return nil
})
})
}
3 changes: 3 additions & 0 deletions rules/models/aws_instance_invalid_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ func NewAwsInstanceInvalidTypeRule() *AwsInstanceInvalidTypeRule {
"x2gd.12xlarge",
"x2gd.16xlarge",
"x2gd.metal",
"vt1.3xlarge",
"vt1.6xlarge",
"vt1.24xlarge",
},
}
}
Expand Down
3 changes: 3 additions & 0 deletions rules/models/aws_launch_configuration_invalid_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ func NewAwsLaunchConfigurationInvalidTypeRule() *AwsLaunchConfigurationInvalidTy
"x2gd.12xlarge",
"x2gd.16xlarge",
"x2gd.metal",
"vt1.3xlarge",
"vt1.6xlarge",
"vt1.24xlarge",
},
}
}
Expand Down
3 changes: 3 additions & 0 deletions rules/models/aws_launch_template_invalid_instance_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ func NewAwsLaunchTemplateInvalidInstanceTypeRule() *AwsLaunchTemplateInvalidInst
"x2gd.12xlarge",
"x2gd.16xlarge",
"x2gd.metal",
"vt1.3xlarge",
"vt1.6xlarge",
"vt1.24xlarge",
},
}
}
Expand Down
1 change: 1 addition & 0 deletions rules/models/aws_lb_target_group_invalid_target_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func NewAwsLbTargetGroupInvalidTargetTypeRule() *AwsLbTargetGroupInvalidTargetTy
"instance",
"ip",
"lambda",
"alb",
},
}
}
Expand Down
1 change: 1 addition & 0 deletions rules/models/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ var Rules = []tflint.Rule{
NewAwsElasticBeanstalkEnvironmentInvalidVersionLabelRule(),
NewAwsElastiCacheClusterInvalidAzModeRule(),
NewAwsElasticsearchDomainInvalidDomainNameRule(),
NewAwsElasticsearchDomainInvalidElasticsearchVersionRule(),
NewAwsElasticsearchDomainPolicyInvalidDomainNameRule(),
NewAwsElastictranscoderPipelineInvalidAwsKmsKeyArnRule(),
NewAwsElastictranscoderPipelineInvalidInputBucketRule(),
Expand Down
9 changes: 9 additions & 0 deletions rules/tags/resources.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/provider-schema/.terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.5
1.0.8
28 changes: 14 additions & 14 deletions tools/provider-schema/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/provider-schema/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.56.0"
version = "3.62.0"
}
}
}
2 changes: 1 addition & 1 deletion tools/provider-schema/schema.json

Large diffs are not rendered by default.