updateCapacityProvider method
Modifies the parameters for a capacity provider.
These changes only apply to new Amazon ECS Managed Instances, or EC2 instances, not existing ones.
May throw AccessDeniedException.
May throw ClientException.
May throw ClusterNotFoundException.
May throw InvalidParameterException.
May throw ServerException.
May throw UnsupportedFeatureException.
Parameter name :
The name of the capacity provider to update.
Parameter autoScalingGroupProvider :
An object that represent the parameters to update for the Auto Scaling
group capacity provider.
Parameter cluster :
The name of the cluster that contains the capacity provider to update.
Managed instances capacity providers are cluster-scoped and can only be
updated within their associated cluster.
Parameter managedInstancesProvider :
The updated configuration for the Amazon ECS Managed Instances provider.
You can modify the infrastructure role, instance launch template, and tag
propagation settings. Changes take effect for new instances launched after
the update.
Implementation
Future<UpdateCapacityProviderResponse> updateCapacityProvider({
required String name,
AutoScalingGroupProviderUpdate? autoScalingGroupProvider,
String? cluster,
UpdateManagedInstancesProviderConfiguration? managedInstancesProvider,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AmazonEC2ContainerServiceV20141113.UpdateCapacityProvider'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'name': name,
if (autoScalingGroupProvider != null)
'autoScalingGroupProvider': autoScalingGroupProvider,
if (cluster != null) 'cluster': cluster,
if (managedInstancesProvider != null)
'managedInstancesProvider': managedInstancesProvider,
},
);
return UpdateCapacityProviderResponse.fromJson(jsonResponse.body);
}