Skip to content

Using Edit-EC2VpcAttribute to modify NAU attribute does not go through. #404

@siriuschan9

Description

@siriuschan9

Describe the bug

When using Edit-EC2VpcAttribute to modify NAU attribute, for example:

Edit-EC2VpcAttribute -EnableNetworkAddressUsageMetric $true vpc-xxxxxxxxxxxxxxxxx

It will complain that the -EnableDnsSupport parameter needs to be provided.

cmdlet Edit-EC2VpcAttribute at command pipeline position 1
Supply values for the following parameters:
EnableDnsSupport:

When I specify the -EnableDnsSupport parameter together, it complains that I cannot specify multiple attributes.

Edit-EC2VpcAttribute -EnableDnsSupport $true -EnableNetworkAddressUsageMetric $true vpc-xxxxxxxxxxxxxxxxx

Edit-EC2VpcAttribute: Fields for multiple attribute types specified: enableDnsSupport, enableNetworkAddressUsageMetrics

This seems to be a bug in the powershell cmdlet because when I use AWS CLI, it will work as expected -i.e. I do not have to specify --enable-dns-support nor no--enable-dns-support.

aws ec2 modify-vpc-attribute --vpc-id vpc-xxxxxxxxxxxxxxxxx --enable-network-address-usage-metrics

Regression Issue

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

Expected Behavior

I expect that when using the Edit-EC2VpcAttribute cmdlet to modify VPC NAU attribute, it should not require the -EnableDnsSupport parameter. According to the documentation, each API call can modify one attribute only.

Current Behavior

The cmdlet will ask for -EnableDnsSupport value when specifying -EnableNetworkAddressUsage parameter.

After -EnableDnsSupport value is provied, it will complain modifying multiple attributes is not allowed.

Reproduction Steps

Edit-EC2VpcAttribute -EnableNetworkAddressUsageMetric $true vpc-xxxxxxxxxxxxxxxxx

Edit-EC2VpcAttribute -EnableDnsSupport $true -EnableNetworkAddressUsageMetric $true vpc-xxxxxxxxxxxxxxxxx

Possible Solution

No response

Additional Information/Context

No response

AWS Tools for PowerShell version used

5.0.83 AWS.Tools.EC2

PowerShell version used

Name Value
---- -----
PSVersion 7.5.4
PSEdition Core
GitCommitId 7.5.4
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 15.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.queued

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions