registerElasticIp method

Future<RegisterElasticIpResult> registerElasticIp({
  1. required String elasticIp,
  2. required String stackId,
})

Registers an Elastic IP address with a specified stack. An address can be registered with only one stack at a time. If the address is already registered, you must first deregister it by calling DeregisterElasticIp. For more information, see Resource Management.

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 ValidationException. May throw ResourceNotFoundException.

Parameter elasticIp : The Elastic IP address.

Parameter stackId : The stack ID.

Implementation

Future<RegisterElasticIpResult> registerElasticIp({
  required String elasticIp,
  required String stackId,
}) async {
  ArgumentError.checkNotNull(elasticIp, 'elasticIp');
  ArgumentError.checkNotNull(stackId, 'stackId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OpsWorks_20130218.RegisterElasticIp'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ElasticIp': elasticIp,
      'StackId': stackId,
    },
  );

  return RegisterElasticIpResult.fromJson(jsonResponse.body);
}