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

ec2 describe-route-tables with filter "Name=association.main,Values=false" not working as expected #1810

Closed
levequej opened this issue Feb 24, 2016 · 3 comments
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made.

Comments

@levequej
Copy link

I was hoping to use this filter in combination with "Name=vpc-id,Values=$VPC_ID" to get all route table while discarding the VPC's main route table, but this also filters out route tables with "Associations": [], where it should not.

Here is a example to illustrate the problem

$ aws ec2 describe-route-tables --filters "Name=vpc-id,Values=$VPC_ID" 
{
    "RouteTables": [
        {
            "RouteTableId": "rtb-186a857c",
            "PropagatingVgws": [],
            "Tags": [
                {
                    "Value": "dev-vpc-default-gw-routing-table",
                    "Key": "Name"
                }
            ],
            "Associations": [],
            "Routes": [
                {
                    "State": "active",
                    "DestinationCidrBlock": "10.0.0.0/16",
                    "GatewayId": "local",
                    "Origin": "CreateRouteTable"
                },
                {
                    "State": "blackhole",
                    "DestinationCidrBlock": "0.0.0.0/0",
                    "GatewayId": "igw-35fa8b50",
                    "Origin": "CreateRoute"
                }
            ],
            "VpcId": "vpc-09be846c"
        },
        {
            "RouteTableId": "rtb-096a856d",
            "PropagatingVgws": [],
            "Tags": [],
            "Associations": [
                {
                    "RouteTableId": "rtb-096a856d",
                    "RouteTableAssociationId": "rtbassoc-6469c600",
                    "Main": true
                }
            ],
            "Routes": [
                {
                    "State": "active",
                    "DestinationCidrBlock": "10.0.0.0/16",
                    "GatewayId": "local",
                    "Origin": "CreateRouteTable"
                }
            ],
            "VpcId": "vpc-09be846c"
        }
    ]
}

$ aws ec2 describe-route-tables --filters "Name=vpc-id,Values=$VPC_ID" "Name=association.main,Values=false"  
{
    "RouteTables": []
}
@jamesls
Copy link
Member

jamesls commented Feb 25, 2016

Looks like we're sending the request properly to EC2. Given this is a server side filter, this is a change that would need to be made on EC2's end.

The best solution you have now is to use the --filters server side filter along with --query, a client side filter to accomplish what you want:

aws ec2 describe-route-tables --filters "Name=vpc-id,Values=$VPC_ID" --query 'RouteTables[?Associations[0].Main != `true`]'

Does that work for you?

@jamesls jamesls added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Feb 25, 2016
@levequej
Copy link
Author

Thanks I wasn't looking for a workaround, I just meant to signal that the observed behavior is not what could be expected. I'll see to file a bug report in AWS forum (PS : do they have a better tool ? or is it still forum)

@jamesls
Copy link
Member

jamesls commented Feb 27, 2016

Ah ok, thanks for the feedback. The AWS forums are the best place to give feedback to service teams.

Sounds like there's nothing actionable right now from the CLI side. I'm going to go ahead and close out this issue. Let me know if I've missed something.

@jamesls jamesls closed this as completed Feb 27, 2016
thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this issue Feb 12, 2022
aws#1810)

Why is this change necessary?

* adding ruby2.7 changes the list of runtimes.

How does it address the issue?

* appropriate runtime is selected.

What side effects does this change have?

* None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made.
Projects
None yet
Development

No branches or pull requests

2 participants