enableAWSServiceAccess method

Future<void> enableAWSServiceAccess({
  1. required String servicePrincipal,
})

Enables the integration of an AWS service (the service that is specified by ServicePrincipal) with AWS Organizations. When you enable integration, you allow the specified service to create a service-linked role in all the accounts in your organization. This allows the service to perform operations on your behalf in your organization and its accounts. For more information about enabling services to integrate with AWS Organizations, see Integrating AWS Organizations with Other AWS Services in the AWS Organizations User Guide.

This operation can be called only from the organization's management account and only if the organization has enabled all features.

May throw AccessDeniedException. May throw AWSOrganizationsNotInUseException. May throw ConcurrentModificationException. May throw ConstraintViolationException. May throw InvalidInputException. May throw ServiceException. May throw TooManyRequestsException. May throw UnsupportedAPIEndpointException.

Parameter servicePrincipal : The service principal name of the AWS service for which you want to enable integration with your organization. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com.

Implementation

Future<void> enableAWSServiceAccess({
  required String servicePrincipal,
}) async {
  ArgumentError.checkNotNull(servicePrincipal, 'servicePrincipal');
  _s.validateStringLength(
    'servicePrincipal',
    servicePrincipal,
    1,
    128,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSOrganizationsV20161128.EnableAWSServiceAccess'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ServicePrincipal': servicePrincipal,
    },
  );
}