|
| 1 | +# AWS CLI — expanded filter matching rtk's 25-subcommand coverage. |
| 2 | +# Each section targets one verb (ec2 describe, s3 ls, etc). |
| 3 | +# Order matters: more specific rules first, generic aws fallback last. |
| 4 | +schema_version = 1 |
| 5 | + |
| 6 | +# --- compute: EC2 --- |
| 7 | +[aws_ec2_describe] |
| 8 | +match_command = "^aws\\s+ec2\\s+describe" |
| 9 | +strip_ansi = true |
| 10 | +strip_lines_matching = ["^\\s*$"] |
| 11 | +keep_lines_matching = [ |
| 12 | + "InstanceId", "State\\s*:", "PublicIpAddress", "PrivateIpAddress", |
| 13 | + "InstanceType", "Tags", "VpcId", "SubnetId", "AvailabilityZone", |
| 14 | +] |
| 15 | +max_lines = 200 |
| 16 | + |
| 17 | +[aws_ec2_run] |
| 18 | +match_command = "^aws\\s+ec2\\s+run-instances" |
| 19 | +strip_ansi = true |
| 20 | +keep_lines_matching = ["InstanceId", "State", "Tags"] |
| 21 | +max_lines = 60 |
| 22 | + |
| 23 | +[aws_ec2_stop] |
| 24 | +match_command = "^aws\\s+ec2\\s+(stop|start|terminate|reboot)-instances" |
| 25 | +strip_ansi = true |
| 26 | +keep_lines_matching = ["CurrentState", "InstanceId", "PreviousState"] |
| 27 | +max_lines = 40 |
| 28 | + |
| 29 | +# --- storage: S3 --- |
| 30 | +[aws_s3_ls] |
| 31 | +match_command = "^aws\\s+s3(\\s+ls)?\\b" |
| 32 | +strip_ansi = true |
| 33 | +strip_lines_matching = ["^PRE\\b", "^\\s*$"] |
| 34 | +max_lines = 100 |
| 35 | + |
| 36 | +[aws_s3_cp] |
| 37 | +match_command = "^aws\\s+s3\\s+(cp|mv|sync|rm)\\b" |
| 38 | +strip_ansi = true |
| 39 | +strip_lines_matching = ["^Completed \\d"] |
| 40 | +keep_lines_matching = ["^(upload|download|copy|move|delete):", "error"] |
| 41 | +max_lines = 60 |
| 42 | + |
| 43 | +[aws_s3api] |
| 44 | +match_command = "^aws\\s+s3api\\b" |
| 45 | +strip_ansi = true |
| 46 | +strip_lines_matching = ["^\\s*$"] |
| 47 | +max_lines = 100 |
| 48 | + |
| 49 | +# --- lambda --- |
| 50 | +[aws_lambda_list] |
| 51 | +match_command = "^aws\\s+lambda\\s+list" |
| 52 | +strip_ansi = true |
| 53 | +keep_lines_matching = ["FunctionName", "Runtime", "LastModified", "State"] |
| 54 | +max_lines = 100 |
| 55 | + |
| 56 | +[aws_lambda_get] |
| 57 | +match_command = "^aws\\s+lambda\\s+get" |
| 58 | +strip_ansi = true |
| 59 | +keep_lines_matching = ["FunctionName", "State", "Runtime", "Handler", "Timeout", "MemorySize"] |
| 60 | +max_lines = 40 |
| 61 | + |
| 62 | +[aws_lambda_invoke] |
| 63 | +match_command = "^aws\\s+lambda\\s+invoke" |
| 64 | +strip_ansi = true |
| 65 | +keep_lines_matching = ["StatusCode", "FunctionError", "ExecutedVersion", "LogResult"] |
| 66 | +max_lines = 20 |
| 67 | + |
| 68 | +# --- iam --- |
| 69 | +[aws_iam] |
| 70 | +match_command = "^aws\\s+iam\\b" |
| 71 | +strip_ansi = true |
| 72 | +strip_lines_matching = ["^\\s*$"] |
| 73 | +keep_lines_matching = [ |
| 74 | + "UserName", "GroupName", "RoleName", "PolicyName", |
| 75 | + "Arn", "CreateDate", "AttachedPolicies", |
| 76 | +] |
| 77 | +max_lines = 100 |
| 78 | + |
| 79 | +# --- databases: RDS / DynamoDB --- |
| 80 | +[aws_rds] |
| 81 | +match_command = "^aws\\s+rds\\b" |
| 82 | +strip_ansi = true |
| 83 | +keep_lines_matching = [ |
| 84 | + "DBInstanceIdentifier", "DBInstanceStatus", "Engine", |
| 85 | + "Endpoint", "Address", "Port", "AvailabilityZone", |
| 86 | +] |
| 87 | +max_lines = 80 |
| 88 | + |
| 89 | +[aws_dynamodb] |
| 90 | +match_command = "^aws\\s+dynamodb\\b" |
| 91 | +strip_ansi = true |
| 92 | +keep_lines_matching = [ |
| 93 | + "TableName", "TableStatus", "ItemCount", "TableSizeBytes", |
| 94 | + "KeySchema", "AttributeDefinitions", "GlobalSecondaryIndexes", |
| 95 | +] |
| 96 | +max_lines = 80 |
| 97 | + |
| 98 | +# --- containers: ECS / EKS / ECR --- |
| 99 | +[aws_ecs] |
| 100 | +match_command = "^aws\\s+ecs\\b" |
| 101 | +strip_ansi = true |
| 102 | +keep_lines_matching = [ |
| 103 | + "clusterName", "serviceName", "taskArn", "status", |
| 104 | + "runningCount", "desiredCount", "pendingCount", |
| 105 | +] |
| 106 | +max_lines = 80 |
| 107 | + |
| 108 | +[aws_eks] |
| 109 | +match_command = "^aws\\s+eks\\b" |
| 110 | +strip_ansi = true |
| 111 | +keep_lines_matching = [ |
| 112 | + "name\\s*:", "status", "version", "roleArn", "endpoint", |
| 113 | + "nodegroupName", "clusterName", |
| 114 | +] |
| 115 | +max_lines = 60 |
| 116 | + |
| 117 | +[aws_ecr] |
| 118 | +match_command = "^aws\\s+ecr\\b" |
| 119 | +strip_ansi = true |
| 120 | +keep_lines_matching = [ |
| 121 | + "repositoryName", "repositoryUri", "imageTag", "imageDigest", |
| 122 | + "registryId", |
| 123 | +] |
| 124 | +max_lines = 60 |
| 125 | + |
| 126 | +# --- infra: CloudFormation / CloudWatch / Logs --- |
| 127 | +[aws_cloudformation] |
| 128 | +match_command = "^aws\\s+cloudformation\\b" |
| 129 | +strip_ansi = true |
| 130 | +keep_lines_matching = [ |
| 131 | + "StackName", "StackStatus", "CREATE_COMPLETE", "CREATE_FAILED", |
| 132 | + "UPDATE_COMPLETE", "UPDATE_FAILED", "DELETE_COMPLETE", "ROLLBACK", |
| 133 | + "StackId", "LogicalResourceId", |
| 134 | +] |
| 135 | +max_lines = 100 |
| 136 | + |
| 137 | +[aws_cloudwatch] |
| 138 | +match_command = "^aws\\s+cloudwatch\\b" |
| 139 | +strip_ansi = true |
| 140 | +keep_lines_matching = [ |
| 141 | + "AlarmName", "StateValue", "MetricName", "Namespace", |
| 142 | + "Threshold", "ComparisonOperator", |
| 143 | +] |
| 144 | +max_lines = 80 |
| 145 | + |
| 146 | +[aws_logs] |
| 147 | +match_command = "^aws\\s+logs\\b" |
| 148 | +strip_ansi = true |
| 149 | +strip_lines_matching = ["^\\s*$"] |
| 150 | +max_lines = 200 |
| 151 | + |
| 152 | +# --- networking: VPC / ELB / Route53 --- |
| 153 | +[aws_ec2_vpc] |
| 154 | +match_command = "^aws\\s+ec2\\s+(describe-vpcs|describe-subnets|describe-security-groups|describe-route-tables)" |
| 155 | +strip_ansi = true |
| 156 | +keep_lines_matching = [ |
| 157 | + "VpcId", "SubnetId", "CidrBlock", "GroupId", "GroupName", |
| 158 | + "IsDefault", "State", "Tags", |
| 159 | +] |
| 160 | +max_lines = 120 |
| 161 | + |
| 162 | +[aws_elbv2] |
| 163 | +match_command = "^aws\\s+elb(v2)?\\b" |
| 164 | +strip_ansi = true |
| 165 | +keep_lines_matching = [ |
| 166 | + "LoadBalancerName", "LoadBalancerArn", "DNSName", "State", "Type", |
| 167 | + "TargetGroupName", "TargetGroupArn", |
| 168 | +] |
| 169 | +max_lines = 60 |
| 170 | + |
| 171 | +[aws_route53] |
| 172 | +match_command = "^aws\\s+route53\\b" |
| 173 | +strip_ansi = true |
| 174 | +keep_lines_matching = [ |
| 175 | + "HostedZoneId", "Name", "ResourceRecordSets", "Type", |
| 176 | + "TTL", "Value", |
| 177 | +] |
| 178 | +max_lines = 80 |
| 179 | + |
| 180 | +# --- messaging: SNS / SQS --- |
| 181 | +[aws_sns] |
| 182 | +match_command = "^aws\\s+sns\\b" |
| 183 | +strip_ansi = true |
| 184 | +keep_lines_matching = ["TopicArn", "SubscriptionArn", "MessageId", "Protocol", "Endpoint"] |
| 185 | +max_lines = 60 |
| 186 | + |
| 187 | +[aws_sqs] |
| 188 | +match_command = "^aws\\s+sqs\\b" |
| 189 | +strip_ansi = true |
| 190 | +keep_lines_matching = ["QueueUrl", "QueueArn", "ApproximateNumberOfMessages", "MessageId"] |
| 191 | +max_lines = 60 |
| 192 | + |
| 193 | +# --- secrets & config: SSM / Secrets Manager / KMS --- |
| 194 | +[aws_ssm] |
| 195 | +match_command = "^aws\\s+ssm\\b" |
| 196 | +strip_ansi = true |
| 197 | +keep_lines_matching = ["Name", "Value", "Type", "ParameterType", "LastModifiedDate"] |
| 198 | +max_lines = 80 |
| 199 | + |
| 200 | +[aws_secretsmanager] |
| 201 | +match_command = "^aws\\s+secretsmanager\\b" |
| 202 | +strip_ansi = true |
| 203 | +keep_lines_matching = ["Name", "ARN", "VersionId", "VersionStages", "LastChangedDate"] |
| 204 | +max_lines = 40 |
| 205 | + |
| 206 | +[aws_kms] |
| 207 | +match_command = "^aws\\s+kms\\b" |
| 208 | +strip_ansi = true |
| 209 | +keep_lines_matching = ["KeyId", "Arn", "KeyState", "Description", "Enabled"] |
| 210 | +max_lines = 40 |
| 211 | + |
| 212 | +# --- identity --- |
| 213 | +[aws_sts] |
| 214 | +match_command = "^aws\\s+sts\\b" |
| 215 | +strip_ansi = true |
| 216 | +keep_lines_matching = ["Account", "Arn", "UserId", "AccessKeyId"] |
| 217 | +max_lines = 20 |
| 218 | + |
| 219 | +# --- generic fallback (lowest priority — last match wins) --- |
| 220 | +[aws_generic] |
| 221 | +match_command = "^aws\\s+" |
| 222 | +strip_ansi = true |
| 223 | +strip_lines_matching = ["^\\s*$"] |
| 224 | +max_lines = 150 |
0 commit comments