Skip to content

Get-EC2Subnet filter does not honour wildcards like '*' and '?' #400

@siriuschan9

Description

@siriuschan9

Describe the bug

Cmdlet: Get-EC2Subnet
Parameter: -Filter

When the Name property of the -Filter parameter is 'subnet-id', the filtering behaviour does not honour wildcards like '*' and '?'.

For example:

Get-EC2Subnet -Filter @{Name = 'subnet-id'; Values = '*'}

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

I expect the command in the example to return all Subnets.

Current Behavior

Nothing is returned.

Reproduction Steps

Get-EC2Subnet -Filter @{Name = 'subnet-id'; Values = '*'}

Possible Solution

No response

Additional Information/Context

This command will return all VPC.
Get-EC2Vpc -Filter @{Name = 'vpc-id'; Values = '*'}

This command will return all Internet Gateways.
Get-EC2InternetGateway -Filter @{Name = 'internet-gateway-id'; Values = '*'}

But - this command returns nothing.
Get-EC2Subnet -Filter @{Name = 'subnet-id'; Values = '*'}

AWS Tools for PowerShell version used

Name Version


AWS.Tools.EC2 5.0.45

PowerShell version used

Name Value


PSVersion 7.5.3
PSEdition Core
GitCommitId 7.5.3
OS Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:28:17 PDT 2025; root:xnu-11417.140.69~1/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Operating System and version

macOS Sequoia v15.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-reviewservice-apiThis issue is due to a problem in a service API, not the SDK implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions