aws cloudformation describe-stacks

0.0% Savings
0 Commands
0 Tokens saved
2 Tests

Install

tokf install b5e9ae4bb76f49b2e9ef7f9bd30cd4705d815bc596893d18400e8f493cc235c7
Safety checks passed

Filter definition

command = "aws cloudformation describe-stacks"

strip_ansi = true
collapse_empty_lines = true

skip = [
    "^\\s+\"ParameterKey\":",
    "^\\s+\"ParameterValue\":",
    "^\\s+\"NotificationARNs\":",
    "^\\s+\"Tags\":",
    "^\\s+\"Key\":",
    "^\\s+\"Value\":",
    "^\\s+\"EnableTerminationProtection\":",
    "^\\s+\"DriftInformation\":",
    "^\\s+\"StackDriftStatus\":",
    "^\\s+\"RoleARN\":",
]

keep = [
    "\"StackName\":",
    "\"StackStatus\":",
    "\"OutputKey\":",
    "\"OutputValue\":",
    "\"Description\":",
    "(?i)error",
    "(?i)failed",
    "ROLLBACK",
]

[on_failure]
tail = 30

Examples

failure shows error and rollback status ~95 tokens → ~46 tokens (52% saved)
Raw output
{
    "Stacks": [
        {
            "StackName": "gw-api-dev",
            "StackStatus": "ROLLBACK_COMPLETE",
            "Tags": [
                {
                    "Key": "Environment",
                    "Value": "dev"
                }
            ]
        }
    ]
}

An error occurred (ValidationError) when calling the DescribeStacks operation: Stack does not exist
Filtered output
            "StackName": "gw-api-dev",
            "StackStatus": "ROLLBACK_COMPLETE",
An error occurred (ValidationError) when calling the DescribeStacks operation: Stack does not exist
success filters parameter noise and keeps stack status ~187 tokens → ~62 tokens (67% saved)
Raw output
{
    "Stacks": [
        {
            "StackName": "gw-api-dev",
            "StackStatus": "CREATE_COMPLETE",
            "Description": "GW API infrastructure",
            "EnableTerminationProtection": false,
            "DriftInformation": {
                "StackDriftStatus": "NOT_CHECKED"
            },
            "Tags": [
                {
                    "Key": "Environment",
                    "Value": "dev"
                }
            ],
            "ParameterKey": "LambdaMemory",
            "ParameterValue": "128",
            "Outputs": [
                {
                    "OutputKey": "ApiUrl",
                    "OutputValue": "https://api.dev.generalwisdom.com"
                }
            ]
        }
    ]
}
Filtered output
            "StackName": "gw-api-dev",
            "StackStatus": "CREATE_COMPLETE",
            "Description": "GW API infrastructure",
                    "OutputKey": "ApiUrl",
                    "OutputValue": "https://api.dev.generalwisdom.com"
Warning: Community filters are third-party code. Review the filter definition above before installing it in production environments.
Browse all filters