aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
235 stars 78 forks source link

Get-EC2NetworkInterface -name attribute /AWS Console #222

Closed manuelh2410 closed 3 years ago

manuelh2410 commented 3 years ago

Good Day,

I have come across another anomaly.

This issue/bug consists of two parts.

Part one : If you check the AWS console, you will see that the console offers an option to enter a "name" for the vpc volumes in your account Yet if you compare this to the documentation for both the "Get-EC2NetworkInterface" command-let and the "Amazon.EC2.Model.NetworkInterface object" you will see that the "name" property is not available for the "Amazon.EC2.Model.NetworkInterface" object, nor is possible to query your volumes based the "name" attribute, see the "Get-EC2NetworkInterface" documentation.

The second part of this anomaly is that when one adds a "name" to a volume, the "Tags" property is populated with a "{Name}" value, instead of the name added in the AWS Console. I tested this with several volumes and the behaviour is the same each and every time.

NetworkInterfaceId : eni-xxxxxxxxxa07 TagSet : {Name}

NetworkInterfaceId : eni-xxxxxxxxxf8d TagSet : {Name}

NetworkInterfaceId : eni-xxxxxxxxxf41 TagSet : {Name}

This shows yet another inconsistency between the information in the AWS console and the available API calls. And in this case, It also shows that the "Tags" property for the "Amazon_EC2_Model_NetworkInterface" object is unreliable, specifically when you interact with this object using the EC2Console.

I have added screenshots to better illustrate my point.

PowerShell Module: PS C:\Windows\System32> get-installedModule -name AWS

Version Name Repository Description

4.1.12.0 AWSPowerShell.NetCore PSGallery The AWS Tools for PowerShell lets develo…

Powershell version:

PS C:\Windows\System32> $PSVersionTable

Name Value

PSVersion 7.1.3 PSEdition Core GitCommitId 7.1.3 OS Microsoft Windows 10.0.19042 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2NetworkInterface.html https://docs.aws.amazon.com/sdkfornet/v3/apidocs/index.html?page=EC2/TEC2NetworkInterface.html&tocid=Amazon_EC2_Model_NetworkInterface https://docs.aws.amazon.com/sdkfornet/v3/apidocs/index.html?page=EC2/TEC2DescribeNetworkInterfacesResponse.html&tocid=Amazon_EC2_Model_DescribeNetworkInterfacesResponse ENI

ashishdhingra commented 3 years ago

Hi @manuelh2410,

Good morning.

Could you please share screenshot and steps which allowed you to specify Name while creating a Network Interface. I do not see any such field in AWS console, there is option to specify tags and description.

Screen Shot 2021-06-14 at 10 45 29 AM

Thanks, Ashish

manuelh2410 commented 3 years ago

Good Day ,

Thanks for investigating, your time and your update, but no, this does not help, nor do your troubleshooting steps represent the steps I took to replicate the behaviour .

The object does not contain the -Name attribute , and yet , there is a Name attribute clearly shown in the EC2 console . When you interact with the name attribute in the AWS console , the "Tag" attribute of the object is populated .

You can see how this is unreliable , unexpected and plain wrong

This is clearly a bug .

ashishdhingra commented 3 years ago

Good Day ,

Thanks for investigating, your time and your update, but no, this does not help, nor do your troubleshooting steps represent the steps I took to replicate the behaviour .

The object does not contain the -Name attribute , and yet , there is a Name attribute clearly shown in the EC2 console . When you interact with the name attribute in the AWS console , the "Tag" attribute of the object is populated .

You can see how this is unreliable , unexpected and plain wrong

This is clearly a bug .

@manuelh2410 It would be helpful if you could provide details on where you were able to specify the Name field in the AWS console UI. From investigation to other related issues, it appears that AWS Console is displaying value to tag Name in the list. This is not an issue with the PowerShell tools or AWS .NET SDK. You may try to create an issue with support for inconsistent AWS Console UI behavior using Support option in AWS Console.

manuelh2410 commented 3 years ago

Correct, I found the same issue with 3 other command-lets. I know the difference between a -name attribute, and a "name" "value" tag. The documentation clearly makes that destinction. So lets not conflate the two . The object does not have a name attribute that is correct and we have already established that .But when I populate the -name attribute for an already existing object in the AWS Console, and then querry my object using the AWS-Powershell tools the "Tag" object attribute is populated with an obscure " {Name}" value instead of listing a -Name attribute ,with the value I added trough the aws console . again , it does not seem very client obsessed to ask or demand that I open yet another case for this issue . And If possible I would like you to discuss this with your superiors or colleagues before pushing back on this .

Its the object which is missing the -Name attribute . and I stated at the beginning that this is a two-part issue.

1- An issue with the object (missing attribute /incorrect population of an incorrect attribute) 2- An issue when populating the name attribute using the AWS Console

ashishdhingra commented 3 years ago

Correct, I found the same issue with 3 other command-lets. I know the difference between a -name attribute, and a "name" "value" tag. The documentation clearly makes that destinction. So lets not conflate the two . The object does not have a name attribute that is correct and we have already established that .But when I populate the -name attribute for an already existing object in the AWS Console, and then querry my object using the AWS-Powershell tools the "Tag" object attribute is populated with an obscure " {Name}" value instead of listing a -Name attribute ,with the value I added trough the aws console . again , it does not seem very client obsessed to ask or demand that I open yet another case for this issue . And If possible I would like you to discuss this with your superiors or colleagues before pushing back on this .

Its the object which is missing the -Name attribute . and I stated at the beginning that this is a two-part issue.

1- An issue with the object (missing attribute /incorrect population of an incorrect attribute) 2- An issue when populating the name attribute using the AWS Console

@manuelh2410 Let me discuss with the team and if possible, would create an issue with appropriate service team. The reason I requested you to open the issue using the Support option is for easy tracking and direct communication from service team. I will post an update here based on my discussion.

ashishdhingra commented 3 years ago

Related issues:

ashishdhingra commented 3 years ago

Upon further investigation, For AWS Console Create Network Interface allows to assign tags. For testing, tag named Name and value TestNI was created. The Network Interface list displayed the value of this tag in Name column:

Screen Shot 2021-06-14 at 12 21 04 PM

Clicking on Settings for the list displays dialog which selects Name tag by default to be displayed as one of the columns:

Screen Shot 2021-06-14 at 12 22 07 PM

Hence, clearly, Name column is mapped to tag named Name.

For PowerShell CmdLet: The output of the CmdLet is controlled by PowerShell console. The TagSet property is an array, hence it displays the Name property in curly braces. For testing, I added another tag named TestTag and now the output is shown below:

Screen Shot 2021-06-14 at 12 24 31 PM

Hope this provides detailed explanation.

manuelh2410 commented 3 years ago

Being a graphical user interface, One assumes that the AWS Console is a 1 to 1 representation of objects, attributes, their related data, and the associated API functionality.

In line with this, any end-user would assume that the data stored in the NAME column would represent the data linked to the -Name Parameter of the object being shown (displayed), an not that of a "mapped" to a Tag: key Value pair.

In this scenario e both established that this is clearly not the case.

If you check the example I included you can clearly see that the Get-EC2Image command-let returns both a Name attribute with its corresponding "my-image" value and a separate Tags attribute with the corresponding, albeit obscure {name} value.

So please tell me how is it logically sound, to have the Name attribute of an object, not map to the Name column of a graphical user interface displaying that same object.

And how is it possible that not all user-configurable objects have a Name attribute, while the console clearly provides a designated "Name" column

If you like I can check with the graphical user interfaces of competing cloud providers in order to confirm if what I am suggesting /asking is unreasonable.

In case someone asks me, Is it safe to conclude that not all object attributes have a 1 to 1 mapping with what is displayed in the AWS console ?

https://docs.aws.amazon.com/sdkfornet/v3/apidocs/index.html?page=EC2/TEC2Image.html&tocid=Amazon_EC2_Model_Image Get-EC2Image

ashishdhingra commented 3 years ago

@manuelh2410 For graphical user interface issues, please submit the feedback using the option provided in the AWS Console. In case you face any PowerShell related issues, feel free to open a new issue.

github-actions[bot] commented 3 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.