Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Regular expression consistency #33359

Merged
merged 6 commits into from
Sep 8, 2023
Merged

Regular expression consistency #33359

merged 6 commits into from
Sep 8, 2023

Conversation

YakDriver
Copy link
Member

@YakDriver YakDriver commented Sep 7, 2023

Description

Relations

Relates #33317
Relates #32289

References

Output from Acceptance Testing

% make t T=TestAccAppConfigConfigurationProfile_basic K=appconfig
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/appconfig/... -v -count 1 -parallel 20 -run='TestAccAppConfigConfigurationProfile_basic'  -timeout 180m
=== RUN   TestAccAppConfigConfigurationProfile_basic
=== PAUSE TestAccAppConfigConfigurationProfile_basic
=== CONT  TestAccAppConfigConfigurationProfile_basic
--- PASS: TestAccAppConfigConfigurationProfile_basic (25.44s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appconfig	27.386s
% make t T=TestAccAppFlowFlow_basic K=appflow
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/appflow/... -v -count 1 -parallel 20 -run='TestAccAppFlowFlow_basic'  -timeout 180m
=== RUN   TestAccAppFlowFlow_basic
=== PAUSE TestAccAppFlowFlow_basic
=== CONT  TestAccAppFlowFlow_basic
--- PASS: TestAccAppFlowFlow_basic (33.51s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appflow	35.726s
% make t T=TestAccAppIntegrationsEventIntegration_basic K=appintegrations
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/appintegrations/... -v -count 1 -parallel 20 -run='TestAccAppIntegrationsEventIntegration_basic'  -timeout 180m
=== RUN   TestAccAppIntegrationsEventIntegration_basic
=== PAUSE TestAccAppIntegrationsEventIntegration_basic
=== CONT  TestAccAppIntegrationsEventIntegration_basic
--- PASS: TestAccAppIntegrationsEventIntegration_basic (41.74s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appintegrations	43.604s
% make t T="TestAccAppSync_serial/Function/basic" K=appsync
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/appsync/... -v -count 1 -parallel 20 -run='TestAccAppSync_serial/Function/basic'  -timeout 180m
=== RUN   TestAccAppSync_serial
=== PAUSE TestAccAppSync_serial
=== CONT  TestAccAppSync_serial
=== RUN   TestAccAppSync_serial/Function
=== RUN   TestAccAppSync_serial/Function/basic
--- PASS: TestAccAppSync_serial (56.29s)
    --- PASS: TestAccAppSync_serial/Function (56.29s)
        --- PASS: TestAccAppSync_serial/Function/basic (56.29s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appsync	58.161s
% make t T=TestAccBackupPlan_basic K=backup
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/backup/... -v -count 1 -parallel 20 -run='TestAccBackupPlan_basic'  -timeout 180m
=== RUN   TestAccBackupPlan_basic
=== PAUSE TestAccBackupPlan_basic
=== CONT  TestAccBackupPlan_basic
--- PASS: TestAccBackupPlan_basic (27.02s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	28.851s
% make t T=TestAccBatchJobQueue_basic K=batch
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/batch/... -v -count 1 -parallel 20 -run='TestAccBatchJobQueue_basic'  -timeout 180m
=== RUN   TestAccBatchJobQueue_basic
=== PAUSE TestAccBatchJobQueue_basic
=== CONT  TestAccBatchJobQueue_basic
--- PASS: TestAccBatchJobQueue_basic (133.67s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/batch	135.526s
% make t T=TestAccChimeSDKMediaPipelinesMediaInsightsPipelineConfiguration_basic K=chimesdkmediapipelines
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/chimesdkmediapipelines/... -v -count 1 -parallel 20 -run='TestAccChimeSDKMediaPipelinesMediaInsightsPipelineConfiguration_basic'  -timeout 180m
=== RUN   TestAccChimeSDKMediaPipelinesMediaInsightsPipelineConfiguration_basic
=== PAUSE TestAccChimeSDKMediaPipelinesMediaInsightsPipelineConfiguration_basic
=== CONT  TestAccChimeSDKMediaPipelinesMediaInsightsPipelineConfiguration_basic
--- PASS: TestAccChimeSDKMediaPipelinesMediaInsightsPipelineConfiguration_basic (70.69s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/chimesdkmediapipelines	72.546s
% make t T=TestAccCloudFrontDistribution_originPolicyOrdered K=cloudfront
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cloudfront/... -v -count 1 -parallel 20 -run='TestAccCloudFrontDistribution_originPolicyOrdered'  -timeout 180m
=== RUN   TestAccCloudFrontDistribution_originPolicyOrdered
=== PAUSE TestAccCloudFrontDistribution_originPolicyOrdered
=== CONT  TestAccCloudFrontDistribution_originPolicyOrdered
--- PASS: TestAccCloudFrontDistribution_originPolicyOrdered (429.29s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront	431.196s
% make t T="TestAccConfigService_serial/ConformancePack/basic" K=configservice
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/configservice/... -v -count 1 -parallel 20 -run='TestAccConfigService_serial/ConformancePack/basic'  -timeout 180m
=== RUN   TestAccConfigService_serial
=== PAUSE TestAccConfigService_serial
=== CONT  TestAccConfigService_serial
=== RUN   TestAccConfigService_serial/OrganizationConformancePack
=== RUN   TestAccConfigService_serial/OrganizationConformancePack/basic
    acctest.go:925: skipping tests; this AWS account must not be an existing member of an AWS Organization
=== RUN   TestAccConfigService_serial/ConformancePack
=== RUN   TestAccConfigService_serial/ConformancePack/basic
--- PASS: TestAccConfigService_serial (127.74s)
    --- PASS: TestAccConfigService_serial/OrganizationConformancePack (0.73s)
        --- SKIP: TestAccConfigService_serial/OrganizationConformancePack/basic (0.73s)
    --- PASS: TestAccConfigService_serial/ConformancePack (127.01s)
        --- PASS: TestAccConfigService_serial/ConformancePack/basic (127.00s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/configservice	129.568s
% make t T=TestAccDataSyncTask_basic K=datasync
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/datasync/... -v -count 1 -parallel 20 -run='TestAccDataSyncTask_basic'  -timeout 180m
=== RUN   TestAccDataSyncTask_basic
=== PAUSE TestAccDataSyncTask_basic
=== CONT  TestAccDataSyncTask_basic
--- PASS: TestAccDataSyncTask_basic (174.55s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/datasync	176.502s
% make t T=TestAccVPCSecurityGroupRule_IngressSourceWithAccount_id K=vpc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCSecurityGroupRule_IngressSourceWithAccount_id'  -timeout 180m
=== RUN   TestAccVPCSecurityGroupRule_IngressSourceWithAccount_id
=== PAUSE TestAccVPCSecurityGroupRule_IngressSourceWithAccount_id
=== CONT  TestAccVPCSecurityGroupRule_IngressSourceWithAccount_id
--- PASS: TestAccVPCSecurityGroupRule_IngressSourceWithAccount_id (29.47s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	31.505s
% make t T=TestAccEvidentlyLaunch_basic K=evidently
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/evidently/... -v -count 1 -parallel 20 -run='TestAccEvidentlyLaunch_basic'  -timeout 180m
=== RUN   TestAccEvidentlyLaunch_basic
=== PAUSE TestAccEvidentlyLaunch_basic
=== CONT  TestAccEvidentlyLaunch_basic
--- PASS: TestAccEvidentlyLaunch_basic (28.90s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/evidently	30.787s
% make sane
==> Sane Check (48 tests of Top 30 resources)
==> Like 'sanity' except full output and stops soon after 1st error
==> NOTE: NOT an exhaustive set of tests! Finds big problems only.
=== RUN   TestAccIAMInstanceProfile_basic
=== PAUSE TestAccIAMInstanceProfile_basic
=== RUN   TestAccIAMInstanceProfile_tags
=== PAUSE TestAccIAMInstanceProfile_tags
=== RUN   TestAccIAMPolicyDocumentDataSource_basic
=== PAUSE TestAccIAMPolicyDocumentDataSource_basic
=== RUN   TestAccIAMPolicyDocumentDataSource_sourceConflicting
=== PAUSE TestAccIAMPolicyDocumentDataSource_sourceConflicting
=== RUN   TestAccIAMPolicy_basic
=== PAUSE TestAccIAMPolicy_basic
=== RUN   TestAccIAMPolicy_tags
=== PAUSE TestAccIAMPolicy_tags
=== RUN   TestAccIAMPolicy_policy
=== PAUSE TestAccIAMPolicy_policy
=== RUN   TestAccIAMRolePolicyAttachment_basic
=== PAUSE TestAccIAMRolePolicyAttachment_basic
=== RUN   TestAccIAMRolePolicyAttachment_disappears
=== PAUSE TestAccIAMRolePolicyAttachment_disappears
=== RUN   TestAccIAMRolePolicyAttachment_Disappears_role
=== PAUSE TestAccIAMRolePolicyAttachment_Disappears_role
=== RUN   TestAccIAMRolePolicy_basic
=== PAUSE TestAccIAMRolePolicy_basic
=== RUN   TestAccIAMRolePolicy_unknownsInPolicy
=== PAUSE TestAccIAMRolePolicy_unknownsInPolicy
=== RUN   TestAccIAMRole_basic
=== PAUSE TestAccIAMRole_basic
=== RUN   TestAccIAMRole_namePrefix
=== PAUSE TestAccIAMRole_namePrefix
=== RUN   TestAccIAMRole_disappears
=== PAUSE TestAccIAMRole_disappears
=== RUN   TestAccIAMRole_InlinePolicy_basic
=== PAUSE TestAccIAMRole_InlinePolicy_basic
=== CONT  TestAccIAMInstanceProfile_basic
=== CONT  TestAccIAMRolePolicyAttachment_disappears
=== CONT  TestAccIAMPolicy_basic
=== CONT  TestAccIAMRole_basic
=== CONT  TestAccIAMPolicyDocumentDataSource_basic
=== CONT  TestAccIAMRolePolicy_unknownsInPolicy
=== CONT  TestAccIAMRole_InlinePolicy_basic
=== CONT  TestAccIAMRolePolicy_basic
=== CONT  TestAccIAMPolicyDocumentDataSource_sourceConflicting
=== CONT  TestAccIAMRolePolicyAttachment_Disappears_role
=== CONT  TestAccIAMInstanceProfile_tags
=== CONT  TestAccIAMRolePolicyAttachment_basic
=== CONT  TestAccIAMPolicy_tags
=== CONT  TestAccIAMPolicy_policy
=== CONT  TestAccIAMRole_namePrefix
=== CONT  TestAccIAMRole_disappears
--- PASS: TestAccIAMPolicyDocumentDataSource_basic (51.48s)
--- PASS: TestAccIAMPolicyDocumentDataSource_sourceConflicting (51.73s)
--- PASS: TestAccIAMRolePolicyAttachment_Disappears_role (60.41s)
--- PASS: TestAccIAMRole_disappears (60.74s)
--- PASS: TestAccIAMRolePolicyAttachment_disappears (62.61s)
--- PASS: TestAccIAMRolePolicy_unknownsInPolicy (64.83s)
--- PASS: TestAccIAMRole_namePrefix (66.22s)
--- PASS: TestAccIAMPolicy_basic (67.91s)
--- PASS: TestAccIAMRole_basic (68.04s)
--- PASS: TestAccIAMInstanceProfile_basic (68.10s)
--- PASS: TestAccIAMRolePolicyAttachment_basic (90.90s)
--- PASS: TestAccIAMPolicy_policy (91.49s)
--- PASS: TestAccIAMRolePolicy_basic (91.57s)
--- PASS: TestAccIAMPolicy_tags (107.76s)
--- PASS: TestAccIAMRole_InlinePolicy_basic (109.49s)
--- PASS: TestAccIAMInstanceProfile_tags (109.86s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	111.781s
=== RUN   TestAccLogsGroup_basic
=== PAUSE TestAccLogsGroup_basic
=== RUN   TestAccLogsGroup_multiple
=== PAUSE TestAccLogsGroup_multiple
=== CONT  TestAccLogsGroup_basic
=== CONT  TestAccLogsGroup_multiple
--- PASS: TestAccLogsGroup_multiple (43.89s)
--- PASS: TestAccLogsGroup_basic (49.08s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/logs	51.287s
=== RUN   TestAccVPCDataSource_basic
=== PAUSE TestAccVPCDataSource_basic
=== RUN   TestAccVPCRouteTableAssociation_Subnet_basic
=== PAUSE TestAccVPCRouteTableAssociation_Subnet_basic
=== RUN   TestAccVPCRouteTable_basic
=== PAUSE TestAccVPCRouteTable_basic
=== RUN   TestAccVPCSecurityGroupRule_race
=== PAUSE TestAccVPCSecurityGroupRule_race
=== RUN   TestAccVPCSecurityGroupRule_protocolChange
=== PAUSE TestAccVPCSecurityGroupRule_protocolChange
=== RUN   TestAccVPCSecurityGroup_basic
=== PAUSE TestAccVPCSecurityGroup_basic
=== RUN   TestAccVPCSecurityGroup_ipRangesWithSameRules
=== PAUSE TestAccVPCSecurityGroup_ipRangesWithSameRules
=== RUN   TestAccVPCSecurityGroup_vpcAllEgress
=== PAUSE TestAccVPCSecurityGroup_vpcAllEgress
=== RUN   TestAccVPCSubnet_basic
=== PAUSE TestAccVPCSubnet_basic
=== RUN   TestAccVPC_tenancy
=== PAUSE TestAccVPC_tenancy
=== CONT  TestAccVPCDataSource_basic
=== CONT  TestAccVPCSecurityGroup_basic
=== CONT  TestAccVPC_tenancy
=== CONT  TestAccVPCSecurityGroupRule_race
=== CONT  TestAccVPCSecurityGroup_vpcAllEgress
=== CONT  TestAccVPCSecurityGroup_ipRangesWithSameRules
=== CONT  TestAccVPCRouteTable_basic
=== CONT  TestAccVPCSecurityGroupRule_protocolChange
=== CONT  TestAccVPCRouteTableAssociation_Subnet_basic
=== CONT  TestAccVPCSubnet_basic
--- PASS: TestAccVPCRouteTable_basic (72.48s)
--- PASS: TestAccVPCSubnet_basic (72.89s)
--- PASS: TestAccVPCSecurityGroup_basic (73.56s)
--- PASS: TestAccVPCSecurityGroup_vpcAllEgress (74.59s)
--- PASS: TestAccVPCDataSource_basic (75.42s)
--- PASS: TestAccVPCRouteTableAssociation_Subnet_basic (76.46s)
--- PASS: TestAccVPCSecurityGroup_ipRangesWithSameRules (76.81s)
--- PASS: TestAccVPC_tenancy (116.67s)
--- PASS: TestAccVPCSecurityGroupRule_protocolChange (121.13s)
--- PASS: TestAccVPCSecurityGroupRule_race (170.96s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	175.726s
=== RUN   TestAccECSService_basic
=== PAUSE TestAccECSService_basic
=== RUN   TestAccECSService_basicImport
=== PAUSE TestAccECSService_basicImport
=== RUN   TestAccECSTaskDefinition_basic
=== PAUSE TestAccECSTaskDefinition_basic
=== CONT  TestAccECSService_basic
=== CONT  TestAccECSTaskDefinition_basic
=== CONT  TestAccECSService_basicImport
--- PASS: TestAccECSTaskDefinition_basic (89.94s)
--- PASS: TestAccECSService_basic (130.91s)
--- PASS: TestAccECSService_basicImport (236.16s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ecs	238.053s
=== RUN   TestAccELBV2TargetGroup_basic
=== PAUSE TestAccELBV2TargetGroup_basic
=== CONT  TestAccELBV2TargetGroup_basic
--- PASS: TestAccELBV2TargetGroup_basic (52.61s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elbv2	57.263s
=== RUN   TestAccKMSKey_basic
=== PAUSE TestAccKMSKey_basic
=== CONT  TestAccKMSKey_basic
--- PASS: TestAccKMSKey_basic (85.14s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kms	88.559s
=== RUN   TestAccLambdaFunction_basic
=== PAUSE TestAccLambdaFunction_basic
=== RUN   TestAccLambdaPermission_basic
=== PAUSE TestAccLambdaPermission_basic
=== CONT  TestAccLambdaFunction_basic
=== CONT  TestAccLambdaPermission_basic
--- PASS: TestAccLambdaPermission_basic (65.31s)
--- PASS: TestAccLambdaFunction_basic (70.52s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	74.227s
=== RUN   TestAccMetaPartitionDataSource_basic
=== PAUSE TestAccMetaPartitionDataSource_basic
=== RUN   TestAccMetaRegionDataSource_basic
=== PAUSE TestAccMetaRegionDataSource_basic
=== RUN   TestAccMetaRegionDataSource_endpoint
=== PAUSE TestAccMetaRegionDataSource_endpoint
=== RUN   TestAccMetaRegionDataSource_endpointAndName
=== PAUSE TestAccMetaRegionDataSource_endpointAndName
=== CONT  TestAccMetaPartitionDataSource_basic
=== CONT  TestAccMetaRegionDataSource_endpoint
=== CONT  TestAccMetaRegionDataSource_endpointAndName
=== CONT  TestAccMetaRegionDataSource_basic
--- PASS: TestAccMetaRegionDataSource_basic (45.83s)
--- PASS: TestAccMetaPartitionDataSource_basic (46.09s)
--- PASS: TestAccMetaRegionDataSource_endpointAndName (47.66s)
--- PASS: TestAccMetaRegionDataSource_endpoint (48.02s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/meta	50.062s
=== RUN   TestAccRoute53Record_basic
=== PAUSE TestAccRoute53Record_basic
=== RUN   TestAccRoute53Record_Latency_basic
=== PAUSE TestAccRoute53Record_Latency_basic
=== RUN   TestAccRoute53ZoneDataSource_name
=== PAUSE TestAccRoute53ZoneDataSource_name
=== CONT  TestAccRoute53Record_basic
=== CONT  TestAccRoute53ZoneDataSource_name
=== CONT  TestAccRoute53Record_Latency_basic
--- PASS: TestAccRoute53ZoneDataSource_name (90.99s)
--- PASS: TestAccRoute53Record_basic (149.91s)
--- PASS: TestAccRoute53Record_Latency_basic (155.16s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/route53	159.549s
=== RUN   TestAccS3BucketACL_updateACL
=== PAUSE TestAccS3BucketACL_updateACL
=== RUN   TestAccS3BucketPolicy_basic
=== PAUSE TestAccS3BucketPolicy_basic
=== RUN   TestAccS3BucketPublicAccessBlock_basic
=== PAUSE TestAccS3BucketPublicAccessBlock_basic
=== RUN   TestAccS3Bucket_Basic_basic
=== PAUSE TestAccS3Bucket_Basic_basic
=== RUN   TestAccS3Bucket_Security_corsUpdate
=== PAUSE TestAccS3Bucket_Security_corsUpdate
=== CONT  TestAccS3BucketACL_updateACL
=== CONT  TestAccS3Bucket_Basic_basic
=== CONT  TestAccS3Bucket_Security_corsUpdate
=== CONT  TestAccS3BucketPublicAccessBlock_basic
=== CONT  TestAccS3BucketPolicy_basic
--- PASS: TestAccS3BucketPublicAccessBlock_basic (58.74s)
--- PASS: TestAccS3Bucket_Basic_basic (58.77s)
--- PASS: TestAccS3BucketPolicy_basic (58.97s)
--- PASS: TestAccS3BucketACL_updateACL (80.14s)
--- PASS: TestAccS3Bucket_Security_corsUpdate (80.47s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	83.634s
=== RUN   TestAccSecretsManagerSecret_basic
=== PAUSE TestAccSecretsManagerSecret_basic
=== RUN   TestAccSecretsManagerSecret_basicReplica
=== PAUSE TestAccSecretsManagerSecret_basicReplica
=== CONT  TestAccSecretsManagerSecret_basic
=== CONT  TestAccSecretsManagerSecret_basicReplica
--- PASS: TestAccSecretsManagerSecret_basic (49.43s)
--- PASS: TestAccSecretsManagerSecret_basicReplica (60.52s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/secretsmanager	65.165s
=== RUN   TestAccSTSCallerIdentityDataSource_basic
=== PAUSE TestAccSTSCallerIdentityDataSource_basic
=== CONT  TestAccSTSCallerIdentityDataSource_basic
--- PASS: TestAccSTSCallerIdentityDataSource_basic (37.92s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/sts	42.555s

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. labels Sep 7, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 7, 2023
@YakDriver YakDriver changed the title f new regexache Regular expression guide Sep 7, 2023
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Just one formatting suggestion.

Comment on lines 13 to 14
7. Example 1, both equivalent, Wrong order: `[_a-zA-Z0-9-,.]`, Correct: `[0-9A-Za-z_,.-]`
8. Example 2, both equivalent, Wrong order: `[;a-z0-9]`, Correct: `[0-9a-z;]`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move these examples outside the recommended ordering bullets?

Suggested change
7. Example 1, both equivalent, Wrong order: `[_a-zA-Z0-9-,.]`, Correct: `[0-9A-Za-z_,.-]`
8. Example 2, both equivalent, Wrong order: `[;a-z0-9]`, Correct: `[0-9a-z;]`
- Example 1, both equivalent, Wrong order: `[_a-zA-Z0-9-,.]`, Correct: `[0-9A-Za-z_,.-]`
- Example 2, both equivalent, Wrong order: `[;a-z0-9]`, Correct: `[0-9a-z;]`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice


Regular expressions are a powerful tool. However, they are also very expensive in terms of memory. Ensuring correct and useful functionality is the priority but we have a few tips to minimize impact without affecting capabilities.

* **Consider non-regular expressions options.** [`strings.Contains()`](https://pkg.go.dev/strings#Contains), [`strings.Replace()`](https://pkg.go.dev/strings#Replace), and [`strings.ReplaceAll()`](https://pkg.go.dev/strings#ReplaceAll) are dramatically faster and less memory intensive than regular expressions. If one of these will work equally well, use the non-regular expression option.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that many (most?) of the regular expressions (at least in my experience) are used in attribute validators, maybe add some links to standard validators that can be used instead of rolling your own regex validator?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note above is just a suggestion for a future version of this page.
LGTM 🚀.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! Would be great if we had far fewer "manual" regular expressions.

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/lambda Issues and PRs that pertain to the lambda service. service/iam Issues and PRs that pertain to the iam service. service/ec2 Issues and PRs that pertain to the ec2 service. service/s3 Issues and PRs that pertain to the s3 service. service/ecs Issues and PRs that pertain to the ecs service. service/emr Issues and PRs that pertain to the emr service. service/route53 Issues and PRs that pertain to the route53 service. service/guardduty Issues and PRs that pertain to the guardduty service. service/configservice Issues and PRs that pertain to the configservice service. service/elbv2 Issues and PRs that pertain to the elbv2 service. service/apigateway Issues and PRs that pertain to the apigateway service. and removed size/XS Managed by automation to categorize the size of a PR. size/XL Managed by automation to categorize the size of a PR. labels Sep 7, 2023
@github-actions github-actions bot added service/ipam Issues and PRs that pertain to the ipam service. service/ds Issues and PRs that pertain to the ds service. service/logs Issues and PRs that pertain to the logs service. service/cognitoidp Issues and PRs that pertain to the cognitoidp service. service/dms Issues and PRs that pertain to the dms service. service/cloudcontrol Issues and PRs that pertain to the cloudcontrol service. service/evidently Issues and PRs that pertain to the evidently service. service/fis Issues and PRs that pertain to the fis service. service/scheduler Issues and PRs that pertain to the scheduler service. service/ivschat Issues and PRs that pertain to the ivschat service. service/resourceexplorer2 Issues and PRs that pertain to the resourceexplorer2 service. service/pipes Issues and PRs that pertain to the pipes service. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service. service/chimesdkmediapipelines Issues and PRs that pertain to the chimesdkmediapipelines service. service/chimesdkvoice Issues and PRs that pertain to the chimesdkvoice service. labels Sep 7, 2023
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Sep 8, 2023
@YakDriver YakDriver changed the title Regular expression guide Regular expression consistency Sep 8, 2023
@YakDriver YakDriver merged commit 20aa761 into main Sep 8, 2023
70 checks passed
@YakDriver YakDriver deleted the f-new-regexache branch September 8, 2023 00:38
@github-actions github-actions bot added this to the v5.16.0 milestone Sep 8, 2023
github-actions bot pushed a commit that referenced this pull request Sep 8, 2023
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

This functionality has been released in v5.16.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/accessanalyzer Issues and PRs that pertain to the accessanalyzer service. service/account Issues and PRs that pertain to the account service. service/apigateway Issues and PRs that pertain to the apigateway service. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. service/appconfig Issues and PRs that pertain to the appconfig service. service/appflow Issues and PRs that pertain to the appflow service. service/appintegrations Issues and PRs that pertain to the appintegrations service. service/appsync Issues and PRs that pertain to the appsync service. service/athena Issues and PRs that pertain to the athena service. service/backup Issues and PRs that pertain to the backup service. service/batch Issues and PRs that pertain to the batch service. service/chimesdkmediapipelines Issues and PRs that pertain to the chimesdkmediapipelines service. service/chimesdkvoice Issues and PRs that pertain to the chimesdkvoice service. service/cloudcontrol Issues and PRs that pertain to the cloudcontrol service. service/cloudformation Issues and PRs that pertain to the cloudformation service. service/cloudfront Issues and PRs that pertain to the cloudfront service. service/cloudsearch Issues and PRs that pertain to the cloudsearch service. service/cloudwatch Issues and PRs that pertain to the cloudwatch service. service/codebuild Issues and PRs that pertain to the codebuild service. service/codegurureviewer Issues and PRs that pertain to the codegurureviewer service. service/codepipeline Issues and PRs that pertain to the codepipeline service. service/codestarnotifications Issues and PRs that pertain to the codestarnotifications service. service/cognitoidp Issues and PRs that pertain to the cognitoidp service. service/comprehend Issues and PRs that pertain to the comprehend service. service/configservice Issues and PRs that pertain to the configservice service. service/connect Issues and PRs that pertain to the connect service. service/datasync Issues and PRs that pertain to the datasync service. service/directconnect Issues and PRs that pertain to the directconnect service. service/dms Issues and PRs that pertain to the dms service. service/docdb Issues and PRs that pertain to the docdb service. service/ds Issues and PRs that pertain to the ds service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/ec2 Issues and PRs that pertain to the ec2 service. service/ecr Issues and PRs that pertain to the ecr service. service/ecrpublic Issues and PRs that pertain to the ecrpublic service. service/ecs Issues and PRs that pertain to the ecs service. service/eks Issues and PRs that pertain to the eks service. service/elasticache Issues and PRs that pertain to the elasticache service. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. service/elastictranscoder Issues and PRs that pertain to the elastictranscoder service. service/elbv2 Issues and PRs that pertain to the elbv2 service. service/emr Issues and PRs that pertain to the emr service. service/emrcontainers Issues and PRs that pertain to the emrcontainers service. service/events Issues and PRs that pertain to the events service. service/evidently Issues and PRs that pertain to the evidently service. service/fis Issues and PRs that pertain to the fis service. service/fsx Issues and PRs that pertain to the fsx service. service/glacier Issues and PRs that pertain to the glacier service. service/globalaccelerator Issues and PRs that pertain to the globalaccelerator service. service/glue Issues and PRs that pertain to the glue service. service/guardduty Issues and PRs that pertain to the guardduty service. service/iam Issues and PRs that pertain to the iam service. service/identitystore Issues and PRs that pertain to the identitystore service. service/imagebuilder Issues and PRs that pertain to the imagebuilder service. service/iot Issues and PRs that pertain to the iot service. service/ipam Issues and PRs that pertain to the ipam service. service/ivs Issues and PRs that pertain to the ivs service. service/ivschat Issues and PRs that pertain to the ivschat service. service/kendra Issues and PRs that pertain to the kendra service. service/keyspaces Issues and PRs that pertain to the keyspaces service. service/kinesisanalytics Issues and PRs that pertain to the kinesisanalytics service. service/kinesisanalyticsv2 Issues and PRs that pertain to the kinesisanalyticsv2 service. service/kinesisvideo Issues and PRs that pertain to the kinesisvideo service. service/kms Issues and PRs that pertain to the kms service. service/lambda Issues and PRs that pertain to the lambda service. service/lightsail Issues and PRs that pertain to the lightsail service. service/logs Issues and PRs that pertain to the logs service. service/memorydb Issues and PRs that pertain to the memorydb service. service/mq Issues and PRs that pertain to the mq service. service/neptune Issues and PRs that pertain to the neptune service. service/networkfirewall Issues and PRs that pertain to the networkfirewall service. service/networkmanager Issues and PRs that pertain to the networkmanager service. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service. service/organizations Issues and PRs that pertain to the organizations service. service/outposts Issues and PRs that pertain to the outposts service. service/pipes Issues and PRs that pertain to the pipes service. service/qldb Issues and PRs that pertain to the qldb service. service/quicksight Issues and PRs that pertain to the quicksight service. service/rds Issues and PRs that pertain to the rds service. service/redshift Issues and PRs that pertain to the redshift service. service/resourceexplorer2 Issues and PRs that pertain to the resourceexplorer2 service. service/route53domains Issues and PRs that pertain to the route53domains service. service/route53resolver Issues and PRs that pertain to the route53resolver service. service/route53 Issues and PRs that pertain to the route53 service. service/s3control Issues and PRs that pertain to the s3control service. service/s3outposts Issues and PRs that pertain to the s3outposts service. service/s3 Issues and PRs that pertain to the s3 service. service/sagemaker Issues and PRs that pertain to the sagemaker service. service/scheduler Issues and PRs that pertain to the scheduler service. service/schemas Issues and PRs that pertain to the schemas service. service/securityhub Issues and PRs that pertain to the securityhub service. service/servicediscovery Issues and PRs that pertain to the servicediscovery service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants