Skip to content

Commit 18ce277

Browse files
Adding support for Event Windows via a new ECS account setting "fargateEventWindows". When enabled, ECS Fargate will use the configured event window for patching tasks. Introducing "CapacityOptionType" for CreateCapacityProvider API, allowing support for Spot capacity for ECS Managed Instances.
1 parent 5244a29 commit 18ce277

File tree

9 files changed

+159
-6
lines changed

9 files changed

+159
-6
lines changed

generator/ServiceModels/ecs/ecs-2014-11-13.api.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,13 @@
13241324
}
13251325
}
13261326
},
1327+
"CapacityOptionType":{
1328+
"type":"string",
1329+
"enum":[
1330+
"ON_DEMAND",
1331+
"SPOT"
1332+
]
1333+
},
13271334
"CapacityProvider":{
13281335
"type":"structure",
13291336
"members":{
@@ -2901,6 +2908,7 @@
29012908
"networkConfiguration":{"shape":"ManagedInstancesNetworkConfiguration"},
29022909
"storageConfiguration":{"shape":"ManagedInstancesStorageConfiguration"},
29032910
"monitoring":{"shape":"ManagedInstancesMonitoringOptions"},
2911+
"capacityOptionType":{"shape":"CapacityOptionType"},
29042912
"instanceRequirements":{"shape":"InstanceRequirementsRequest"}
29052913
}
29062914
},
@@ -4582,7 +4590,8 @@
45824590
"tagResourceAuthorization",
45834591
"fargateTaskRetirementWaitPeriod",
45844592
"guardDutyActivate",
4585-
"defaultLogDriverMode"
4593+
"defaultLogDriverMode",
4594+
"fargateEventWindows"
45864595
]
45874596
},
45884597
"SettingType":{

generator/ServiceModels/ecs/ecs-2014-11-13.docs.json

Lines changed: 8 additions & 2 deletions
Large diffs are not rendered by default.

generator/ServiceModels/ecs/ecs-2014-11-13.normal.json

Lines changed: 15 additions & 3 deletions
Large diffs are not rendered by default.

sdk/src/Services/ECS/Generated/Model/InstanceLaunchTemplate.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,56 @@ namespace Amazon.ECS.Model
3737
/// </summary>
3838
public partial class InstanceLaunchTemplate
3939
{
40+
private CapacityOptionType _capacityOptionType;
4041
private string _ec2InstanceProfileArn;
4142
private InstanceRequirementsRequest _instanceRequirements;
4243
private ManagedInstancesMonitoringOptions _monitoring;
4344
private ManagedInstancesNetworkConfiguration _networkConfiguration;
4445
private ManagedInstancesStorageConfiguration _storageConfiguration;
4546

47+
/// <summary>
48+
/// Gets and sets the property CapacityOptionType.
49+
/// <para>
50+
/// The capacity option type. This determines whether Amazon ECS launches On-Demand or
51+
/// Spot Instances for your managed instance capacity provider.
52+
/// </para>
53+
///
54+
/// <para>
55+
/// Valid values are:
56+
/// </para>
57+
/// <ul> <li>
58+
/// <para>
59+
/// <c>ON_DEMAND</c> - Launches standard On-Demand Instances. On-Demand Instances provide
60+
/// predictable pricing and availability.
61+
/// </para>
62+
/// </li> <li>
63+
/// <para>
64+
/// <c>SPOT</c> - Launches Spot Instances that use spare Amazon EC2 capacity at reduced
65+
/// cost. Spot Instances can be interrupted by Amazon EC2 with a two-minute notification
66+
/// when the capacity is needed back.
67+
/// </para>
68+
/// </li> </ul>
69+
/// <para>
70+
/// The default is On-Demand
71+
/// </para>
72+
///
73+
/// <para>
74+
/// For more information about Amazon EC2 capacity options, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html">Instance
75+
/// purchasing options</a> in the <i>Amazon EC2 User Guide</i>.
76+
/// </para>
77+
/// </summary>
78+
public CapacityOptionType CapacityOptionType
79+
{
80+
get { return this._capacityOptionType; }
81+
set { this._capacityOptionType = value; }
82+
}
83+
84+
// Check to see if CapacityOptionType property is set
85+
internal bool IsSetCapacityOptionType()
86+
{
87+
return this._capacityOptionType != null;
88+
}
89+
4690
/// <summary>
4791
/// Gets and sets the property Ec2InstanceProfileArn.
4892
/// <para>

sdk/src/Services/ECS/Generated/Model/Internal/MarshallTransformations/InstanceLaunchTemplateMarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public void Marshall(InstanceLaunchTemplate requestObject, JsonMarshallerContext
4646
{
4747
if(requestObject == null)
4848
return;
49+
if(requestObject.IsSetCapacityOptionType())
50+
{
51+
context.Writer.WritePropertyName("capacityOptionType");
52+
context.Writer.WriteStringValue(requestObject.CapacityOptionType);
53+
}
54+
4955
if(requestObject.IsSetEc2InstanceProfileArn())
5056
{
5157
context.Writer.WritePropertyName("ec2InstanceProfileArn");

sdk/src/Services/ECS/Generated/Model/Internal/MarshallTransformations/InstanceLaunchTemplateUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ public InstanceLaunchTemplate Unmarshall(JsonUnmarshallerContext context, ref St
5656
int targetDepth = context.CurrentDepth;
5757
while (context.ReadAtDepth(targetDepth, ref reader))
5858
{
59+
if (context.TestExpression("capacityOptionType", targetDepth))
60+
{
61+
var unmarshaller = StringUnmarshaller.Instance;
62+
unmarshalledObject.CapacityOptionType = unmarshaller.Unmarshall(context, ref reader);
63+
continue;
64+
}
5965
if (context.TestExpression("ec2InstanceProfileArn", targetDepth))
6066
{
6167
var unmarshaller = StringUnmarshaller.Instance;

sdk/src/Services/ECS/Generated/Model/PutAccountSettingDefaultRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ public partial class PutAccountSettingDefaultRequest : AmazonECSRequest
136136
/// </para>
137137
/// </li> <li>
138138
/// <para>
139+
/// <c>fargateEventWindows</c> - When Amazon Web Services determines that a security
140+
/// or infrastructure update is needed for an Amazon ECS task hosted on Fargate, the tasks
141+
/// need to be stopped and new tasks launched to replace them. Use <c>fargateEventWindows</c>
142+
/// to use EC2 Event Windows associated with Fargate tasks to configure time windows for
143+
/// task retirement.
144+
/// </para>
145+
/// </li> <li>
146+
/// <para>
139147
/// <c>tagResourceAuthorization</c> - Amazon ECS is introducing tagging authorization
140148
/// for resource creation. Users must have permissions for actions that create the resource,
141149
/// such as <c>ecsCreateCluster</c>. If tags are specified when you create a resource,

sdk/src/Services/ECS/Generated/Model/PutAccountSettingRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ public partial class PutAccountSettingRequest : AmazonECSRequest
139139
/// </para>
140140
/// </li> <li>
141141
/// <para>
142+
/// <c>fargateEventWindows</c> - When Amazon Web Services determines that a security
143+
/// or infrastructure update is needed for an Amazon ECS task hosted on Fargate, the tasks
144+
/// need to be stopped and new tasks launched to replace them. Use <c>fargateEventWindows</c>
145+
/// to use EC2 Event Windows associated with Fargate tasks to configure time windows for
146+
/// task retirement.
147+
/// </para>
148+
/// </li> <li>
149+
/// <para>
142150
/// <c>tagResourceAuthorization</c> - Amazon ECS is introducing tagging authorization
143151
/// for resource creation. Users must have permissions for actions that create the resource,
144152
/// such as <c>ecsCreateCluster</c>. If tags are specified when you create a resource,

sdk/src/Services/ECS/Generated/ServiceEnumerations.cs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,56 @@ public static implicit operator BurstablePerformance(string value)
608608
}
609609

610610

611+
/// <summary>
612+
/// Constants used for properties of type CapacityOptionType.
613+
/// </summary>
614+
public class CapacityOptionType : ConstantClass
615+
{
616+
617+
/// <summary>
618+
/// Constant ON_DEMAND for CapacityOptionType
619+
/// </summary>
620+
public static readonly CapacityOptionType ON_DEMAND = new CapacityOptionType("ON_DEMAND");
621+
/// <summary>
622+
/// Constant SPOT for CapacityOptionType
623+
/// </summary>
624+
public static readonly CapacityOptionType SPOT = new CapacityOptionType("SPOT");
625+
626+
/// <summary>
627+
/// This constant constructor does not need to be called if the constant
628+
/// you are attempting to use is already defined as a static instance of
629+
/// this class.
630+
/// This constructor should be used to construct constants that are not
631+
/// defined as statics, for instance if attempting to use a feature that is
632+
/// newer than the current version of the SDK.
633+
/// </summary>
634+
public CapacityOptionType(string value)
635+
: base(value)
636+
{
637+
}
638+
639+
/// <summary>
640+
/// Finds the constant for the unique value.
641+
/// </summary>
642+
/// <param name="value">The unique value for the constant</param>
643+
/// <returns>The constant for the unique value</returns>
644+
public static CapacityOptionType FindValue(string value)
645+
{
646+
return FindValue<CapacityOptionType>(value);
647+
}
648+
649+
/// <summary>
650+
/// Utility method to convert strings to the constant class.
651+
/// </summary>
652+
/// <param name="value">The string value to convert to the constant class.</param>
653+
/// <returns></returns>
654+
public static implicit operator CapacityOptionType(string value)
655+
{
656+
return FindValue(value);
657+
}
658+
}
659+
660+
611661
/// <summary>
612662
/// Constants used for properties of type CapacityProviderField.
613663
/// </summary>
@@ -4061,6 +4111,10 @@ public class SettingName : ConstantClass
40614111
/// </summary>
40624112
public static readonly SettingName DefaultLogDriverMode = new SettingName("defaultLogDriverMode");
40634113
/// <summary>
4114+
/// Constant FargateEventWindows for SettingName
4115+
/// </summary>
4116+
public static readonly SettingName FargateEventWindows = new SettingName("fargateEventWindows");
4117+
/// <summary>
40644118
/// Constant FargateFIPSMode for SettingName
40654119
/// </summary>
40664120
public static readonly SettingName FargateFIPSMode = new SettingName("fargateFIPSMode");

0 commit comments

Comments
 (0)