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

Waiters feature request #52

Open
hsuantio opened this issue Sep 25, 2019 · 7 comments
Open

Waiters feature request #52

hsuantio opened this issue Sep 25, 2019 · 7 comments
Labels
cross-sdk-parity feature-request A feature should be added or improved. module/powershell-cmdlets p2 This is a standard priority issue queued

Comments

@hsuantio
Copy link

Other AWS SDKs such as Python and Ruby have built-in waiters so developers don't have to write loop mechanism that waits until the action is completed.

@petervandivier
Copy link

By way of demonstration:

$getEc2 = [scriptblock]{Get-EC2Instance @($cluster.Instances.InstanceId)}

while((& $getEc2).Instances.State.Name -ne 'running'){
    Write-Host "Awaiting startup of all EC2 instances. Sleeping 5..." -ForegroundColor Yellow
    Start-Sleep -Seconds 5
} 

Write-Host "$(Get-Date) : all nodes report running" -ForegroundColor Blue

With a corresponding waiter loop for .State.Name -ne 'terminated' in teardown scripts.

@matteo-prosperi
Copy link
Contributor

Hello,
thank you for your feedback! I totally agree that waiters are a cool and useful feature.
This request is tracked in aws/aws-sdk-net#1336 for the AWS SDK for .NET on top of which this module is implemented. As soon as we can implement waiters in the .NET SDK, we can work to add them here as well.

@BrucePay
Copy link

The way to do this in PowerShell is to add an -AsJob parameter to the Cmdlet. When -AsJob is specified, the Cmdlet would return a Job object which would be manipulated with the standard Job cmdlets (Wait-Job, Receive-Job`, etc.). Of course, as Matteo points out, the underlying functionality needs to be there.

@pjmagee
Copy link

pjmagee commented Feb 10, 2020

CLI usage:

aws ec2 start-instances --instance-ids ${instanceId}
aws ec2 wait instance-status-ok --instance-ids ${instanceId}

What about behaving similar to the python aws cli?

Example Powershell usage:

Start-Ec2Instance -InstanceIds ${instanceIds}
Wait-Ec2Instance -Status Ok -InstanceIds ${instanceIds}

@ashishdhingra ashishdhingra added feature-request A feature should be added or improved. module/powershell-cmdlets labels Nov 5, 2020
@richardgavel
Copy link

Agreed, why can't the powershell just do what the CLI does?

@github-actions
Copy link

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 11, 2022
@ashovlin ashovlin reopened this Nov 17, 2022
@ashishdhingra ashishdhingra added needs-major-version Can only be considered for the next major release p2 This is a standard priority issue cross-sdk-parity and removed Requires AWS SDK change enhancement New feature or request labels Dec 14, 2022
@ashishdhingra
Copy link
Contributor

PowerShell needs to be revisited once the related .NET SDK issue aws/aws-sdk-net#1336 is implemented.

@ashishdhingra ashishdhingra added queued and removed needs-review needs-major-version Can only be considered for the next major release labels May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-sdk-parity feature-request A feature should be added or improved. module/powershell-cmdlets p2 This is a standard priority issue queued
Projects
None yet
Development

No branches or pull requests

8 participants