disableAWSServiceAccess method
Disables the integration of an Amazon Web Services service (the service
that is specified by ServicePrincipal) with Organizations.
When you disable integration, the specified service no longer can create a
service-linked
role in new accounts in your organization. This means the
service can't perform operations on your behalf on any new accounts in
your organization. The service can still perform operations in older
accounts until the service completes its clean-up from Organizations.
For information about how to disable trusted service access to your organization using the trusted service, see the Learn more link under the Supports Trusted Access column at Amazon Web Services services that you can use with Organizations. on this page.
If you disable access by using this command, it causes the following actions to occur:
- The service can no longer create a service-linked role in the accounts in your organization. This means that the service can't perform operations on your behalf on any new accounts in your organization. The service can still perform operations in older accounts until the service completes its clean-up from Organizations.
- The service can no longer perform tasks in the member accounts in the organization, unless those operations are explicitly permitted by the IAM policies that are attached to your roles. This includes any data aggregation from the member accounts to the management account, or to a delegated administrator account, where relevant.
- Some services detect this and clean up any remaining data or resources related to the integration, while other services stop accessing the organization but leave any historical data and configuration in place to support a possible re-enabling of the integration.
DisableAWSServiceAccess operation, the
specified service can no longer perform operations in your organization's
accounts
For more information about integrating other services with Organizations, including the list of services that work with Organizations, see Using Organizations with other Amazon Web Services services in the Organizations User Guide.
You can only call this operation from the management account.
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 Amazon Web Services service for which
you want to disable integration with your organization. This is typically
in the form of a URL, such as
service-abbreviation.amazonaws.com.
Implementation
Future<void> disableAWSServiceAccess({
required String servicePrincipal,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSOrganizationsV20161128.DisableAWSServiceAccess'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ServicePrincipal': servicePrincipal,
},
);
}