-
Notifications
You must be signed in to change notification settings - Fork 863
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
No way to execute dry-run EC2 operations (e.g. StartInstances) #3595
Comments
@sstragier-prosperops Good afternoon. Thanks for opening the issue. The reason why
Your analysis appears to be correct. The logic here is checking that return type ends with To fix this issue, code here could have check based on conditional compilation symbols for different targets (we might also need to revisit other logic as well). The SetDryRunParameterCallback is just setting the request parameter This issue needs review with team. Thanks, |
Thanks for the follow up. Yes, I've been able to workaround by using the request's public static void SetDryRun(this AmazonWebServiceRequest request)
{
request.AddBeforeRequestHandler(SetDryRunParameterCallback);
void SetDryRunParameterCallback(object sender, RequestEventArgs args)
{
var a = args as WebServiceRequestEventArgs ?? throw new InvalidOperationException("Expected WebServiceRequestEventArgs");
a.ParameterCollection["DryRun"] = new StringParameterValue("true");
// After the callback has been invoked, remove it
request.RemoveBeforeRequestHandler(SetDryRunParameterCallback);
}
} |
Describe the bug
There doesn't appear to be a way to execute dry-run EC2 operations (e.g. StartInstances) since
DryRun
isn't a parameter of theStartInstancesRequest
and theDryRun
method inAmazonEC2Client
(which isn't exposed on the interface, #3594) doesn't work because it appears to be looking for the old non-async request methods which are no longer public.Regression Issue
Expected Behavior
I should be able to run EC2 operations that support a DryRun flag (e.g. StartInstances, StopInstances)
Current Behavior
I am not able to run EC2 operations with the DryRun flag to check access to these operations
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.EC2 3.7.405.7
Targeted .NET Platform
.NET 6
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: