diff --git a/GNUmakefile b/GNUmakefile index c682fc3f1b48..772bb67de673 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -98,6 +98,9 @@ lint: -S028 \ -S029 \ -S030 \ + -S031 \ + -S032 \ + -S033 \ -S034 \ -V003 \ -V006 \ diff --git a/aws/data_source_aws_cloudformation_stack.go b/aws/data_source_aws_cloudformation_stack.go index 1b1e440c6cd6..d1182ef49e98 100644 --- a/aws/data_source_aws_cloudformation_stack.go +++ b/aws/data_source_aws_cloudformation_stack.go @@ -22,10 +22,6 @@ func dataSourceAwsCloudFormationStack() *schema.Resource { "template_body": { Type: schema.TypeString, Computed: true, - StateFunc: func(v interface{}) string { - template, _ := normalizeCloudFormationTemplate(v) - return template - }, }, "capabilities": { Type: schema.TypeSet, diff --git a/aws/data_source_aws_cloudhsm2_cluster.go b/aws/data_source_aws_cloudhsm2_cluster.go index 97e277317244..1de17a0c80ec 100644 --- a/aws/data_source_aws_cloudhsm2_cluster.go +++ b/aws/data_source_aws_cloudhsm2_cluster.go @@ -37,7 +37,6 @@ func dataSourceCloudHsm2Cluster() *schema.Resource { "cluster_certificates": { Type: schema.TypeList, - MaxItems: 1, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ diff --git a/aws/data_source_aws_dynamodb_table.go b/aws/data_source_aws_dynamodb_table.go index 2bd4d3dcb51e..77594acee11a 100644 --- a/aws/data_source_aws_dynamodb_table.go +++ b/aws/data_source_aws_dynamodb_table.go @@ -3,7 +3,6 @@ package aws import ( "bytes" "fmt" - "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" @@ -140,16 +139,11 @@ func dataSourceAwsDynamoDbTable() *schema.Resource { "stream_view_type": { Type: schema.TypeString, Computed: true, - StateFunc: func(v interface{}) string { - value := v.(string) - return strings.ToUpper(value) - }, }, "tags": tagsSchemaComputed(), "ttl": { Type: schema.TypeSet, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "attribute_name": { @@ -192,7 +186,6 @@ func dataSourceAwsDynamoDbTable() *schema.Resource { "point_in_time_recovery": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "enabled": { diff --git a/aws/data_source_aws_efs_file_system.go b/aws/data_source_aws_efs_file_system.go index 008e88edc9b4..cbe4ac0f5547 100644 --- a/aws/data_source_aws_efs_file_system.go +++ b/aws/data_source_aws_efs_file_system.go @@ -62,7 +62,6 @@ func dataSourceAwsEfsFileSystem() *schema.Resource { "lifecycle_policy": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "transition_to_ia": { diff --git a/aws/data_source_aws_eks_cluster.go b/aws/data_source_aws_eks_cluster.go index b289ee01f635..f6decfa3c5d4 100644 --- a/aws/data_source_aws_eks_cluster.go +++ b/aws/data_source_aws_eks_cluster.go @@ -22,7 +22,6 @@ func dataSourceAwsEksCluster() *schema.Resource { }, "certificate_authority": { Type: schema.TypeList, - MaxItems: 1, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -88,7 +87,6 @@ func dataSourceAwsEksCluster() *schema.Resource { "tags": tagsSchemaComputed(), "vpc_config": { Type: schema.TypeList, - MaxItems: 1, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ diff --git a/aws/data_source_aws_elastic_beanstalk_application.go b/aws/data_source_aws_elastic_beanstalk_application.go index 400dc7f6e0ef..c1d0a7d3ed8f 100644 --- a/aws/data_source_aws_elastic_beanstalk_application.go +++ b/aws/data_source_aws_elastic_beanstalk_application.go @@ -29,7 +29,6 @@ func dataSourceAwsElasticBeanstalkApplication() *schema.Resource { "appversion_lifecycle": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "service_role": { diff --git a/aws/data_source_aws_elb.go b/aws/data_source_aws_elb.go index b81d48f902bf..b4d40db97281 100644 --- a/aws/data_source_aws_elb.go +++ b/aws/data_source_aws_elb.go @@ -27,7 +27,6 @@ func dataSourceAwsElb() *schema.Resource { "access_logs": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "interval": { @@ -80,7 +79,6 @@ func dataSourceAwsElb() *schema.Resource { "health_check": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "healthy_threshold": { diff --git a/aws/data_source_aws_lambda_function.go b/aws/data_source_aws_lambda_function.go index 1a72e0d23d9c..3c4a3f5e92f7 100644 --- a/aws/data_source_aws_lambda_function.go +++ b/aws/data_source_aws_lambda_function.go @@ -31,8 +31,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource { "dead_letter_config": { Type: schema.TypeList, Computed: true, - MinItems: 0, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "target_arn": { @@ -49,7 +47,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource { "layers": { Type: schema.TypeList, Computed: true, - MaxItems: 5, Elem: &schema.Schema{ Type: schema.TypeString, }, @@ -81,7 +78,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource { "vpc_config": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "subnet_ids": { @@ -130,7 +126,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource { "environment": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "variables": { @@ -143,7 +138,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource { }, "tracing_config": { Type: schema.TypeList, - MaxItems: 1, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ diff --git a/aws/data_source_aws_lambda_layer_version.go b/aws/data_source_aws_lambda_layer_version.go index 585625748185..30e9167feac8 100644 --- a/aws/data_source_aws_lambda_layer_version.go +++ b/aws/data_source_aws_lambda_layer_version.go @@ -34,7 +34,6 @@ func dataSourceAwsLambdaLayerVersion() *schema.Resource { "compatible_runtimes": { Type: schema.TypeSet, Computed: true, - MaxItems: 5, Elem: &schema.Schema{ Type: schema.TypeString, }, diff --git a/aws/data_source_aws_lb.go b/aws/data_source_aws_lb.go index b827dc3eab00..f09e2205c877 100644 --- a/aws/data_source_aws_lb.go +++ b/aws/data_source_aws_lb.go @@ -74,7 +74,6 @@ func dataSourceAwsLb() *schema.Resource { "access_logs": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bucket": { diff --git a/aws/data_source_aws_lb_target_group.go b/aws/data_source_aws_lb_target_group.go index cff2cf93999c..a9f241bd08e0 100644 --- a/aws/data_source_aws_lb_target_group.go +++ b/aws/data_source_aws_lb_target_group.go @@ -73,7 +73,6 @@ func dataSourceAwsLbTargetGroup() *schema.Resource { "stickiness": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "enabled": { @@ -95,7 +94,6 @@ func dataSourceAwsLbTargetGroup() *schema.Resource { "health_check": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "enabled": { diff --git a/aws/data_source_aws_mq_broker.go b/aws/data_source_aws_mq_broker.go index a7e00f8c7138..af80a8403d8d 100644 --- a/aws/data_source_aws_mq_broker.go +++ b/aws/data_source_aws_mq_broker.go @@ -37,7 +37,6 @@ func dataSourceAwsMqBroker() *schema.Resource { "configuration": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { @@ -130,7 +129,6 @@ func dataSourceAwsMqBroker() *schema.Resource { }, "maintenance_window_start_time": { Type: schema.TypeList, - MaxItems: 1, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ diff --git a/aws/data_source_aws_rds_cluster.go b/aws/data_source_aws_rds_cluster.go index 00427b422138..7a111a2f57cc 100644 --- a/aws/data_source_aws_rds_cluster.go +++ b/aws/data_source_aws_rds_cluster.go @@ -3,7 +3,6 @@ package aws import ( "fmt" "log" - "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" @@ -120,12 +119,6 @@ func dataSourceAwsRdsCluster() *schema.Resource { "preferred_maintenance_window": { Type: schema.TypeString, Computed: true, - StateFunc: func(val interface{}) string { - if val == nil { - return "" - } - return strings.ToLower(val.(string)) - }, }, "port": { diff --git a/aws/resource_aws_api_gateway_account.go b/aws/resource_aws_api_gateway_account.go index a7587d710c88..c48c9bcd7ea4 100644 --- a/aws/resource_aws_api_gateway_account.go +++ b/aws/resource_aws_api_gateway_account.go @@ -29,7 +29,6 @@ func resourceAwsApiGatewayAccount() *schema.Resource { "throttle_settings": { Type: schema.TypeList, Computed: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "burst_limit": { diff --git a/aws/resource_aws_cloudhsm2_cluster.go b/aws/resource_aws_cloudhsm2_cluster.go index 65dda087432c..a59255804bde 100644 --- a/aws/resource_aws_cloudhsm2_cluster.go +++ b/aws/resource_aws_cloudhsm2_cluster.go @@ -63,7 +63,6 @@ func resourceAwsCloudHsm2Cluster() *schema.Resource { "cluster_certificates": { Type: schema.TypeList, - MaxItems: 1, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ diff --git a/aws/resource_aws_eks_cluster.go b/aws/resource_aws_eks_cluster.go index c1d55c2169d8..d9d71d4cbc6a 100644 --- a/aws/resource_aws_eks_cluster.go +++ b/aws/resource_aws_eks_cluster.go @@ -46,7 +46,6 @@ func resourceAwsEksCluster() *schema.Resource { }, "certificate_authority": { Type: schema.TypeList, - MaxItems: 1, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{