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-ECSTaskDetail Returns Only ServiceName #136

Closed oliveirafilipe closed 4 years ago

oliveirafilipe commented 4 years ago

Hi Everyone, I'm facing some issue while trying to use Get-ECSTaskDetail. I will try to explain better:

Expected Behavior

I expect to receive a complete detail of the services passed as parameter to the command. Just like i can get in AWS CLI aws ecs describe-services --cluster foo-cluster --services bar-service

{
    "services": [
        {
            "networkConfiguration": {
                "awsvpcConfiguration": {
                    "subnets": [
                        "subnet-abc", 
                        "subnet-def", 
                        "subnet-ghi"
                    ], 
                    "securityGroups": [
                        "sg-foobar"
                    ], 
                    "assignPublicIp": "DISABLED"
                }
            }, 
            "launchType": "FARGATE", 
            "enableECSManagedTags": false, 
           ....

Current Behavior Just the Service Name is Returned, as show:

PS /> Get-ECSService -Cluster foo-cluster -Service bar-service                                    

Failures Services
-------- --------
{}       {bar-service}

PS /> Get-ECSService -Cluster foo-cluster -Service arn:aws:ecs:us-east-1:123456789123:service/bar-service

Failures Services
-------- --------
{}       {bar-service}

Possible Solution

N/A

Steps to Reproduce (for bugs)

Context

I Expect to use this command Inside Octopus. Inspired by this tutorial. But for now I'm just testing in my computer using docker

Your Environment

PS /> Get-InstalledModule

Version              Name                                Repository           Description
-------              ----                                ----------           -----------
4.0.4.0              AWS.Tools.ECS                       PSGallery            The ECS module of AWS Tools ...
4.0.4.0              AWS.Tools.Common                    PSGallery            The AWS Tools ...

Docker Image: mcr.microsoft.com/powershell@sha256:a896a35c8f4d833d446786188945f42a75dccd2b63789458f6779d7979a4515f

My Host OS:

NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"

My Docker: Docker version 18.09.1, build 4c52b90

klaytaybai commented 4 years ago

I've reproduced what you are seeing, and I'm considering it as a bug unless I learn otherwise. I'll see what we can do to improve the UX and completion here.

klaytaybai commented 4 years ago

Please try Get-ECSService -Cluster foo-cluster -Service bar-service | ConvertTo-Json -Depth 100

oliveirafilipe commented 4 years ago

Hi @klaytaybai, sorry for the delay I will try it by monday, and give a response.

Anyway, I think that I just misunderstood the usage of this command. Thank for your help

oliveirafilipe commented 4 years ago

Please try Get-ECSService -Cluster foo-cluster -Service bar-service | ConvertTo-Json -Depth 100

Hi @klaytaybai just tested and it works fine :rocket:

Sorry for the misunderstanding, I guess that the issue can be closed now. Thank you for your help.