diff --git a/rules/models/aws_acm_certificate_invalid_certificate_authority_arn.go b/rules/models/aws_acm_certificate_invalid_certificate_authority_arn.go index 121a49b0..2ef0f220 100644 --- a/rules/models/aws_acm_certificate_invalid_certificate_authority_arn.go +++ b/rules/models/aws_acm_certificate_invalid_certificate_authority_arn.go @@ -29,7 +29,7 @@ func NewAwsAcmCertificateInvalidCertificateAuthorityArnRule() *AwsAcmCertificate attributeName: "certificate_authority_arn", max: 2048, min: 20, - pattern: regexp.MustCompile(`^arn:[\w+=/,.@-]+:acm:[\w+=/,.@-]*:[0-9]+:[\w+=,.@-]+(/[\w+=,.@-]+)*$`), + pattern: regexp.MustCompile(`^arn:[\w+=/,.@-]+:acm-pca:[\w+=/,.@-]*:[0-9]+:[\w+=,.@-]+(/[\w+=,.@-]+)*$`), } } @@ -93,7 +93,7 @@ func (r *AwsAcmCertificateInvalidCertificateAuthorityArnRule) Check(runner tflin if !r.pattern.MatchString(val) { runner.EmitIssue( r, - fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^arn:[\w+=/,.@-]+:acm:[\w+=/,.@-]*:[0-9]+:[\w+=,.@-]+(/[\w+=,.@-]+)*$`), + fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(val), `^arn:[\w+=/,.@-]+:acm-pca:[\w+=/,.@-]*:[0-9]+:[\w+=,.@-]+(/[\w+=,.@-]+)*$`), attribute.Expr.Range(), ) } diff --git a/rules/models/aws_acm_certificate_invalid_certificate_authority_arn_test.go b/rules/models/aws_acm_certificate_invalid_certificate_authority_arn_test.go new file mode 100644 index 00000000..bbd5da86 --- /dev/null +++ b/rules/models/aws_acm_certificate_invalid_certificate_authority_arn_test.go @@ -0,0 +1,52 @@ +// This file generated by `generator/`. DO NOT EDIT + +package models + +import ( + "testing" + "fmt" + + "github.com/terraform-linters/tflint-plugin-sdk/helper" +) + +func Test_AwsAcmCertificateInvalidCertificateAuthorityArnRule(t *testing.T) { + cases := []struct { + Name string + Content string + Expected helper.Issues + }{ + { + Name: "It includes invalid characters", + Content: ` +resource "aws_acm_certificate" "foo" { + certificate_authority_arn = "arn:aws:unknown-service:us-east-1:0000000000:certificate-authority/xxxxxx-xxx-xxx-xxxx-xxxxxxxxx" +}`, + Expected: helper.Issues{ + { + Rule: NewAwsAcmCertificateInvalidCertificateAuthorityArnRule(), + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("arn:aws:unknown-service:us-east-1:0000000000:certificate-authority/xxxxxx-xxx-xxx-xxxx-xxxxxxxxx"), `^arn:[\w+=/,.@-]+:acm-pca:[\w+=/,.@-]*:[0-9]+:[\w+=,.@-]+(/[\w+=,.@-]+)*$`), + }, + }, + }, + { + Name: "It is valid", + Content: ` +resource "aws_acm_certificate" "foo" { + certificate_authority_arn = "arn:aws:acm-pca:us-east-1:0000000000:certificate-authority/xxxxxx-xxx-xxx-xxxx-xxxxxxxxx" +}`, + Expected: helper.Issues{}, + }, + } + + rule := NewAwsAcmCertificateInvalidCertificateAuthorityArnRule() + + for _, tc := range cases { + runner := helper.TestRunner(t, map[string]string{"resource.tf": tc.Content}) + + if err := rule.Check(runner); err != nil { + t.Fatalf("Unexpected error occurred: %s", err) + } + + helper.AssertIssuesWithoutRange(t, tc.Expected, runner.Issues) + } +} diff --git a/rules/models/aws_acmpca_certificate_authority_invalid_type_test.go b/rules/models/aws_acmpca_certificate_authority_invalid_type_test.go index 5cfc84fb..13ad23c9 100644 --- a/rules/models/aws_acmpca_certificate_authority_invalid_type_test.go +++ b/rules/models/aws_acmpca_certificate_authority_invalid_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_acmpca_certificate_authority" "foo" { Expected: helper.Issues{ { Rule: NewAwsAcmpcaCertificateAuthorityInvalidTypeRule(), - Message: `"ORDINATE" is an invalid value as type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("ORDINATE"), "type"), }, }, }, diff --git a/rules/models/aws_ami_invalid_architecture_test.go b/rules/models/aws_ami_invalid_architecture_test.go index c4ccdab1..470af450 100644 --- a/rules/models/aws_ami_invalid_architecture_test.go +++ b/rules/models/aws_ami_invalid_architecture_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ami" "foo" { Expected: helper.Issues{ { Rule: NewAwsAMIInvalidArchitectureRule(), - Message: `"x86" is an invalid value as architecture`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("x86"), "architecture"), }, }, }, diff --git a/rules/models/aws_api_gateway_authorizer_invalid_type_test.go b/rules/models/aws_api_gateway_authorizer_invalid_type_test.go index 234e2eaf..ee6a0493 100644 --- a/rules/models/aws_api_gateway_authorizer_invalid_type_test.go +++ b/rules/models/aws_api_gateway_authorizer_invalid_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_api_gateway_authorizer" "foo" { Expected: helper.Issues{ { Rule: NewAwsAPIGatewayAuthorizerInvalidTypeRule(), - Message: `"RESPONSE" is an invalid value as type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("RESPONSE"), "type"), }, }, }, diff --git a/rules/models/aws_api_gateway_gateway_response_invalid_response_type_test.go b/rules/models/aws_api_gateway_gateway_response_invalid_response_type_test.go index e1f83eed..54477852 100644 --- a/rules/models/aws_api_gateway_gateway_response_invalid_response_type_test.go +++ b/rules/models/aws_api_gateway_gateway_response_invalid_response_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_api_gateway_gateway_response" "foo" { Expected: helper.Issues{ { Rule: NewAwsAPIGatewayGatewayResponseInvalidResponseTypeRule(), - Message: `"4XX" is an invalid value as response_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("4XX"), "response_type"), }, }, }, diff --git a/rules/models/aws_api_gateway_gateway_response_invalid_status_code_test.go b/rules/models/aws_api_gateway_gateway_response_invalid_status_code_test.go index 1cbc1d8c..d4f1c337 100644 --- a/rules/models/aws_api_gateway_gateway_response_invalid_status_code_test.go +++ b/rules/models/aws_api_gateway_gateway_response_invalid_status_code_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_api_gateway_gateway_response" "foo" { Expected: helper.Issues{ { Rule: NewAwsAPIGatewayGatewayResponseInvalidStatusCodeRule(), - Message: `"004" does not match valid pattern ^[1-5]\d\d$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("004"), `^[1-5]\d\d$`), }, }, }, diff --git a/rules/models/aws_api_gateway_integration_invalid_connection_type_test.go b/rules/models/aws_api_gateway_integration_invalid_connection_type_test.go index e4467d76..55e4edba 100644 --- a/rules/models/aws_api_gateway_integration_invalid_connection_type_test.go +++ b/rules/models/aws_api_gateway_integration_invalid_connection_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_api_gateway_integration" "foo" { Expected: helper.Issues{ { Rule: NewAwsAPIGatewayIntegrationInvalidConnectionTypeRule(), - Message: `"INTRANET" is an invalid value as connection_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("INTRANET"), "connection_type"), }, }, }, diff --git a/rules/models/aws_api_gateway_integration_invalid_content_handling_test.go b/rules/models/aws_api_gateway_integration_invalid_content_handling_test.go index 800d9cf1..f0815821 100644 --- a/rules/models/aws_api_gateway_integration_invalid_content_handling_test.go +++ b/rules/models/aws_api_gateway_integration_invalid_content_handling_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_api_gateway_integration" "foo" { Expected: helper.Issues{ { Rule: NewAwsAPIGatewayIntegrationInvalidContentHandlingRule(), - Message: `"CONVERT_TO_FILE" is an invalid value as content_handling`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("CONVERT_TO_FILE"), "content_handling"), }, }, }, diff --git a/rules/models/aws_api_gateway_integration_invalid_type_test.go b/rules/models/aws_api_gateway_integration_invalid_type_test.go index a59e2451..802cb6be 100644 --- a/rules/models/aws_api_gateway_integration_invalid_type_test.go +++ b/rules/models/aws_api_gateway_integration_invalid_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_api_gateway_integration" "foo" { Expected: helper.Issues{ { Rule: NewAwsAPIGatewayIntegrationInvalidTypeRule(), - Message: `"AWS_HTTP" is an invalid value as type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("AWS_HTTP"), "type"), }, }, }, diff --git a/rules/models/aws_api_gateway_rest_api_invalid_api_key_source_test.go b/rules/models/aws_api_gateway_rest_api_invalid_api_key_source_test.go index a172de21..92074bab 100644 --- a/rules/models/aws_api_gateway_rest_api_invalid_api_key_source_test.go +++ b/rules/models/aws_api_gateway_rest_api_invalid_api_key_source_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_api_gateway_rest_api" "foo" { Expected: helper.Issues{ { Rule: NewAwsAPIGatewayRestAPIInvalidAPIKeySourceRule(), - Message: `"BODY" is an invalid value as api_key_source`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("BODY"), "api_key_source"), }, }, }, diff --git a/rules/models/aws_api_gateway_stage_invalid_cache_cluster_size_test.go b/rules/models/aws_api_gateway_stage_invalid_cache_cluster_size_test.go index 80e52ce7..1219e38a 100644 --- a/rules/models/aws_api_gateway_stage_invalid_cache_cluster_size_test.go +++ b/rules/models/aws_api_gateway_stage_invalid_cache_cluster_size_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_api_gateway_stage" "foo" { Expected: helper.Issues{ { Rule: NewAwsAPIGatewayStageInvalidCacheClusterSizeRule(), - Message: `"6.2" is an invalid value as cache_cluster_size`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("6.2"), "cache_cluster_size"), }, }, }, diff --git a/rules/models/aws_appautoscaling_policy_invalid_policy_type_test.go b/rules/models/aws_appautoscaling_policy_invalid_policy_type_test.go index a03991e9..c6733c7d 100644 --- a/rules/models/aws_appautoscaling_policy_invalid_policy_type_test.go +++ b/rules/models/aws_appautoscaling_policy_invalid_policy_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_appautoscaling_policy" "foo" { Expected: helper.Issues{ { Rule: NewAwsAppautoscalingPolicyInvalidPolicyTypeRule(), - Message: `"StopScaling" is an invalid value as policy_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("StopScaling"), "policy_type"), }, }, }, diff --git a/rules/models/aws_appautoscaling_policy_invalid_scalable_dimension_test.go b/rules/models/aws_appautoscaling_policy_invalid_scalable_dimension_test.go index c8a45646..8b4534e8 100644 --- a/rules/models/aws_appautoscaling_policy_invalid_scalable_dimension_test.go +++ b/rules/models/aws_appautoscaling_policy_invalid_scalable_dimension_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_appautoscaling_policy" "foo" { Expected: helper.Issues{ { Rule: NewAwsAppautoscalingPolicyInvalidScalableDimensionRule(), - Message: `"ecs:service:DesireCount" is an invalid value as scalable_dimension`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("ecs:service:DesireCount"), "scalable_dimension"), }, }, }, diff --git a/rules/models/aws_appautoscaling_policy_invalid_service_namespace_test.go b/rules/models/aws_appautoscaling_policy_invalid_service_namespace_test.go index 8bf257a6..c6a6cbb4 100644 --- a/rules/models/aws_appautoscaling_policy_invalid_service_namespace_test.go +++ b/rules/models/aws_appautoscaling_policy_invalid_service_namespace_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_appautoscaling_policy" "foo" { Expected: helper.Issues{ { Rule: NewAwsAppautoscalingPolicyInvalidServiceNamespaceRule(), - Message: `"eks" is an invalid value as service_namespace`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("eks"), "service_namespace"), }, }, }, diff --git a/rules/models/aws_appsync_datasource_invalid_name_test.go b/rules/models/aws_appsync_datasource_invalid_name_test.go index 7a994b69..75861a91 100644 --- a/rules/models/aws_appsync_datasource_invalid_name_test.go +++ b/rules/models/aws_appsync_datasource_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_appsync_datasource" "foo" { Expected: helper.Issues{ { Rule: NewAwsAppsyncDatasourceInvalidNameRule(), - Message: `"01_tf_example" does not match valid pattern ^[_A-Za-z][_0-9A-Za-z]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("01_tf_example"), `^[_A-Za-z][_0-9A-Za-z]*$`), }, }, }, diff --git a/rules/models/aws_appsync_datasource_invalid_type_test.go b/rules/models/aws_appsync_datasource_invalid_type_test.go index 6ada8407..ee95dec9 100644 --- a/rules/models/aws_appsync_datasource_invalid_type_test.go +++ b/rules/models/aws_appsync_datasource_invalid_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_appsync_datasource" "foo" { Expected: helper.Issues{ { Rule: NewAwsAppsyncDatasourceInvalidTypeRule(), - Message: `"AMAZON_SIMPLEDB" is an invalid value as type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("AMAZON_SIMPLEDB"), "type"), }, }, }, diff --git a/rules/models/aws_appsync_graphql_api_invalid_authentication_type_test.go b/rules/models/aws_appsync_graphql_api_invalid_authentication_type_test.go index 3063da89..8b0c0117 100644 --- a/rules/models/aws_appsync_graphql_api_invalid_authentication_type_test.go +++ b/rules/models/aws_appsync_graphql_api_invalid_authentication_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_appsync_graphql_api" "foo" { Expected: helper.Issues{ { Rule: NewAwsAppsyncGraphqlAPIInvalidAuthenticationTypeRule(), - Message: `"AWS_KEY" is an invalid value as authentication_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("AWS_KEY"), "authentication_type"), }, }, }, diff --git a/rules/models/aws_backup_selection_invalid_name_test.go b/rules/models/aws_backup_selection_invalid_name_test.go index 598b7725..106067b7 100644 --- a/rules/models/aws_backup_selection_invalid_name_test.go +++ b/rules/models/aws_backup_selection_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_backup_selection" "foo" { Expected: helper.Issues{ { Rule: NewAwsBackupSelectionInvalidNameRule(), - Message: `"tf_example_backup_selection_tf_example_backup_selection" does not match valid pattern ^[a-zA-Z0-9\-\_\.]{1,50}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("tf_example_backup_selection_tf_example_backup_selection"), `^[a-zA-Z0-9\-\_\.]{1,50}$`), }, }, }, diff --git a/rules/models/aws_backup_vault_invalid_name_test.go b/rules/models/aws_backup_vault_invalid_name_test.go index 3ded5812..a7d65988 100644 --- a/rules/models/aws_backup_vault_invalid_name_test.go +++ b/rules/models/aws_backup_vault_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_backup_vault" "foo" { Expected: helper.Issues{ { Rule: NewAwsBackupVaultInvalidNameRule(), - Message: `"example_backup_vault_example_backup_vault_example_backup_vault" does not match valid pattern ^[a-zA-Z0-9\-\_]{2,50}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("example_backup_vault_example_backup_vault_example_backup_vault"), `^[a-zA-Z0-9\-\_]{2,50}$`), }, }, }, diff --git a/rules/models/aws_batch_compute_environment_invalid_state_test.go b/rules/models/aws_batch_compute_environment_invalid_state_test.go index 5cf55fb3..45788769 100644 --- a/rules/models/aws_batch_compute_environment_invalid_state_test.go +++ b/rules/models/aws_batch_compute_environment_invalid_state_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_batch_compute_environment" "foo" { Expected: helper.Issues{ { Rule: NewAwsBatchComputeEnvironmentInvalidStateRule(), - Message: `"ON" is an invalid value as state`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("ON"), "state"), }, }, }, diff --git a/rules/models/aws_batch_compute_environment_invalid_type_test.go b/rules/models/aws_batch_compute_environment_invalid_type_test.go index 9e60deba..bb98b6ed 100644 --- a/rules/models/aws_batch_compute_environment_invalid_type_test.go +++ b/rules/models/aws_batch_compute_environment_invalid_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_batch_compute_environment" "foo" { Expected: helper.Issues{ { Rule: NewAwsBatchComputeEnvironmentInvalidTypeRule(), - Message: `"CONTROLLED" is an invalid value as type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("CONTROLLED"), "type"), }, }, }, diff --git a/rules/models/aws_batch_job_definition_invalid_type_test.go b/rules/models/aws_batch_job_definition_invalid_type_test.go index 057fa7f2..3c176ca7 100644 --- a/rules/models/aws_batch_job_definition_invalid_type_test.go +++ b/rules/models/aws_batch_job_definition_invalid_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_batch_job_definition" "foo" { Expected: helper.Issues{ { Rule: NewAwsBatchJobDefinitionInvalidTypeRule(), - Message: `"docker" is an invalid value as type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("docker"), "type"), }, }, }, diff --git a/rules/models/aws_batch_job_queue_invalid_state_test.go b/rules/models/aws_batch_job_queue_invalid_state_test.go index 77055845..19b061b8 100644 --- a/rules/models/aws_batch_job_queue_invalid_state_test.go +++ b/rules/models/aws_batch_job_queue_invalid_state_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_batch_job_queue" "foo" { Expected: helper.Issues{ { Rule: NewAwsBatchJobQueueInvalidStateRule(), - Message: `"ON" is an invalid value as state`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("ON"), "state"), }, }, }, diff --git a/rules/models/aws_budgets_budget_invalid_account_id_test.go b/rules/models/aws_budgets_budget_invalid_account_id_test.go index d163ba17..cd09cf35 100644 --- a/rules/models/aws_budgets_budget_invalid_account_id_test.go +++ b/rules/models/aws_budgets_budget_invalid_account_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_budgets_budget" "foo" { Expected: helper.Issues{ { Rule: NewAwsBudgetsBudgetInvalidAccountIDRule(), - Message: `"abcdefghijkl" does not match valid pattern ^\d{12}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("abcdefghijkl"), `^\d{12}$`), }, }, }, diff --git a/rules/models/aws_budgets_budget_invalid_budget_type_test.go b/rules/models/aws_budgets_budget_invalid_budget_type_test.go index 57994640..2dc46cd8 100644 --- a/rules/models/aws_budgets_budget_invalid_budget_type_test.go +++ b/rules/models/aws_budgets_budget_invalid_budget_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_budgets_budget" "foo" { Expected: helper.Issues{ { Rule: NewAwsBudgetsBudgetInvalidBudgetTypeRule(), - Message: `"MONEY" is an invalid value as budget_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("MONEY"), "budget_type"), }, }, }, diff --git a/rules/models/aws_budgets_budget_invalid_name_test.go b/rules/models/aws_budgets_budget_invalid_name_test.go index 483599d5..3da2cdbf 100644 --- a/rules/models/aws_budgets_budget_invalid_name_test.go +++ b/rules/models/aws_budgets_budget_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_budgets_budget" "foo" { Expected: helper.Issues{ { Rule: NewAwsBudgetsBudgetInvalidNameRule(), - Message: `"budget:ec2:monthly" does not match valid pattern ^[^:\\]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("budget:ec2:monthly"), `^[^:\\]+$`), }, }, }, diff --git a/rules/models/aws_budgets_budget_invalid_time_unit_test.go b/rules/models/aws_budgets_budget_invalid_time_unit_test.go index ecbb2959..7d5ef631 100644 --- a/rules/models/aws_budgets_budget_invalid_time_unit_test.go +++ b/rules/models/aws_budgets_budget_invalid_time_unit_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_budgets_budget" "foo" { Expected: helper.Issues{ { Rule: NewAwsBudgetsBudgetInvalidTimeUnitRule(), - Message: `"HOURLY" is an invalid value as time_unit`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("HOURLY"), "time_unit"), }, }, }, diff --git a/rules/models/aws_cloud9_environment_ec2_invalid_instance_type_test.go b/rules/models/aws_cloud9_environment_ec2_invalid_instance_type_test.go index b55a1add..b3bc3c4c 100644 --- a/rules/models/aws_cloud9_environment_ec2_invalid_instance_type_test.go +++ b/rules/models/aws_cloud9_environment_ec2_invalid_instance_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloud9_environment_ec2" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloud9EnvironmentEc2InvalidInstanceTypeRule(), - Message: `"t20.micro" does not match valid pattern ^[a-z][1-9][.][a-z0-9]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("t20.micro"), `^[a-z][1-9][.][a-z0-9]+$`), }, }, }, diff --git a/rules/models/aws_cloud9_environment_ec2_invalid_owner_arn_test.go b/rules/models/aws_cloud9_environment_ec2_invalid_owner_arn_test.go index f3dd7a77..c188ba40 100644 --- a/rules/models/aws_cloud9_environment_ec2_invalid_owner_arn_test.go +++ b/rules/models/aws_cloud9_environment_ec2_invalid_owner_arn_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloud9_environment_ec2" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloud9EnvironmentEc2InvalidOwnerArnRule(), - Message: `"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment" does not match valid pattern ^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):(iam|sts)::\d+:(root|(user\/[\w+=/:,.@-]{1,64}|federated-user\/[\w+=/:,.@-]{2,32}|assumed-role\/[\w+=:,.@-]{1,64}\/[\w+=,.@-]{1,64}))$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment"), `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):(iam|sts)::\d+:(root|(user\/[\w+=/:,.@-]{1,64}|federated-user\/[\w+=/:,.@-]{2,32}|assumed-role\/[\w+=:,.@-]{1,64}\/[\w+=,.@-]{1,64}))$`), }, }, }, diff --git a/rules/models/aws_cloudformation_stack_invalid_on_failure_test.go b/rules/models/aws_cloudformation_stack_invalid_on_failure_test.go index f4d5c3f9..f153b3ce 100644 --- a/rules/models/aws_cloudformation_stack_invalid_on_failure_test.go +++ b/rules/models/aws_cloudformation_stack_invalid_on_failure_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudformation_stack" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudformationStackInvalidOnFailureRule(), - Message: `"DO_ANYTHING" is an invalid value as on_failure`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("DO_ANYTHING"), "on_failure"), }, }, }, diff --git a/rules/models/aws_cloudformation_stack_set_instance_invalid_account_id_test.go b/rules/models/aws_cloudformation_stack_set_instance_invalid_account_id_test.go index 97ab9443..6e058fae 100644 --- a/rules/models/aws_cloudformation_stack_set_instance_invalid_account_id_test.go +++ b/rules/models/aws_cloudformation_stack_set_instance_invalid_account_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudformation_stack_set_instance" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudformationStackSetInstanceInvalidAccountIDRule(), - Message: `"1234567890123" does not match valid pattern ^[0-9]{12}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("1234567890123"), `^[0-9]{12}$`), }, }, }, diff --git a/rules/models/aws_cloudformation_stack_set_invalid_execution_role_name_test.go b/rules/models/aws_cloudformation_stack_set_invalid_execution_role_name_test.go index e1a9e323..897f4ae7 100644 --- a/rules/models/aws_cloudformation_stack_set_invalid_execution_role_name_test.go +++ b/rules/models/aws_cloudformation_stack_set_invalid_execution_role_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudformation_stack_set" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudformationStackSetInvalidExecutionRoleNameRule(), - Message: `"AWSCloudFormation/StackSet/ExecutionRole" does not match valid pattern ^[a-zA-Z_0-9+=,.@-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("AWSCloudFormation/StackSet/ExecutionRole"), `^[a-zA-Z_0-9+=,.@-]+$`), }, }, }, diff --git a/rules/models/aws_cloudfront_distribution_invalid_http_version_test.go b/rules/models/aws_cloudfront_distribution_invalid_http_version_test.go index 16bb99f6..4e5280c6 100644 --- a/rules/models/aws_cloudfront_distribution_invalid_http_version_test.go +++ b/rules/models/aws_cloudfront_distribution_invalid_http_version_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudfront_distribution" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudfrontDistributionInvalidHTTPVersionRule(), - Message: `"http1.2" is an invalid value as http_version`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("http1.2"), "http_version"), }, }, }, diff --git a/rules/models/aws_cloudfront_distribution_invalid_price_class_test.go b/rules/models/aws_cloudfront_distribution_invalid_price_class_test.go index 29794913..f6c6f524 100644 --- a/rules/models/aws_cloudfront_distribution_invalid_price_class_test.go +++ b/rules/models/aws_cloudfront_distribution_invalid_price_class_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudfront_distribution" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudfrontDistributionInvalidPriceClassRule(), - Message: `"PriceClass_300" is an invalid value as price_class`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("PriceClass_300"), "price_class"), }, }, }, diff --git a/rules/models/aws_cloudhsm_v2_cluster_invalid_hsm_type_test.go b/rules/models/aws_cloudhsm_v2_cluster_invalid_hsm_type_test.go index b6a991ca..0932d4ea 100644 --- a/rules/models/aws_cloudhsm_v2_cluster_invalid_hsm_type_test.go +++ b/rules/models/aws_cloudhsm_v2_cluster_invalid_hsm_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudhsm_v2_cluster" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudhsmV2ClusterInvalidHsmTypeRule(), - Message: `"hsm1.micro" does not match valid pattern ^(hsm1\.medium)$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("hsm1.micro"), `^(hsm1\.medium)$`), }, }, }, diff --git a/rules/models/aws_cloudhsm_v2_cluster_invalid_source_backup_identifier_test.go b/rules/models/aws_cloudhsm_v2_cluster_invalid_source_backup_identifier_test.go index ae822fef..23fceeb3 100644 --- a/rules/models/aws_cloudhsm_v2_cluster_invalid_source_backup_identifier_test.go +++ b/rules/models/aws_cloudhsm_v2_cluster_invalid_source_backup_identifier_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudhsm_v2_cluster" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudhsmV2ClusterInvalidSourceBackupIdentifierRule(), - Message: `"rtq2dwi2gq6" does not match valid pattern ^backup-[2-7a-zA-Z]{11,16}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("rtq2dwi2gq6"), `^backup-[2-7a-zA-Z]{11,16}$`), }, }, }, diff --git a/rules/models/aws_cloudhsm_v2_hsm_invalid_availability_zone_test.go b/rules/models/aws_cloudhsm_v2_hsm_invalid_availability_zone_test.go index 28f8080a..ca998f8e 100644 --- a/rules/models/aws_cloudhsm_v2_hsm_invalid_availability_zone_test.go +++ b/rules/models/aws_cloudhsm_v2_hsm_invalid_availability_zone_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudhsm_v2_hsm" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudhsmV2HsmInvalidAvailabilityZoneRule(), - Message: `"us-east-1" does not match valid pattern ^[a-z]{2}(-(gov))?-(east|west|north|south|central){1,2}-\d[a-z]$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("us-east-1"), `^[a-z]{2}(-(gov))?-(east|west|north|south|central){1,2}-\d[a-z]$`), }, }, }, diff --git a/rules/models/aws_cloudhsm_v2_hsm_invalid_cluster_id_test.go b/rules/models/aws_cloudhsm_v2_hsm_invalid_cluster_id_test.go index f69f5537..89081bc2 100644 --- a/rules/models/aws_cloudhsm_v2_hsm_invalid_cluster_id_test.go +++ b/rules/models/aws_cloudhsm_v2_hsm_invalid_cluster_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudhsm_v2_hsm" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudhsmV2HsmInvalidClusterIDRule(), - Message: `"jxhlf7644ne" does not match valid pattern ^cluster-[2-7a-zA-Z]{11,16}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("jxhlf7644ne"), `^cluster-[2-7a-zA-Z]{11,16}$`), }, }, }, diff --git a/rules/models/aws_cloudhsm_v2_hsm_invalid_ip_address_test.go b/rules/models/aws_cloudhsm_v2_hsm_invalid_ip_address_test.go index 25c84f2e..8affde40 100644 --- a/rules/models/aws_cloudhsm_v2_hsm_invalid_ip_address_test.go +++ b/rules/models/aws_cloudhsm_v2_hsm_invalid_ip_address_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudhsm_v2_hsm" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudhsmV2HsmInvalidIPAddressRule(), - Message: `"2001:4860:4860::8888" does not match valid pattern ^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("2001:4860:4860::8888"), `^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$`), }, }, }, diff --git a/rules/models/aws_cloudhsm_v2_hsm_invalid_subnet_id_test.go b/rules/models/aws_cloudhsm_v2_hsm_invalid_subnet_id_test.go index 5f485252..877e0204 100644 --- a/rules/models/aws_cloudhsm_v2_hsm_invalid_subnet_id_test.go +++ b/rules/models/aws_cloudhsm_v2_hsm_invalid_subnet_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudhsm_v2_hsm" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudhsmV2HsmInvalidSubnetIDRule(), - Message: `"0e358c43" does not match valid pattern ^subnet-[0-9a-fA-F]{8,17}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("0e358c43"), `^subnet-[0-9a-fA-F]{8,17}$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_event_permission_invalid_action_test.go b/rules/models/aws_cloudwatch_event_permission_invalid_action_test.go index bfda0ee1..34286ed5 100644 --- a/rules/models/aws_cloudwatch_event_permission_invalid_action_test.go +++ b/rules/models/aws_cloudwatch_event_permission_invalid_action_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_event_permission" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchEventPermissionInvalidActionRule(), - Message: `"cloudwatchevents:PutEvents" does not match valid pattern ^events:[a-zA-Z]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("cloudwatchevents:PutEvents"), `^events:[a-zA-Z]+$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_event_permission_invalid_principal_test.go b/rules/models/aws_cloudwatch_event_permission_invalid_principal_test.go index f17eee3c..4ffb7c3a 100644 --- a/rules/models/aws_cloudwatch_event_permission_invalid_principal_test.go +++ b/rules/models/aws_cloudwatch_event_permission_invalid_principal_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_event_permission" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchEventPermissionInvalidPrincipalRule(), - Message: `"-" does not match valid pattern ^(\d{12}|\*)$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("-"), `^(\d{12}|\*)$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_event_permission_invalid_statement_id_test.go b/rules/models/aws_cloudwatch_event_permission_invalid_statement_id_test.go index d238c380..ae355ea9 100644 --- a/rules/models/aws_cloudwatch_event_permission_invalid_statement_id_test.go +++ b/rules/models/aws_cloudwatch_event_permission_invalid_statement_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_event_permission" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchEventPermissionInvalidStatementIDRule(), - Message: `"Organization Access" does not match valid pattern ^[a-zA-Z0-9-_]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("Organization Access"), `^[a-zA-Z0-9-_]+$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_event_rule_invalid_name_test.go b/rules/models/aws_cloudwatch_event_rule_invalid_name_test.go index 8c6f22eb..2138a015 100644 --- a/rules/models/aws_cloudwatch_event_rule_invalid_name_test.go +++ b/rules/models/aws_cloudwatch_event_rule_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_event_rule" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchEventRuleInvalidNameRule(), - Message: `"capture aws sign in" does not match valid pattern ^[\.\-_A-Za-z0-9]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("capture aws sign in"), `^[\.\-_A-Za-z0-9]+$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_event_target_invalid_target_id_test.go b/rules/models/aws_cloudwatch_event_target_invalid_target_id_test.go index e03d3018..9fb1b1c5 100644 --- a/rules/models/aws_cloudwatch_event_target_invalid_target_id_test.go +++ b/rules/models/aws_cloudwatch_event_target_invalid_target_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_event_target" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchEventTargetInvalidTargetIDRule(), - Message: `"run scheduled task every hour" does not match valid pattern ^[\.\-_A-Za-z0-9]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("run scheduled task every hour"), `^[\.\-_A-Za-z0-9]+$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_log_destination_invalid_name_test.go b/rules/models/aws_cloudwatch_log_destination_invalid_name_test.go index 00481d0d..c0e12aea 100644 --- a/rules/models/aws_cloudwatch_log_destination_invalid_name_test.go +++ b/rules/models/aws_cloudwatch_log_destination_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_log_destination" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchLogDestinationInvalidNameRule(), - Message: `"test:destination" does not match valid pattern ^[^:*]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("test:destination"), `^[^:*]*$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_log_group_invalid_name_test.go b/rules/models/aws_cloudwatch_log_group_invalid_name_test.go index 6e93bc36..2d827a0b 100644 --- a/rules/models/aws_cloudwatch_log_group_invalid_name_test.go +++ b/rules/models/aws_cloudwatch_log_group_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_log_group" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchLogGroupInvalidNameRule(), - Message: `"Yoda:prod" does not match valid pattern ^[\.\-_/#A-Za-z0-9]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("Yoda:prod"), `^[\.\-_/#A-Za-z0-9]+$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_log_metric_filter_invalid_name_test.go b/rules/models/aws_cloudwatch_log_metric_filter_invalid_name_test.go index e3134464..32369f62 100644 --- a/rules/models/aws_cloudwatch_log_metric_filter_invalid_name_test.go +++ b/rules/models/aws_cloudwatch_log_metric_filter_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_log_metric_filter" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchLogMetricFilterInvalidNameRule(), - Message: `"MyAppAccessCount:prod" does not match valid pattern ^[^:*]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("MyAppAccessCount:prod"), `^[^:*]*$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_log_stream_invalid_name_test.go b/rules/models/aws_cloudwatch_log_stream_invalid_name_test.go index 4e381a0d..55658710 100644 --- a/rules/models/aws_cloudwatch_log_stream_invalid_name_test.go +++ b/rules/models/aws_cloudwatch_log_stream_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_log_stream" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchLogStreamInvalidNameRule(), - Message: `"Yoda:prod" does not match valid pattern ^[^:*]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("Yoda:prod"), `^[^:*]*$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_log_subscription_filter_invalid_distribution_test.go b/rules/models/aws_cloudwatch_log_subscription_filter_invalid_distribution_test.go index 7e80a55a..b9cd6391 100644 --- a/rules/models/aws_cloudwatch_log_subscription_filter_invalid_distribution_test.go +++ b/rules/models/aws_cloudwatch_log_subscription_filter_invalid_distribution_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_log_subscription_filter" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchLogSubscriptionFilterInvalidDistributionRule(), - Message: `"LogStream" is an invalid value as distribution`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("LogStream"), "distribution"), }, }, }, diff --git a/rules/models/aws_cloudwatch_log_subscription_filter_invalid_name_test.go b/rules/models/aws_cloudwatch_log_subscription_filter_invalid_name_test.go index d466a2c3..13c82e2b 100644 --- a/rules/models/aws_cloudwatch_log_subscription_filter_invalid_name_test.go +++ b/rules/models/aws_cloudwatch_log_subscription_filter_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_log_subscription_filter" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchLogSubscriptionFilterInvalidNameRule(), - Message: `"test_lambdafunction_logfilter:test" does not match valid pattern ^[^:*]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("test_lambdafunction_logfilter:test"), `^[^:*]*$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_metric_alarm_invalid_comparison_operator_test.go b/rules/models/aws_cloudwatch_metric_alarm_invalid_comparison_operator_test.go index 34f82b61..dbccba54 100644 --- a/rules/models/aws_cloudwatch_metric_alarm_invalid_comparison_operator_test.go +++ b/rules/models/aws_cloudwatch_metric_alarm_invalid_comparison_operator_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_metric_alarm" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchMetricAlarmInvalidComparisonOperatorRule(), - Message: `"GreaterThanOrEqual" is an invalid value as comparison_operator`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("GreaterThanOrEqual"), "comparison_operator"), }, }, }, diff --git a/rules/models/aws_cloudwatch_metric_alarm_invalid_namespace_test.go b/rules/models/aws_cloudwatch_metric_alarm_invalid_namespace_test.go index b34621b5..eefd5fe6 100644 --- a/rules/models/aws_cloudwatch_metric_alarm_invalid_namespace_test.go +++ b/rules/models/aws_cloudwatch_metric_alarm_invalid_namespace_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_metric_alarm" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchMetricAlarmInvalidNamespaceRule(), - Message: `":EC2" does not match valid pattern ^[^:].*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(":EC2"), `^[^:].*$`), }, }, }, diff --git a/rules/models/aws_cloudwatch_metric_alarm_invalid_statistic_test.go b/rules/models/aws_cloudwatch_metric_alarm_invalid_statistic_test.go index 837415d3..68f5af01 100644 --- a/rules/models/aws_cloudwatch_metric_alarm_invalid_statistic_test.go +++ b/rules/models/aws_cloudwatch_metric_alarm_invalid_statistic_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_metric_alarm" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchMetricAlarmInvalidStatisticRule(), - Message: `"Median" is an invalid value as statistic`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("Median"), "statistic"), }, }, }, diff --git a/rules/models/aws_cloudwatch_metric_alarm_invalid_unit_test.go b/rules/models/aws_cloudwatch_metric_alarm_invalid_unit_test.go index deef5acd..27c2b987 100644 --- a/rules/models/aws_cloudwatch_metric_alarm_invalid_unit_test.go +++ b/rules/models/aws_cloudwatch_metric_alarm_invalid_unit_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cloudwatch_metric_alarm" "foo" { Expected: helper.Issues{ { Rule: NewAwsCloudwatchMetricAlarmInvalidUnitRule(), - Message: `"GB" is an invalid value as unit`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("GB"), "unit"), }, }, }, diff --git a/rules/models/aws_codecommit_repository_invalid_repository_name_test.go b/rules/models/aws_codecommit_repository_invalid_repository_name_test.go index 0e6baf68..8f5da8c9 100644 --- a/rules/models/aws_codecommit_repository_invalid_repository_name_test.go +++ b/rules/models/aws_codecommit_repository_invalid_repository_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_codecommit_repository" "foo" { Expected: helper.Issues{ { Rule: NewAwsCodecommitRepositoryInvalidRepositoryNameRule(), - Message: `"mytest@repository" does not match valid pattern ^[\w\.-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("mytest@repository"), `^[\w\.-]+$`), }, }, }, diff --git a/rules/models/aws_codedeploy_app_invalid_compute_platform_test.go b/rules/models/aws_codedeploy_app_invalid_compute_platform_test.go index 3a9e5f48..1a9f33b9 100644 --- a/rules/models/aws_codedeploy_app_invalid_compute_platform_test.go +++ b/rules/models/aws_codedeploy_app_invalid_compute_platform_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_codedeploy_app" "foo" { Expected: helper.Issues{ { Rule: NewAwsCodedeployAppInvalidComputePlatformRule(), - Message: `"Fargate" is an invalid value as compute_platform`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("Fargate"), "compute_platform"), }, }, }, diff --git a/rules/models/aws_codepipeline_invalid_name_test.go b/rules/models/aws_codepipeline_invalid_name_test.go index dac450bc..517b921c 100644 --- a/rules/models/aws_codepipeline_invalid_name_test.go +++ b/rules/models/aws_codepipeline_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_codepipeline" "foo" { Expected: helper.Issues{ { Rule: NewAwsCodepipelineInvalidNameRule(), - Message: `"test/pipeline" does not match valid pattern ^[A-Za-z0-9.@\-_]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("test/pipeline"), `^[A-Za-z0-9.@\-_]+$`), }, }, }, diff --git a/rules/models/aws_codepipeline_invalid_role_arn_test.go b/rules/models/aws_codepipeline_invalid_role_arn_test.go index de357049..b97d0695 100644 --- a/rules/models/aws_codepipeline_invalid_role_arn_test.go +++ b/rules/models/aws_codepipeline_invalid_role_arn_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_codepipeline" "foo" { Expected: helper.Issues{ { Rule: NewAwsCodepipelineInvalidRoleArnRule(), - Message: `"arn:aws:iam::123456789012:instance-profile/s3access-profile" does not match valid pattern ^arn:aws(-[\w]+)*:iam::[0-9]{12}:role/.*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("arn:aws:iam::123456789012:instance-profile/s3access-profile"), `^arn:aws(-[\w]+)*:iam::[0-9]{12}:role/.*$`), }, }, }, diff --git a/rules/models/aws_codepipeline_webhook_invalid_authentication_test.go b/rules/models/aws_codepipeline_webhook_invalid_authentication_test.go index f9178577..2c19e23f 100644 --- a/rules/models/aws_codepipeline_webhook_invalid_authentication_test.go +++ b/rules/models/aws_codepipeline_webhook_invalid_authentication_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_codepipeline_webhook" "foo" { Expected: helper.Issues{ { Rule: NewAwsCodepipelineWebhookInvalidAuthenticationRule(), - Message: `"GITLAB_HMAC" is an invalid value as authentication`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("GITLAB_HMAC"), "authentication"), }, }, }, diff --git a/rules/models/aws_codepipeline_webhook_invalid_name_test.go b/rules/models/aws_codepipeline_webhook_invalid_name_test.go index f0822384..64f4a2dd 100644 --- a/rules/models/aws_codepipeline_webhook_invalid_name_test.go +++ b/rules/models/aws_codepipeline_webhook_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_codepipeline_webhook" "foo" { Expected: helper.Issues{ { Rule: NewAwsCodepipelineWebhookInvalidNameRule(), - Message: `"webhook-github-bar/testing" does not match valid pattern ^[A-Za-z0-9.@\-_]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("webhook-github-bar/testing"), `^[A-Za-z0-9.@\-_]+$`), }, }, }, diff --git a/rules/models/aws_codepipeline_webhook_invalid_target_action_test.go b/rules/models/aws_codepipeline_webhook_invalid_target_action_test.go index c9020f27..fdcffcb0 100644 --- a/rules/models/aws_codepipeline_webhook_invalid_target_action_test.go +++ b/rules/models/aws_codepipeline_webhook_invalid_target_action_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_codepipeline_webhook" "foo" { Expected: helper.Issues{ { Rule: NewAwsCodepipelineWebhookInvalidTargetActionRule(), - Message: `"Source/Example" does not match valid pattern ^[A-Za-z0-9.@\-_]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("Source/Example"), `^[A-Za-z0-9.@\-_]+$`), }, }, }, diff --git a/rules/models/aws_cognito_identity_pool_invalid_identity_pool_name_test.go b/rules/models/aws_cognito_identity_pool_invalid_identity_pool_name_test.go index 87cb030c..97f19b4d 100644 --- a/rules/models/aws_cognito_identity_pool_invalid_identity_pool_name_test.go +++ b/rules/models/aws_cognito_identity_pool_invalid_identity_pool_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_identity_pool" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoIdentityPoolInvalidIdentityPoolNameRule(), - Message: `"identity:pool" does not match valid pattern ^[\w\s+=,.@-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("identity:pool"), `^[\w\s+=,.@-]+$`), }, }, }, diff --git a/rules/models/aws_cognito_identity_pool_roles_attachment_invalid_identity_pool_id_test.go b/rules/models/aws_cognito_identity_pool_roles_attachment_invalid_identity_pool_id_test.go index da516416..b15d65c1 100644 --- a/rules/models/aws_cognito_identity_pool_roles_attachment_invalid_identity_pool_id_test.go +++ b/rules/models/aws_cognito_identity_pool_roles_attachment_invalid_identity_pool_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_identity_pool_roles_attachment" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoIdentityPoolRolesAttachmentInvalidIdentityPoolIDRule(), - Message: `"0123456789" does not match valid pattern ^[\w-]+:[0-9a-f-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("0123456789"), `^[\w-]+:[0-9a-f-]+$`), }, }, }, diff --git a/rules/models/aws_cognito_identity_provider_invalid_provider_name_test.go b/rules/models/aws_cognito_identity_provider_invalid_provider_name_test.go index 32f249ff..dbd92188 100644 --- a/rules/models/aws_cognito_identity_provider_invalid_provider_name_test.go +++ b/rules/models/aws_cognito_identity_provider_invalid_provider_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_identity_provider" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoIdentityProviderInvalidProviderNameRule(), - Message: `" " does not match valid pattern ^[\p{L}\p{M}\p{S}\p{N}\p{P}]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(" "), `^[\p{L}\p{M}\p{S}\p{N}\p{P}]+$`), }, }, }, diff --git a/rules/models/aws_cognito_identity_provider_invalid_provider_type_test.go b/rules/models/aws_cognito_identity_provider_invalid_provider_type_test.go index facc3ee2..9fc1bc56 100644 --- a/rules/models/aws_cognito_identity_provider_invalid_provider_type_test.go +++ b/rules/models/aws_cognito_identity_provider_invalid_provider_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_identity_provider" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoIdentityProviderInvalidProviderTypeRule(), - Message: `"Apple" is an invalid value as provider_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("Apple"), "provider_type"), }, }, }, diff --git a/rules/models/aws_cognito_identity_provider_invalid_user_pool_id_test.go b/rules/models/aws_cognito_identity_provider_invalid_user_pool_id_test.go index 080d7d08..e67e681d 100644 --- a/rules/models/aws_cognito_identity_provider_invalid_user_pool_id_test.go +++ b/rules/models/aws_cognito_identity_provider_invalid_user_pool_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_identity_provider" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoIdentityProviderInvalidUserPoolIDRule(), - Message: `"foobar" does not match valid pattern ^[\w-]+_[0-9a-zA-Z]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("foobar"), `^[\w-]+_[0-9a-zA-Z]+$`), }, }, }, diff --git a/rules/models/aws_cognito_resource_server_invalid_identifier_test.go b/rules/models/aws_cognito_resource_server_invalid_identifier_test.go index e7353f47..4385d5b2 100644 --- a/rules/models/aws_cognito_resource_server_invalid_identifier_test.go +++ b/rules/models/aws_cognito_resource_server_invalid_identifier_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_resource_server" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoResourceServerInvalidIdentifierRule(), - Message: `" " does not match valid pattern ^[\x21\x23-\x5B\x5D-\x7E]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage(" "), `^[\x21\x23-\x5B\x5D-\x7E]+$`), }, }, }, diff --git a/rules/models/aws_cognito_resource_server_invalid_name_test.go b/rules/models/aws_cognito_resource_server_invalid_name_test.go index 286209dc..50cdccf5 100644 --- a/rules/models/aws_cognito_resource_server_invalid_name_test.go +++ b/rules/models/aws_cognito_resource_server_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_resource_server" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoResourceServerInvalidNameRule(), - Message: `"example/server" does not match valid pattern ^[\w\s+=,.@-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("example/server"), `^[\w\s+=,.@-]+$`), }, }, }, diff --git a/rules/models/aws_cognito_user_group_invalid_name_test.go b/rules/models/aws_cognito_user_group_invalid_name_test.go index 9186cb2f..9bf0c351 100644 --- a/rules/models/aws_cognito_user_group_invalid_name_test.go +++ b/rules/models/aws_cognito_user_group_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_user_group" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoUserGroupInvalidNameRule(), - Message: `"user group" does not match valid pattern ^[\p{L}\p{M}\p{S}\p{N}\p{P}]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("user group"), `^[\p{L}\p{M}\p{S}\p{N}\p{P}]+$`), }, }, }, diff --git a/rules/models/aws_cognito_user_group_invalid_role_arn_test.go b/rules/models/aws_cognito_user_group_invalid_role_arn_test.go index 04664b52..f8db776c 100644 --- a/rules/models/aws_cognito_user_group_invalid_role_arn_test.go +++ b/rules/models/aws_cognito_user_group_invalid_role_arn_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_user_group" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoUserGroupInvalidRoleArnRule(), - Message: `"aws:iam::123456789012:instance-profile/s3access-profile" does not match valid pattern ^arn:[\w+=/,.@-]+:[\w+=/,.@-]+:([\w+=/,.@-]*)?:[0-9]+:[\w+=/,.@-]+(:[\w+=/,.@-]+)?(:[\w+=/,.@-]+)?$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("aws:iam::123456789012:instance-profile/s3access-profile"), `^arn:[\w+=/,.@-]+:[\w+=/,.@-]+:([\w+=/,.@-]*)?:[0-9]+:[\w+=/,.@-]+(:[\w+=/,.@-]+)?(:[\w+=/,.@-]+)?$`), }, }, }, diff --git a/rules/models/aws_cognito_user_pool_client_invalid_default_redirect_uri_test.go b/rules/models/aws_cognito_user_pool_client_invalid_default_redirect_uri_test.go index 80fa4239..794da275 100644 --- a/rules/models/aws_cognito_user_pool_client_invalid_default_redirect_uri_test.go +++ b/rules/models/aws_cognito_user_pool_client_invalid_default_redirect_uri_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_user_pool_client" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoUserPoolClientInvalidDefaultRedirectURIRule(), - Message: `"https://example com" does not match valid pattern ^[\p{L}\p{M}\p{S}\p{N}\p{P}]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("https://example com"), `^[\p{L}\p{M}\p{S}\p{N}\p{P}]+$`), }, }, }, diff --git a/rules/models/aws_cognito_user_pool_client_invalid_name_test.go b/rules/models/aws_cognito_user_pool_client_invalid_name_test.go index 39d03338..b5ba4132 100644 --- a/rules/models/aws_cognito_user_pool_client_invalid_name_test.go +++ b/rules/models/aws_cognito_user_pool_client_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_user_pool_client" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoUserPoolClientInvalidNameRule(), - Message: `"client/example" does not match valid pattern ^[\w\s+=,.@-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("client/example"), `^[\w\s+=,.@-]+$`), }, }, }, diff --git a/rules/models/aws_cognito_user_pool_invalid_email_verification_message_test.go b/rules/models/aws_cognito_user_pool_invalid_email_verification_message_test.go index 8facaa26..4b73ad92 100644 --- a/rules/models/aws_cognito_user_pool_invalid_email_verification_message_test.go +++ b/rules/models/aws_cognito_user_pool_invalid_email_verification_message_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_user_pool" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoUserPoolInvalidEmailVerificationMessageRule(), - Message: `"Verification code" does not match valid pattern ^[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*\{####\}[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("Verification code"), `^[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*\{####\}[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*$`), }, }, }, diff --git a/rules/models/aws_cognito_user_pool_invalid_mfa_configuration_test.go b/rules/models/aws_cognito_user_pool_invalid_mfa_configuration_test.go index d1eb52fd..deb9a50a 100644 --- a/rules/models/aws_cognito_user_pool_invalid_mfa_configuration_test.go +++ b/rules/models/aws_cognito_user_pool_invalid_mfa_configuration_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_user_pool" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoUserPoolInvalidMfaConfigurationRule(), - Message: `"IN" is an invalid value as mfa_configuration`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("IN"), "mfa_configuration"), }, }, }, diff --git a/rules/models/aws_cognito_user_pool_invalid_name_test.go b/rules/models/aws_cognito_user_pool_invalid_name_test.go index c998d45e..8a5b2793 100644 --- a/rules/models/aws_cognito_user_pool_invalid_name_test.go +++ b/rules/models/aws_cognito_user_pool_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_user_pool" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoUserPoolInvalidNameRule(), - Message: `"my/pool" does not match valid pattern ^[\w\s+=,.@-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("my/pool"), `^[\w\s+=,.@-]+$`), }, }, }, diff --git a/rules/models/aws_cognito_user_pool_invalid_sms_authentication_message_test.go b/rules/models/aws_cognito_user_pool_invalid_sms_authentication_message_test.go index 6e1c89b0..83f53b48 100644 --- a/rules/models/aws_cognito_user_pool_invalid_sms_authentication_message_test.go +++ b/rules/models/aws_cognito_user_pool_invalid_sms_authentication_message_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_user_pool" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoUserPoolInvalidSmsAuthenticationMessageRule(), - Message: `"Authentication code" does not match valid pattern ^.*\{####\}.*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("Authentication code"), `^.*\{####\}.*$`), }, }, }, diff --git a/rules/models/aws_cognito_user_pool_invalid_sms_verification_message_test.go b/rules/models/aws_cognito_user_pool_invalid_sms_verification_message_test.go index 00e625d5..97fb8346 100644 --- a/rules/models/aws_cognito_user_pool_invalid_sms_verification_message_test.go +++ b/rules/models/aws_cognito_user_pool_invalid_sms_verification_message_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cognito_user_pool" "foo" { Expected: helper.Issues{ { Rule: NewAwsCognitoUserPoolInvalidSmsVerificationMessageRule(), - Message: `"Verification code" does not match valid pattern ^.*\{####\}.*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("Verification code"), `^.*\{####\}.*$`), }, }, }, diff --git a/rules/models/aws_config_aggregate_authorization_invalid_account_id_test.go b/rules/models/aws_config_aggregate_authorization_invalid_account_id_test.go index 732b2987..68fb8c47 100644 --- a/rules/models/aws_config_aggregate_authorization_invalid_account_id_test.go +++ b/rules/models/aws_config_aggregate_authorization_invalid_account_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_config_aggregate_authorization" "foo" { Expected: helper.Issues{ { Rule: NewAwsConfigAggregateAuthorizationInvalidAccountIDRule(), - Message: `"01234567891" does not match valid pattern ^\d{12}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("01234567891"), `^\d{12}$`), }, }, }, diff --git a/rules/models/aws_config_config_rule_invalid_maximum_execution_frequency_test.go b/rules/models/aws_config_config_rule_invalid_maximum_execution_frequency_test.go index f7a39b79..2eae5861 100644 --- a/rules/models/aws_config_config_rule_invalid_maximum_execution_frequency_test.go +++ b/rules/models/aws_config_config_rule_invalid_maximum_execution_frequency_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_config_config_rule" "foo" { Expected: helper.Issues{ { Rule: NewAwsConfigConfigRuleInvalidMaximumExecutionFrequencyRule(), - Message: `"Hour" is an invalid value as maximum_execution_frequency`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("Hour"), "maximum_execution_frequency"), }, }, }, diff --git a/rules/models/aws_config_configuration_aggregator_invalid_name_test.go b/rules/models/aws_config_configuration_aggregator_invalid_name_test.go index e0b0ae3a..db6e1433 100644 --- a/rules/models/aws_config_configuration_aggregator_invalid_name_test.go +++ b/rules/models/aws_config_configuration_aggregator_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_config_configuration_aggregator" "foo" { Expected: helper.Issues{ { Rule: NewAwsConfigConfigurationAggregatorInvalidNameRule(), - Message: `"example.com" does not match valid pattern ^[\w\-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("example.com"), `^[\w\-]+$`), }, }, }, diff --git a/rules/models/aws_cur_report_definition_invalid_compression_test.go b/rules/models/aws_cur_report_definition_invalid_compression_test.go index 67b5d6f1..10669bb4 100644 --- a/rules/models/aws_cur_report_definition_invalid_compression_test.go +++ b/rules/models/aws_cur_report_definition_invalid_compression_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cur_report_definition" "foo" { Expected: helper.Issues{ { Rule: NewAwsCurReportDefinitionInvalidCompressionRule(), - Message: `"TAR" is an invalid value as compression`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("TAR"), "compression"), }, }, }, diff --git a/rules/models/aws_cur_report_definition_invalid_format_test.go b/rules/models/aws_cur_report_definition_invalid_format_test.go index cb1d1944..a08c81c5 100644 --- a/rules/models/aws_cur_report_definition_invalid_format_test.go +++ b/rules/models/aws_cur_report_definition_invalid_format_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cur_report_definition" "foo" { Expected: helper.Issues{ { Rule: NewAwsCurReportDefinitionInvalidFormatRule(), - Message: `"textORjson" is an invalid value as format`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("textORjson"), "format"), }, }, }, diff --git a/rules/models/aws_cur_report_definition_invalid_report_name_test.go b/rules/models/aws_cur_report_definition_invalid_report_name_test.go index 227aad0a..b9ff11a0 100644 --- a/rules/models/aws_cur_report_definition_invalid_report_name_test.go +++ b/rules/models/aws_cur_report_definition_invalid_report_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cur_report_definition" "foo" { Expected: helper.Issues{ { Rule: NewAwsCurReportDefinitionInvalidReportNameRule(), - Message: `"example/cur-report-definition" does not match valid pattern ^[0-9A-Za-z!\-_.*\'()]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("example/cur-report-definition"), `^[0-9A-Za-z!\-_.*\'()]+$`), }, }, }, diff --git a/rules/models/aws_cur_report_definition_invalid_s3_region_test.go b/rules/models/aws_cur_report_definition_invalid_s3_region_test.go index 98f022e1..52967f75 100644 --- a/rules/models/aws_cur_report_definition_invalid_s3_region_test.go +++ b/rules/models/aws_cur_report_definition_invalid_s3_region_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cur_report_definition" "foo" { Expected: helper.Issues{ { Rule: NewAwsCurReportDefinitionInvalidS3RegionRule(), - Message: `"us-gov-east-1" is an invalid value as s3_region`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("us-gov-east-1"), "s3_region"), }, }, }, diff --git a/rules/models/aws_cur_report_definition_invalid_time_unit_test.go b/rules/models/aws_cur_report_definition_invalid_time_unit_test.go index bb83e8b1..3dab5496 100644 --- a/rules/models/aws_cur_report_definition_invalid_time_unit_test.go +++ b/rules/models/aws_cur_report_definition_invalid_time_unit_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_cur_report_definition" "foo" { Expected: helper.Issues{ { Rule: NewAwsCurReportDefinitionInvalidTimeUnitRule(), - Message: `"FORNIGHTLY" is an invalid value as time_unit`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("FORNIGHTLY"), "time_unit"), }, }, }, diff --git a/rules/models/aws_datasync_agent_invalid_activation_key_test.go b/rules/models/aws_datasync_agent_invalid_activation_key_test.go index 3b5a8cc2..6b9ae123 100644 --- a/rules/models/aws_datasync_agent_invalid_activation_key_test.go +++ b/rules/models/aws_datasync_agent_invalid_activation_key_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_datasync_agent" "foo" { Expected: helper.Issues{ { Rule: NewAwsDatasyncAgentInvalidActivationKeyRule(), - Message: `"F0EFT7FPPRGG7MC3I9R327DOH" does not match valid pattern ^[A-Z0-9]{5}(-[A-Z0-9]{5}){4}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("F0EFT7FPPRGG7MC3I9R327DOH"), `^[A-Z0-9]{5}(-[A-Z0-9]{5}){4}$`), }, }, }, diff --git a/rules/models/aws_datasync_agent_invalid_name_test.go b/rules/models/aws_datasync_agent_invalid_name_test.go index 6a94ad57..be20cde4 100644 --- a/rules/models/aws_datasync_agent_invalid_name_test.go +++ b/rules/models/aws_datasync_agent_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_datasync_agent" "foo" { Expected: helper.Issues{ { Rule: NewAwsDatasyncAgentInvalidNameRule(), - Message: `"example^example" does not match valid pattern ^[a-zA-Z0-9\s+=._:@/-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("example^example"), `^[a-zA-Z0-9\s+=._:@/-]+$`), }, }, }, diff --git a/rules/models/aws_datasync_location_efs_invalid_efs_file_system_arn_test.go b/rules/models/aws_datasync_location_efs_invalid_efs_file_system_arn_test.go index 71e81ada..c9b013e1 100644 --- a/rules/models/aws_datasync_location_efs_invalid_efs_file_system_arn_test.go +++ b/rules/models/aws_datasync_location_efs_invalid_efs_file_system_arn_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_datasync_location_efs" "foo" { Expected: helper.Issues{ { Rule: NewAwsDatasyncLocationEfsInvalidEfsFileSystemArnRule(), - Message: `"arn:aws:eks:us-east-1:123456789012:cluster/my-cluster" does not match valid pattern ^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):elasticfilesystem:[a-z\-0-9]*:[0-9]{12}:file-system/fs-.*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("arn:aws:eks:us-east-1:123456789012:cluster/my-cluster"), `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):elasticfilesystem:[a-z\-0-9]*:[0-9]{12}:file-system/fs-.*$`), }, }, }, diff --git a/rules/models/aws_datasync_location_efs_invalid_subdirectory_test.go b/rules/models/aws_datasync_location_efs_invalid_subdirectory_test.go index 059bfb38..7a5af2b1 100644 --- a/rules/models/aws_datasync_location_efs_invalid_subdirectory_test.go +++ b/rules/models/aws_datasync_location_efs_invalid_subdirectory_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_datasync_location_efs" "foo" { Expected: helper.Issues{ { Rule: NewAwsDatasyncLocationEfsInvalidSubdirectoryRule(), - Message: `"bar " does not match valid pattern ^[a-zA-Z0-9_\-\+\./\(\)\p{Zs}]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("bar "), `^[a-zA-Z0-9_\-\+\./\(\)\p{Zs}]*$`), }, }, }, diff --git a/rules/models/aws_datasync_location_nfs_invalid_server_hostname_test.go b/rules/models/aws_datasync_location_nfs_invalid_server_hostname_test.go index 26024c06..b3420a7e 100644 --- a/rules/models/aws_datasync_location_nfs_invalid_server_hostname_test.go +++ b/rules/models/aws_datasync_location_nfs_invalid_server_hostname_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_datasync_location_nfs" "foo" { Expected: helper.Issues{ { Rule: NewAwsDatasyncLocationNfsInvalidServerHostnameRule(), - Message: `"nfs^example^com" does not match valid pattern ^(([a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9\-]*[A-Za-z0-9])$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("nfs^example^com"), `^(([a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9\-]*[A-Za-z0-9])$`), }, }, }, diff --git a/rules/models/aws_datasync_location_nfs_invalid_subdirectory_test.go b/rules/models/aws_datasync_location_nfs_invalid_subdirectory_test.go index 82bfdbdb..70589805 100644 --- a/rules/models/aws_datasync_location_nfs_invalid_subdirectory_test.go +++ b/rules/models/aws_datasync_location_nfs_invalid_subdirectory_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_datasync_location_nfs" "foo" { Expected: helper.Issues{ { Rule: NewAwsDatasyncLocationNfsInvalidSubdirectoryRule(), - Message: `"/exported^path" does not match valid pattern ^[a-zA-Z0-9_\-\+\./\(\)\p{Zs}]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("/exported^path"), `^[a-zA-Z0-9_\-\+\./\(\)\p{Zs}]*$`), }, }, }, diff --git a/rules/models/aws_datasync_location_s3_invalid_s3_bucket_arn_test.go b/rules/models/aws_datasync_location_s3_invalid_s3_bucket_arn_test.go index d8a78cc3..654d4073 100644 --- a/rules/models/aws_datasync_location_s3_invalid_s3_bucket_arn_test.go +++ b/rules/models/aws_datasync_location_s3_invalid_s3_bucket_arn_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_datasync_location_s3" "foo" { Expected: helper.Issues{ { Rule: NewAwsDatasyncLocationS3InvalidS3BucketArnRule(), - Message: `"arn:aws:eks:us-east-1:123456789012:cluster/my-cluster" does not match valid pattern ^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):(s3|s3-outposts):[a-z\-0-9]*:[0-9]*:.*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("arn:aws:eks:us-east-1:123456789012:cluster/my-cluster"), `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):(s3|s3-outposts):[a-z\-0-9]*:[0-9]*:.*$`), }, }, }, diff --git a/rules/models/aws_datasync_task_invalid_cloudwatch_log_group_arn_test.go b/rules/models/aws_datasync_task_invalid_cloudwatch_log_group_arn_test.go index 6954e60f..5d172434 100644 --- a/rules/models/aws_datasync_task_invalid_cloudwatch_log_group_arn_test.go +++ b/rules/models/aws_datasync_task_invalid_cloudwatch_log_group_arn_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_datasync_task" "foo" { Expected: helper.Issues{ { Rule: NewAwsDatasyncTaskInvalidCloudwatchLogGroupArnRule(), - Message: `"arn:aws:s3:::my_corporate_bucket" does not match valid pattern ^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\-0-9]*:[0-9]{12}:log-group:([^:\*]*)(:\*)?$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("arn:aws:s3:::my_corporate_bucket"), `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\-0-9]*:[0-9]{12}:log-group:([^:\*]*)(:\*)?$`), }, }, }, diff --git a/rules/models/aws_datasync_task_invalid_source_location_arn_test.go b/rules/models/aws_datasync_task_invalid_source_location_arn_test.go index 13cc4ce5..d8cfe08d 100644 --- a/rules/models/aws_datasync_task_invalid_source_location_arn_test.go +++ b/rules/models/aws_datasync_task_invalid_source_location_arn_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_datasync_task" "foo" { Expected: helper.Issues{ { Rule: NewAwsDatasyncTaskInvalidSourceLocationArnRule(), - Message: `"arn:aws:datasync:us-east-2:111222333444:task/task-08de6e6697796f026" does not match valid pattern ^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("arn:aws:datasync:us-east-2:111222333444:task/task-08de6e6697796f026"), `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$`), }, }, }, diff --git a/rules/models/aws_directory_service_conditional_forwarder_invalid_directory_id_test.go b/rules/models/aws_directory_service_conditional_forwarder_invalid_directory_id_test.go index fddc825b..8be07917 100644 --- a/rules/models/aws_directory_service_conditional_forwarder_invalid_directory_id_test.go +++ b/rules/models/aws_directory_service_conditional_forwarder_invalid_directory_id_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_directory_service_conditional_forwarder" "foo" { Expected: helper.Issues{ { Rule: NewAwsDirectoryServiceConditionalForwarderInvalidDirectoryIDRule(), - Message: `"1234567890" does not match valid pattern ^d-[0-9a-f]{10}$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("1234567890"), `^d-[0-9a-f]{10}$`), }, }, }, diff --git a/rules/models/aws_directory_service_conditional_forwarder_invalid_remote_domain_name_test.go b/rules/models/aws_directory_service_conditional_forwarder_invalid_remote_domain_name_test.go index 27bbd164..db6a9324 100644 --- a/rules/models/aws_directory_service_conditional_forwarder_invalid_remote_domain_name_test.go +++ b/rules/models/aws_directory_service_conditional_forwarder_invalid_remote_domain_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_directory_service_conditional_forwarder" "foo" { Expected: helper.Issues{ { Rule: NewAwsDirectoryServiceConditionalForwarderInvalidRemoteDomainNameRule(), - Message: `"example^com" does not match valid pattern ^([a-zA-Z0-9]+[\\.-])+([a-zA-Z0-9])+[.]?$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("example^com"), `^([a-zA-Z0-9]+[\\.-])+([a-zA-Z0-9])+[.]?$`), }, }, }, diff --git a/rules/models/aws_directory_service_directory_invalid_description_test.go b/rules/models/aws_directory_service_directory_invalid_description_test.go index b11d4365..66c151d8 100644 --- a/rules/models/aws_directory_service_directory_invalid_description_test.go +++ b/rules/models/aws_directory_service_directory_invalid_description_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_directory_service_directory" "foo" { Expected: helper.Issues{ { Rule: NewAwsDirectoryServiceDirectoryInvalidDescriptionRule(), - Message: `"@example" does not match valid pattern ^([a-zA-Z0-9_])[\\a-zA-Z0-9_@#%*+=:?./!\s-]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("@example"), `^([a-zA-Z0-9_])[\\a-zA-Z0-9_@#%*+=:?./!\s-]*$`), }, }, }, diff --git a/rules/models/aws_directory_service_directory_invalid_edition_test.go b/rules/models/aws_directory_service_directory_invalid_edition_test.go index 911a8879..964dee74 100644 --- a/rules/models/aws_directory_service_directory_invalid_edition_test.go +++ b/rules/models/aws_directory_service_directory_invalid_edition_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_directory_service_directory" "foo" { Expected: helper.Issues{ { Rule: NewAwsDirectoryServiceDirectoryInvalidEditionRule(), - Message: `"Free" is an invalid value as edition`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("Free"), "edition"), }, }, }, diff --git a/rules/models/aws_directory_service_directory_invalid_name_test.go b/rules/models/aws_directory_service_directory_invalid_name_test.go index 8f4a8aeb..1f6dca0a 100644 --- a/rules/models/aws_directory_service_directory_invalid_name_test.go +++ b/rules/models/aws_directory_service_directory_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_directory_service_directory" "foo" { Expected: helper.Issues{ { Rule: NewAwsDirectoryServiceDirectoryInvalidNameRule(), - Message: `"@example.com" does not match valid pattern ^([a-zA-Z0-9]+[\\.-])+([a-zA-Z0-9])+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("@example.com"), `^([a-zA-Z0-9]+[\\.-])+([a-zA-Z0-9])+$`), }, }, }, diff --git a/rules/models/aws_directory_service_directory_invalid_short_name_test.go b/rules/models/aws_directory_service_directory_invalid_short_name_test.go index c2adc1c4..3e10f840 100644 --- a/rules/models/aws_directory_service_directory_invalid_short_name_test.go +++ b/rules/models/aws_directory_service_directory_invalid_short_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_directory_service_directory" "foo" { Expected: helper.Issues{ { Rule: NewAwsDirectoryServiceDirectoryInvalidShortNameRule(), - Message: `"CORP:EXAMPLE" does not match valid pattern ^[^\\/:*?"<>|.]+[^\\/:*?"<>|]*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("CORP:EXAMPLE"), `^[^\\/:*?"<>|.]+[^\\/:*?"<>|]*$`), }, }, }, diff --git a/rules/models/aws_directory_service_directory_invalid_size_test.go b/rules/models/aws_directory_service_directory_invalid_size_test.go index 80355597..3f996aba 100644 --- a/rules/models/aws_directory_service_directory_invalid_size_test.go +++ b/rules/models/aws_directory_service_directory_invalid_size_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_directory_service_directory" "foo" { Expected: helper.Issues{ { Rule: NewAwsDirectoryServiceDirectoryInvalidSizeRule(), - Message: `"Micro" is an invalid value as size`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("Micro"), "size"), }, }, }, diff --git a/rules/models/aws_directory_service_directory_invalid_type_test.go b/rules/models/aws_directory_service_directory_invalid_type_test.go index da6033fa..dd29995f 100644 --- a/rules/models/aws_directory_service_directory_invalid_type_test.go +++ b/rules/models/aws_directory_service_directory_invalid_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_directory_service_directory" "foo" { Expected: helper.Issues{ { Rule: NewAwsDirectoryServiceDirectoryInvalidTypeRule(), - Message: `"ActiveDirectory" is an invalid value as type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("ActiveDirectory"), "type"), }, }, }, diff --git a/rules/models/aws_dlm_lifecycle_policy_invalid_state_test.go b/rules/models/aws_dlm_lifecycle_policy_invalid_state_test.go index 216907a7..a8a5644d 100644 --- a/rules/models/aws_dlm_lifecycle_policy_invalid_state_test.go +++ b/rules/models/aws_dlm_lifecycle_policy_invalid_state_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_dlm_lifecycle_policy" "foo" { Expected: helper.Issues{ { Rule: NewAwsDlmLifecyclePolicyInvalidStateRule(), - Message: `"ERROR" is an invalid value as state`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("ERROR"), "state"), }, }, }, diff --git a/rules/models/aws_dms_endpoint_invalid_endpoint_type_test.go b/rules/models/aws_dms_endpoint_invalid_endpoint_type_test.go index 4445f56a..5f98ed93 100644 --- a/rules/models/aws_dms_endpoint_invalid_endpoint_type_test.go +++ b/rules/models/aws_dms_endpoint_invalid_endpoint_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_dms_endpoint" "foo" { Expected: helper.Issues{ { Rule: NewAwsDmsEndpointInvalidEndpointTypeRule(), - Message: `"resource" is an invalid value as endpoint_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("resource"), "endpoint_type"), }, }, }, diff --git a/rules/models/aws_dms_endpoint_invalid_ssl_mode_test.go b/rules/models/aws_dms_endpoint_invalid_ssl_mode_test.go index 5c2c9d73..1551a6ad 100644 --- a/rules/models/aws_dms_endpoint_invalid_ssl_mode_test.go +++ b/rules/models/aws_dms_endpoint_invalid_ssl_mode_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_dms_endpoint" "foo" { Expected: helper.Issues{ { Rule: NewAwsDmsEndpointInvalidSslModeRule(), - Message: `"verify-require" is an invalid value as ssl_mode`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("verify-require"), "ssl_mode"), }, }, }, diff --git a/rules/models/aws_dms_replication_task_invalid_migration_type_test.go b/rules/models/aws_dms_replication_task_invalid_migration_type_test.go index 1280bd03..a1eda828 100644 --- a/rules/models/aws_dms_replication_task_invalid_migration_type_test.go +++ b/rules/models/aws_dms_replication_task_invalid_migration_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_dms_replication_task" "foo" { Expected: helper.Issues{ { Rule: NewAwsDmsReplicationTaskInvalidMigrationTypeRule(), - Message: `"partial-load" is an invalid value as migration_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("partial-load"), "migration_type"), }, }, }, diff --git a/rules/models/aws_dx_bgp_peer_invalid_address_family_test.go b/rules/models/aws_dx_bgp_peer_invalid_address_family_test.go index 4e03a805..de5238d3 100644 --- a/rules/models/aws_dx_bgp_peer_invalid_address_family_test.go +++ b/rules/models/aws_dx_bgp_peer_invalid_address_family_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_dx_bgp_peer" "foo" { Expected: helper.Issues{ { Rule: NewAwsDxBgpPeerInvalidAddressFamilyRule(), - Message: `"ipv2" is an invalid value as address_family`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("ipv2"), "address_family"), }, }, }, diff --git a/rules/models/aws_dynamodb_global_table_invalid_name_test.go b/rules/models/aws_dynamodb_global_table_invalid_name_test.go index ccdb0cbf..e5b520d6 100644 --- a/rules/models/aws_dynamodb_global_table_invalid_name_test.go +++ b/rules/models/aws_dynamodb_global_table_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_dynamodb_global_table" "foo" { Expected: helper.Issues{ { Rule: NewAwsDynamoDBGlobalTableInvalidNameRule(), - Message: `"myTable@development" does not match valid pattern ^[a-zA-Z0-9_.-]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("myTable@development"), `^[a-zA-Z0-9_.-]+$`), }, }, }, diff --git a/rules/models/aws_dynamodb_table_invalid_billing_mode_test.go b/rules/models/aws_dynamodb_table_invalid_billing_mode_test.go index f70ea69b..d157c327 100644 --- a/rules/models/aws_dynamodb_table_invalid_billing_mode_test.go +++ b/rules/models/aws_dynamodb_table_invalid_billing_mode_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_dynamodb_table" "foo" { Expected: helper.Issues{ { Rule: NewAwsDynamoDBTableInvalidBillingModeRule(), - Message: `"FLEXIBLE" is an invalid value as billing_mode`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("FLEXIBLE"), "billing_mode"), }, }, }, diff --git a/rules/models/aws_ebs_volume_invalid_type_test.go b/rules/models/aws_ebs_volume_invalid_type_test.go index 26c3cdfe..81923379 100644 --- a/rules/models/aws_ebs_volume_invalid_type_test.go +++ b/rules/models/aws_ebs_volume_invalid_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ebs_volume" "foo" { Expected: helper.Issues{ { Rule: NewAwsEbsVolumeInvalidTypeRule(), - Message: `"gp1" is an invalid value as type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("gp1"), "type"), }, }, }, diff --git a/rules/models/aws_ec2_capacity_reservation_invalid_end_date_type_test.go b/rules/models/aws_ec2_capacity_reservation_invalid_end_date_type_test.go index a512c72b..a6f33a12 100644 --- a/rules/models/aws_ec2_capacity_reservation_invalid_end_date_type_test.go +++ b/rules/models/aws_ec2_capacity_reservation_invalid_end_date_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_capacity_reservation" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2CapacityReservationInvalidEndDateTypeRule(), - Message: `"unlimit" is an invalid value as end_date_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("unlimit"), "end_date_type"), }, }, }, diff --git a/rules/models/aws_ec2_capacity_reservation_invalid_instance_match_criteria_test.go b/rules/models/aws_ec2_capacity_reservation_invalid_instance_match_criteria_test.go index ada201f5..4f7158b3 100644 --- a/rules/models/aws_ec2_capacity_reservation_invalid_instance_match_criteria_test.go +++ b/rules/models/aws_ec2_capacity_reservation_invalid_instance_match_criteria_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_capacity_reservation" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2CapacityReservationInvalidInstanceMatchCriteriaRule(), - Message: `"close" is an invalid value as instance_match_criteria`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("close"), "instance_match_criteria"), }, }, }, diff --git a/rules/models/aws_ec2_capacity_reservation_invalid_instance_platform_test.go b/rules/models/aws_ec2_capacity_reservation_invalid_instance_platform_test.go index 080878ec..ef86806a 100644 --- a/rules/models/aws_ec2_capacity_reservation_invalid_instance_platform_test.go +++ b/rules/models/aws_ec2_capacity_reservation_invalid_instance_platform_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_capacity_reservation" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2CapacityReservationInvalidInstancePlatformRule(), - Message: `"Linux/GNU" is an invalid value as instance_platform`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("Linux/GNU"), "instance_platform"), }, }, }, diff --git a/rules/models/aws_ec2_capacity_reservation_invalid_tenancy_test.go b/rules/models/aws_ec2_capacity_reservation_invalid_tenancy_test.go index 57c1db30..b09b4117 100644 --- a/rules/models/aws_ec2_capacity_reservation_invalid_tenancy_test.go +++ b/rules/models/aws_ec2_capacity_reservation_invalid_tenancy_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_capacity_reservation" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2CapacityReservationInvalidTenancyRule(), - Message: `"reserved" is an invalid value as tenancy`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("reserved"), "tenancy"), }, }, }, diff --git a/rules/models/aws_ec2_client_vpn_endpoint_invalid_transport_protocol_test.go b/rules/models/aws_ec2_client_vpn_endpoint_invalid_transport_protocol_test.go index 94ab745d..b3c070e0 100644 --- a/rules/models/aws_ec2_client_vpn_endpoint_invalid_transport_protocol_test.go +++ b/rules/models/aws_ec2_client_vpn_endpoint_invalid_transport_protocol_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_client_vpn_endpoint" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2ClientVpnEndpointInvalidTransportProtocolRule(), - Message: `"http" is an invalid value as transport_protocol`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("http"), "transport_protocol"), }, }, }, diff --git a/rules/models/aws_ec2_fleet_invalid_excess_capacity_termination_policy_test.go b/rules/models/aws_ec2_fleet_invalid_excess_capacity_termination_policy_test.go index 469977f5..21caff57 100644 --- a/rules/models/aws_ec2_fleet_invalid_excess_capacity_termination_policy_test.go +++ b/rules/models/aws_ec2_fleet_invalid_excess_capacity_termination_policy_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_fleet" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2FleetInvalidExcessCapacityTerminationPolicyRule(), - Message: `"remain" is an invalid value as excess_capacity_termination_policy`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("remain"), "excess_capacity_termination_policy"), }, }, }, diff --git a/rules/models/aws_ec2_fleet_invalid_type_test.go b/rules/models/aws_ec2_fleet_invalid_type_test.go index a6f17c7d..75df6079 100644 --- a/rules/models/aws_ec2_fleet_invalid_type_test.go +++ b/rules/models/aws_ec2_fleet_invalid_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_fleet" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2FleetInvalidTypeRule(), - Message: `"remain" is an invalid value as type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("remain"), "type"), }, }, }, diff --git a/rules/models/aws_ec2_transit_gateway_invalid_auto_accept_shared_attachments_test.go b/rules/models/aws_ec2_transit_gateway_invalid_auto_accept_shared_attachments_test.go index 818a9691..4af8083b 100644 --- a/rules/models/aws_ec2_transit_gateway_invalid_auto_accept_shared_attachments_test.go +++ b/rules/models/aws_ec2_transit_gateway_invalid_auto_accept_shared_attachments_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_transit_gateway" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2TransitGatewayInvalidAutoAcceptSharedAttachmentsRule(), - Message: `"true" is an invalid value as auto_accept_shared_attachments`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("true"), "auto_accept_shared_attachments"), }, }, }, diff --git a/rules/models/aws_ec2_transit_gateway_invalid_default_route_table_association_test.go b/rules/models/aws_ec2_transit_gateway_invalid_default_route_table_association_test.go index 314d9420..f2959cae 100644 --- a/rules/models/aws_ec2_transit_gateway_invalid_default_route_table_association_test.go +++ b/rules/models/aws_ec2_transit_gateway_invalid_default_route_table_association_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_transit_gateway" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2TransitGatewayInvalidDefaultRouteTableAssociationRule(), - Message: `"false" is an invalid value as default_route_table_association`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("false"), "default_route_table_association"), }, }, }, diff --git a/rules/models/aws_ec2_transit_gateway_invalid_default_route_table_propagation_test.go b/rules/models/aws_ec2_transit_gateway_invalid_default_route_table_propagation_test.go index 8d80365b..66abbe9d 100644 --- a/rules/models/aws_ec2_transit_gateway_invalid_default_route_table_propagation_test.go +++ b/rules/models/aws_ec2_transit_gateway_invalid_default_route_table_propagation_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_transit_gateway" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2TransitGatewayInvalidDefaultRouteTablePropagationRule(), - Message: `"disabled" is an invalid value as default_route_table_propagation`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("disabled"), "default_route_table_propagation"), }, }, }, diff --git a/rules/models/aws_ec2_transit_gateway_invalid_dns_support_test.go b/rules/models/aws_ec2_transit_gateway_invalid_dns_support_test.go index 3438a56d..d3898235 100644 --- a/rules/models/aws_ec2_transit_gateway_invalid_dns_support_test.go +++ b/rules/models/aws_ec2_transit_gateway_invalid_dns_support_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_transit_gateway" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2TransitGatewayInvalidDNSSupportRule(), - Message: `"enabled" is an invalid value as dns_support`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("enabled"), "dns_support"), }, }, }, diff --git a/rules/models/aws_ec2_transit_gateway_vpc_attachment_invalid_ipv6_support_test.go b/rules/models/aws_ec2_transit_gateway_vpc_attachment_invalid_ipv6_support_test.go index 8c370add..57df601c 100644 --- a/rules/models/aws_ec2_transit_gateway_vpc_attachment_invalid_ipv6_support_test.go +++ b/rules/models/aws_ec2_transit_gateway_vpc_attachment_invalid_ipv6_support_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ec2_transit_gateway_vpc_attachment" "foo" { Expected: helper.Issues{ { Rule: NewAwsEc2TransitGatewayVpcAttachmentInvalidIpv6SupportRule(), - Message: `"on" is an invalid value as ipv6_support`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("on"), "ipv6_support"), }, }, }, diff --git a/rules/models/aws_ecr_lifecycle_policy_invalid_repository_test.go b/rules/models/aws_ecr_lifecycle_policy_invalid_repository_test.go index 6ee272ec..10affac1 100644 --- a/rules/models/aws_ecr_lifecycle_policy_invalid_repository_test.go +++ b/rules/models/aws_ecr_lifecycle_policy_invalid_repository_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ecr_lifecycle_policy" "foo" { Expected: helper.Issues{ { Rule: NewAwsEcrLifecyclePolicyInvalidRepositoryRule(), - Message: `"example@com" does not match valid pattern ^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("example@com"), `^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$`), }, }, }, diff --git a/rules/models/aws_ecs_service_invalid_launch_type_test.go b/rules/models/aws_ecs_service_invalid_launch_type_test.go index e8fe4084..c2967b61 100644 --- a/rules/models/aws_ecs_service_invalid_launch_type_test.go +++ b/rules/models/aws_ecs_service_invalid_launch_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ecs_service" "foo" { Expected: helper.Issues{ { Rule: NewAwsEcsServiceInvalidLaunchTypeRule(), - Message: `"POD" is an invalid value as launch_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("POD"), "launch_type"), }, }, }, diff --git a/rules/models/aws_ecs_service_invalid_propagate_tags_test.go b/rules/models/aws_ecs_service_invalid_propagate_tags_test.go index ae5007f2..2ad710f4 100644 --- a/rules/models/aws_ecs_service_invalid_propagate_tags_test.go +++ b/rules/models/aws_ecs_service_invalid_propagate_tags_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ecs_service" "foo" { Expected: helper.Issues{ { Rule: NewAwsEcsServiceInvalidPropagateTagsRule(), - Message: `"CONTAINER" is an invalid value as propagate_tags`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("CONTAINER"), "propagate_tags"), }, }, }, diff --git a/rules/models/aws_ecs_service_invalid_scheduling_strategy_test.go b/rules/models/aws_ecs_service_invalid_scheduling_strategy_test.go index 864f9eec..d4964556 100644 --- a/rules/models/aws_ecs_service_invalid_scheduling_strategy_test.go +++ b/rules/models/aws_ecs_service_invalid_scheduling_strategy_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ecs_service" "foo" { Expected: helper.Issues{ { Rule: NewAwsEcsServiceInvalidSchedulingStrategyRule(), - Message: `"SERVER" is an invalid value as scheduling_strategy`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("SERVER"), "scheduling_strategy"), }, }, }, diff --git a/rules/models/aws_ecs_task_definition_invalid_ipc_mode_test.go b/rules/models/aws_ecs_task_definition_invalid_ipc_mode_test.go index 96d45c13..4a3cba4f 100644 --- a/rules/models/aws_ecs_task_definition_invalid_ipc_mode_test.go +++ b/rules/models/aws_ecs_task_definition_invalid_ipc_mode_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ecs_task_definition" "foo" { Expected: helper.Issues{ { Rule: NewAwsEcsTaskDefinitionInvalidIpcModeRule(), - Message: `"vpc" is an invalid value as ipc_mode`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("vpc"), "ipc_mode"), }, }, }, diff --git a/rules/models/aws_ecs_task_definition_invalid_network_mode_test.go b/rules/models/aws_ecs_task_definition_invalid_network_mode_test.go index 8dd42d28..faa337e1 100644 --- a/rules/models/aws_ecs_task_definition_invalid_network_mode_test.go +++ b/rules/models/aws_ecs_task_definition_invalid_network_mode_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ecs_task_definition" "foo" { Expected: helper.Issues{ { Rule: NewAwsEcsTaskDefinitionInvalidNetworkModeRule(), - Message: `"vpc" is an invalid value as network_mode`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("vpc"), "network_mode"), }, }, }, diff --git a/rules/models/aws_ecs_task_definition_invalid_pid_mode_test.go b/rules/models/aws_ecs_task_definition_invalid_pid_mode_test.go index 82004819..f875f0fe 100644 --- a/rules/models/aws_ecs_task_definition_invalid_pid_mode_test.go +++ b/rules/models/aws_ecs_task_definition_invalid_pid_mode_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_ecs_task_definition" "foo" { Expected: helper.Issues{ { Rule: NewAwsEcsTaskDefinitionInvalidPidModeRule(), - Message: `"awsvpc" is an invalid value as pid_mode`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("awsvpc"), "pid_mode"), }, }, }, diff --git a/rules/models/aws_efs_file_system_invalid_performance_mode_test.go b/rules/models/aws_efs_file_system_invalid_performance_mode_test.go index 5194df98..438164b9 100644 --- a/rules/models/aws_efs_file_system_invalid_performance_mode_test.go +++ b/rules/models/aws_efs_file_system_invalid_performance_mode_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_efs_file_system" "foo" { Expected: helper.Issues{ { Rule: NewAwsEfsFileSystemInvalidPerformanceModeRule(), - Message: `"minIO" is an invalid value as performance_mode`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("minIO"), "performance_mode"), }, }, }, diff --git a/rules/models/aws_efs_file_system_invalid_throughput_mode_test.go b/rules/models/aws_efs_file_system_invalid_throughput_mode_test.go index 6fccaa99..38b937eb 100644 --- a/rules/models/aws_efs_file_system_invalid_throughput_mode_test.go +++ b/rules/models/aws_efs_file_system_invalid_throughput_mode_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_efs_file_system" "foo" { Expected: helper.Issues{ { Rule: NewAwsEfsFileSystemInvalidThroughputModeRule(), - Message: `"generalPurpose" is an invalid value as throughput_mode`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("generalPurpose"), "throughput_mode"), }, }, }, diff --git a/rules/models/aws_eks_cluster_invalid_name_test.go b/rules/models/aws_eks_cluster_invalid_name_test.go index 8748d0b3..8770a3d1 100644 --- a/rules/models/aws_eks_cluster_invalid_name_test.go +++ b/rules/models/aws_eks_cluster_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_eks_cluster" "foo" { Expected: helper.Issues{ { Rule: NewAwsEksClusterInvalidNameRule(), - Message: `"@example" does not match valid pattern ^[0-9A-Za-z][A-Za-z0-9\-_]*`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("@example"), `^[0-9A-Za-z][A-Za-z0-9\-_]*`), }, }, }, diff --git a/rules/models/aws_elasticache_cluster_invalid_az_mode_test.go b/rules/models/aws_elasticache_cluster_invalid_az_mode_test.go index a633a128..ef8a7490 100644 --- a/rules/models/aws_elasticache_cluster_invalid_az_mode_test.go +++ b/rules/models/aws_elasticache_cluster_invalid_az_mode_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_elasticache_cluster" "foo" { Expected: helper.Issues{ { Rule: NewAwsElastiCacheClusterInvalidAzModeRule(), - Message: `"multi-az" is an invalid value as az_mode`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("multi-az"), "az_mode"), }, }, }, diff --git a/rules/models/aws_elastictranscoder_preset_invalid_container_test.go b/rules/models/aws_elastictranscoder_preset_invalid_container_test.go index daa75daf..3d288b05 100644 --- a/rules/models/aws_elastictranscoder_preset_invalid_container_test.go +++ b/rules/models/aws_elastictranscoder_preset_invalid_container_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_elastictranscoder_preset" "foo" { Expected: helper.Issues{ { Rule: NewAwsElastictranscoderPresetInvalidContainerRule(), - Message: `"mp1" does not match valid pattern ^(^mp4$)|(^ts$)|(^webm$)|(^mp3$)|(^flac$)|(^oga$)|(^ogg$)|(^fmp4$)|(^mpg$)|(^flv$)|(^gif$)|(^mxf$)|(^wav$)|(^mp2$)$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("mp1"), `^(^mp4$)|(^ts$)|(^webm$)|(^mp3$)|(^flac$)|(^oga$)|(^ogg$)|(^fmp4$)|(^mpg$)|(^flv$)|(^gif$)|(^mxf$)|(^wav$)|(^mp2$)$`), }, }, }, diff --git a/rules/models/aws_instance_invalid_instance_initiated_shutdown_behavior_test.go b/rules/models/aws_instance_invalid_instance_initiated_shutdown_behavior_test.go index b7e0a190..7395b84c 100644 --- a/rules/models/aws_instance_invalid_instance_initiated_shutdown_behavior_test.go +++ b/rules/models/aws_instance_invalid_instance_initiated_shutdown_behavior_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_instance" "foo" { Expected: helper.Issues{ { Rule: NewAwsInstanceInvalidInstanceInitiatedShutdownBehaviorRule(), - Message: `"restart" is an invalid value as instance_initiated_shutdown_behavior`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("restart"), "instance_initiated_shutdown_behavior"), }, }, }, diff --git a/rules/models/aws_instance_invalid_tenancy_test.go b/rules/models/aws_instance_invalid_tenancy_test.go index 18897807..8e1fedb2 100644 --- a/rules/models/aws_instance_invalid_tenancy_test.go +++ b/rules/models/aws_instance_invalid_tenancy_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_instance" "foo" { Expected: helper.Issues{ { Rule: NewAwsInstanceInvalidTenancyRule(), - Message: `"server" is an invalid value as tenancy`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("server"), "tenancy"), }, }, }, diff --git a/rules/models/aws_launch_template_invalid_instance_type_test.go b/rules/models/aws_launch_template_invalid_instance_type_test.go index d4d18d72..e8e2f26f 100644 --- a/rules/models/aws_launch_template_invalid_instance_type_test.go +++ b/rules/models/aws_launch_template_invalid_instance_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_launch_template" "foo" { Expected: helper.Issues{ { Rule: NewAwsLaunchTemplateInvalidInstanceTypeRule(), - Message: `"t1.2xlarge" is an invalid value as instance_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("t1.2xlarge"), "instance_type"), }, }, }, diff --git a/rules/models/aws_launch_template_invalid_name_test.go b/rules/models/aws_launch_template_invalid_name_test.go index 1976a6b1..6919a44c 100644 --- a/rules/models/aws_launch_template_invalid_name_test.go +++ b/rules/models/aws_launch_template_invalid_name_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_launch_template" "foo" { Expected: helper.Issues{ { Rule: NewAwsLaunchTemplateInvalidNameRule(), - Message: `"foo[bar]" does not match valid pattern ^[a-zA-Z0-9\(\)\.\-/_]+$`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage("foo[bar]"), `^[a-zA-Z0-9\(\)\.\-/_]+$`), }, }, }, diff --git a/rules/models/aws_lb_invalid_ip_address_type_test.go b/rules/models/aws_lb_invalid_ip_address_type_test.go index 83a03d6f..94b0dca6 100644 --- a/rules/models/aws_lb_invalid_ip_address_type_test.go +++ b/rules/models/aws_lb_invalid_ip_address_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_lb" "foo" { Expected: helper.Issues{ { Rule: NewAwsLbInvalidIPAddressTypeRule(), - Message: `"ipv6" is an invalid value as ip_address_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("ipv6"), "ip_address_type"), }, }, }, diff --git a/rules/models/aws_lb_invalid_load_balancer_type_test.go b/rules/models/aws_lb_invalid_load_balancer_type_test.go index 8765b4a3..25cb7d58 100644 --- a/rules/models/aws_lb_invalid_load_balancer_type_test.go +++ b/rules/models/aws_lb_invalid_load_balancer_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_lb" "foo" { Expected: helper.Issues{ { Rule: NewAwsLbInvalidLoadBalancerTypeRule(), - Message: `"classic" is an invalid value as load_balancer_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("classic"), "load_balancer_type"), }, }, }, diff --git a/rules/models/aws_lb_listener_invalid_protocol_test.go b/rules/models/aws_lb_listener_invalid_protocol_test.go index 9e963fa3..8fc3feab 100644 --- a/rules/models/aws_lb_listener_invalid_protocol_test.go +++ b/rules/models/aws_lb_listener_invalid_protocol_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_lb_listener" "foo" { Expected: helper.Issues{ { Rule: NewAwsLbListenerInvalidProtocolRule(), - Message: `"INVALID" is an invalid value as protocol`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("INVALID"), "protocol"), }, }, }, diff --git a/rules/models/aws_lb_target_group_invalid_target_type_test.go b/rules/models/aws_lb_target_group_invalid_target_type_test.go index 5fe5671c..90e234af 100644 --- a/rules/models/aws_lb_target_group_invalid_target_type_test.go +++ b/rules/models/aws_lb_target_group_invalid_target_type_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_lb_target_group" "foo" { Expected: helper.Issues{ { Rule: NewAwsLbTargetGroupInvalidTargetTypeRule(), - Message: `"container" is an invalid value as target_type`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("container"), "target_type"), }, }, }, diff --git a/rules/models/aws_placement_group_invalid_strategy_test.go b/rules/models/aws_placement_group_invalid_strategy_test.go index 4317f036..1099891e 100644 --- a/rules/models/aws_placement_group_invalid_strategy_test.go +++ b/rules/models/aws_placement_group_invalid_strategy_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_placement_group" "foo" { Expected: helper.Issues{ { Rule: NewAwsPlacementGroupInvalidStrategyRule(), - Message: `"instance" is an invalid value as strategy`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("instance"), "strategy"), }, }, }, diff --git a/rules/models/aws_spot_fleet_request_invalid_allocation_strategy_test.go b/rules/models/aws_spot_fleet_request_invalid_allocation_strategy_test.go index 5e6ea96e..77c31174 100644 --- a/rules/models/aws_spot_fleet_request_invalid_allocation_strategy_test.go +++ b/rules/models/aws_spot_fleet_request_invalid_allocation_strategy_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_spot_fleet_request" "foo" { Expected: helper.Issues{ { Rule: NewAwsSpotFleetRequestInvalidAllocationStrategyRule(), - Message: `"highestPrice" is an invalid value as allocation_strategy`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("highestPrice"), "allocation_strategy"), }, }, }, diff --git a/rules/models/aws_spot_fleet_request_invalid_instance_interruption_behaviour_test.go b/rules/models/aws_spot_fleet_request_invalid_instance_interruption_behaviour_test.go index 222522be..797312c6 100644 --- a/rules/models/aws_spot_fleet_request_invalid_instance_interruption_behaviour_test.go +++ b/rules/models/aws_spot_fleet_request_invalid_instance_interruption_behaviour_test.go @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -23,7 +24,7 @@ resource "aws_spot_fleet_request" "foo" { Expected: helper.Issues{ { Rule: NewAwsSpotFleetRequestInvalidInstanceInterruptionBehaviourRule(), - Message: `"restart" is an invalid value as instance_interruption_behaviour`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage("restart"), "instance_interruption_behaviour"), }, }, }, diff --git a/rules/models/mappings/acm.hcl b/rules/models/mappings/acm.hcl index 1a946a40..4caffa71 100644 --- a/rules/models/mappings/acm.hcl +++ b/rules/models/mappings/acm.hcl @@ -7,10 +7,15 @@ mapping "aws_acm_certificate" { private_key = PrivateKey certificate_body = CertificateBody certificate_chain = CertificateChain - certificate_authority_arn = Arn + certificate_authority_arn = PcaArn tags = TagList } mapping "aws_acm_certificate_validation" { certificate_arn = Arn } + +test "aws_acm_certificate" "certificate_authority_arn" { + ok = "arn:aws:acm-pca:us-east-1:0000000000:certificate-authority/xxxxxx-xxx-xxx-xxxx-xxxxxxxxx" + ng = "arn:aws:unknown-service:us-east-1:0000000000:certificate-authority/xxxxxx-xxx-xxx-xxxx-xxxxxxxxx" +} \ No newline at end of file diff --git a/rules/models/pattern_rule_test.go.tmpl b/rules/models/pattern_rule_test.go.tmpl index ea200298..6a6c3bec 100644 --- a/rules/models/pattern_rule_test.go.tmpl +++ b/rules/models/pattern_rule_test.go.tmpl @@ -4,6 +4,7 @@ package models import ( "testing" + "fmt" "github.com/terraform-linters/tflint-plugin-sdk/helper" ) @@ -24,10 +25,10 @@ resource "{{ .ResourceType }}" "foo" { { Rule: New{{ .RuleNameCC }}Rule(), {{- if ne .Pattern "" }} - Message: `{{ .TestNG }} does not match valid pattern {{ .Pattern }}`, + Message: fmt.Sprintf(`"%s" does not match valid pattern %s`, truncateLongMessage({{ .TestNG }}), `{{ .Pattern }}`), {{- end }} {{- if ne (len .Enum) 0 }} - Message: `{{ .TestNG }} is an invalid value as {{ .AttributeName }}`, + Message: fmt.Sprintf(`"%s" is an invalid value as %s`, truncateLongMessage({{ .TestNG }}), "{{ .AttributeName }}"), {{- end }} }, },