Skip to content

Commit ccc2bed

Browse files
Added support for the force option for the EC2 instance terminate command. This feature enables customers to recover resources associated with an instance stuck in the shutting-down state as a result of rare issues caused by a frozen operating system or an underlying hardware problem.
1 parent c62a86d commit ccc2bed

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed

generator/ServiceModels/ec2/ec2-2016-11-15.api.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48304,6 +48304,7 @@
4830448304
"shape":"InstanceIdStringList",
4830548305
"locationName":"InstanceId"
4830648306
},
48307+
"Force":{"shape":"Boolean"},
4830748308
"SkipOsShutdown":{"shape":"Boolean"},
4830848309
"DryRun":{
4830948310
"shape":"Boolean",

generator/ServiceModels/ec2/ec2-2016-11-15.docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3201,6 +3201,7 @@
32013201
"Subnet$DefaultForAz": "<p>Indicates whether this is the default subnet for the Availability Zone.</p>",
32023202
"Subnet$MapPublicIpOnLaunch": "<p>Indicates whether instances launched in this subnet receive a public IPv4 address.</p> <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href=\"http://aws.amazon.com/vpc/pricing/\">Amazon VPC pricing page</a>.</p>",
32033203
"TerminateClientVpnConnectionsRequest$DryRun": "<p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>",
3204+
"TerminateInstancesRequest$Force": "<p>Forces the instances to terminate. The instance will first attempt a graceful shutdown, which includes flushing file system caches and metadata. If the graceful shutdown fails to complete within the timeout period, the instance shuts down forcibly without flushing the file system caches and metadata.</p>",
32043205
"TerminateInstancesRequest$SkipOsShutdown": "<p>Specifies whether to bypass the graceful OS shutdown process when the instance is terminated.</p> <p>Default: <code>false</code> </p>",
32053206
"TerminateInstancesRequest$DryRun": "<p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>",
32063207
"TransitGatewayMulticastGroup$GroupMember": "<p>Indicates that the resource is a transit gateway multicast group member.</p>",

generator/ServiceModels/ec2/ec2-2016-11-15.normal.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62819,6 +62819,10 @@
6281962819
"documentation":"<p>The IDs of the instances.</p> <p>Constraints: Up to 1000 instance IDs. We recommend breaking up this request into smaller batches.</p>",
6282062820
"locationName":"InstanceId"
6282162821
},
62822+
"Force":{
62823+
"shape":"Boolean",
62824+
"documentation":"<p>Forces the instances to terminate. The instance will first attempt a graceful shutdown, which includes flushing file system caches and metadata. If the graceful shutdown fails to complete within the timeout period, the instance shuts down forcibly without flushing the file system caches and metadata.</p>"
62825+
},
6282262826
"SkipOsShutdown":{
6282362827
"shape":"Boolean",
6282462828
"documentation":"<p>Specifies whether to bypass the graceful OS shutdown process when the instance is terminated.</p> <p>Default: <code>false</code> </p>"

sdk/src/Services/EC2/Generated/Model/Internal/MarshallTransformations/TerminateInstancesRequestMarshaller.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ public IRequest Marshall(TerminateInstancesRequest publicRequest)
6363
{
6464
request.Parameters.Add("DryRun", StringUtils.FromBool(publicRequest.DryRun));
6565
}
66+
if(publicRequest.IsSetForce())
67+
{
68+
request.Parameters.Add("Force", StringUtils.FromBool(publicRequest.Force));
69+
}
6670
if(publicRequest.IsSetInstanceIds())
6771
{
6872
if (publicRequest.InstanceIds.Count == 0)

sdk/src/Services/EC2/Generated/Model/TerminateInstancesRequest.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ namespace Amazon.EC2.Model
129129
public partial class TerminateInstancesRequest : AmazonEC2Request
130130
{
131131
private bool? _dryRun;
132+
private bool? _force;
132133
private List<string> _instanceIds = AWSConfigs.InitializeCollections ? new List<string>() : null;
133134
private bool? _skipOsShutdown;
134135

@@ -166,6 +167,27 @@ internal bool IsSetDryRun()
166167
return this._dryRun.HasValue;
167168
}
168169

170+
/// <summary>
171+
/// Gets and sets the property Force.
172+
/// <para>
173+
/// Forces the instances to terminate. The instance will first attempt a graceful shutdown,
174+
/// which includes flushing file system caches and metadata. If the graceful shutdown
175+
/// fails to complete within the timeout period, the instance shuts down forcibly without
176+
/// flushing the file system caches and metadata.
177+
/// </para>
178+
/// </summary>
179+
public bool? Force
180+
{
181+
get { return this._force; }
182+
set { this._force = value; }
183+
}
184+
185+
// Check to see if Force property is set
186+
internal bool IsSetForce()
187+
{
188+
return this._force.HasValue;
189+
}
190+
169191
/// <summary>
170192
/// Gets and sets the property InstanceIds.
171193
/// <para>

0 commit comments

Comments
 (0)