def METHOD_NAME(region: Optional[pulumi.Input[Optional[str]]] = None,
                               opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetServiceAccountResult]:
    """
    Use this data source to get the Account ID of the [AWS CloudTrail Service Account](http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-supported-regions.html)
    in a given region for the purpose of allowing CloudTrail to store trail data in S3.
    ## Example Usage
    ```python
    import pulumi
    import pulumi_aws as aws
    main = aws.cloudtrail.get_service_account()
    bucket = aws.s3.BucketV2("bucket", force_destroy=True)
    allow_cloudtrail_logging_policy_document = pulumi.Output.all(bucket.arn, bucket.arn).apply(lambda bucketArn, bucketArn1: aws.iam.get_policy_document_output(statements=[
        aws.iam.GetPolicyDocumentStatementArgs(
            sid="Put bucket policy needed for trails",
            effect="Allow",
            principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
                type="AWS",
                identifiers=[main.arn],
            )],
            actions=["s3:PutObject"],
            resources=[f"{bucket_arn}/*"],
        ),
        aws.iam.GetPolicyDocumentStatementArgs(
            sid="Get bucket policy needed for trails",
            effect="Allow",
            principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
                type="AWS",
                identifiers=[main.arn],
            )],
            actions=["s3:GetBucketAcl"],
            resources=[bucket_arn1],
        ),
    ]))
    allow_cloudtrail_logging_bucket_policy = aws.s3.BucketPolicy("allowCloudtrailLoggingBucketPolicy",
        bucket=bucket.id,
        policy=allow_cloudtrail_logging_policy_document.json)
    ```
    :param str region: Name of the region whose AWS CloudTrail account ID is desired.
           Defaults to the region from the AWS provider configuration.
    """
    ...