detachElasticLoadBalancer method

Future<void> detachElasticLoadBalancer({
  1. required String elasticLoadBalancerName,
  2. required String layerId,
})

Detaches a specified Elastic Load Balancing instance from its layer.

Required Permissions: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

May throw ResourceNotFoundException.

Parameter elasticLoadBalancerName : The Elastic Load Balancing instance's name.

Parameter layerId : The ID of the layer that the Elastic Load Balancing instance is attached to.

Implementation

Future<void> detachElasticLoadBalancer({
  required String elasticLoadBalancerName,
  required String layerId,
}) async {
  ArgumentError.checkNotNull(
      elasticLoadBalancerName, 'elasticLoadBalancerName');
  ArgumentError.checkNotNull(layerId, 'layerId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OpsWorks_20130218.DetachElasticLoadBalancer'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ElasticLoadBalancerName': elasticLoadBalancerName,
      'LayerId': layerId,
    },
  );
}