Enables resource sharing within your organization in Organizations. This operation creates a service-linked role called AWSServiceRoleForResourceAccessManager that has the IAM managed policy named AWSResourceAccessManagerServiceRolePolicy attached. This role permits RAM to retrieve information about the organization and its structure. This lets you share resources with all of the accounts in the calling account's organization by specifying the organization ID, or all of the accounts in an organizational unit (OU) by specifying the OU ID. Until you enable sharing within the organization, you can specify only individual Amazon Web Services accounts, or for supported resource types, IAM roles and users.
You must call this operation from an IAM role or user in the organization's management account.
Raises:
Source code in docs_src/capo_ram/_services/async_ram.py
| async def enable_sharing_with_aws_organization(
self, *, config_overrides: Optional[AsyncRAMClientConfig] = None
) -> "capo_ram.types.enable_sharing_with_aws_organization_response.EnableSharingWithAwsOrganizationResponse":
"""<p>Enables resource sharing within your organization in Organizations. This operation creates a service-linked role called <code>AWSServiceRoleForResourceAccessManager</code> that has the IAM managed policy named AWSResourceAccessManagerServiceRolePolicy attached. This role permits RAM to retrieve information about the organization and its structure. This lets you share resources with all of the accounts in the calling account's organization by specifying the organization ID, or all of the accounts in an organizational unit (OU) by specifying the OU ID. Until you enable sharing within the organization, you can specify only individual Amazon Web Services accounts, or for supported resource types, IAM roles and users.</p> <p>You must call this operation from an IAM role or user in the organization's management account.</p> <p></p>
Raises:
capo_ram.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>The operation failed because the requested operation isn't permitted.</p>
capo_ram.errors.server_internal_exception.ServerInternalException: <p>The operation failed because the service could not respond to the request due to an internal problem. Try again later.</p>
capo_ram.errors.service_unavailable_exception.ServiceUnavailableException: <p>The operation failed because the service isn't available. Try again later.</p>
capo_ram.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_ram.types.enable_sharing_with_aws_organization_request.EnableSharingWithAwsOrganizationRequest]",
) -> AsyncOperationResponse[
"capo_ram.types.enable_sharing_with_aws_organization_response.EnableSharingWithAwsOrganizationResponse"
]:
import capo_ram._operations.amazon_resource_sharing.enable_sharing_with_aws_organization
(
output,
http_response,
) = await capo_ram._operations.amazon_resource_sharing.enable_sharing_with_aws_organization.async_enable_sharing_with_aws_organization(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("EnableSharingWithAwsOrganization")
)
input_: capo_ram.types.enable_sharing_with_aws_organization_request.EnableSharingWithAwsOrganizationRequest = {}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|