def from_s3_json(cls, bucket_name, key,
                     json_path=None, key_mapping=None,
                     aws_profile=None,
                     aws_access_key_id=None,
                     aws_secret_access_key=None,
                     region_name=None):  # pragma: no cover
        """
        Load database credential from json on s3.

        :param bucket_name: str
        :param key: str
        :param aws_profile: if None, assume that you are using this from
            AWS cloud. (service on the same cloud doesn't need profile name)
        :param aws_access_key_id: str, not recommend to use
        :param aws_secret_access_key: str, not recommend to use
        :param region_name: str
        """
        import boto3

        ses = boto3.Session(
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            region_name=region_name,
            profile_name=aws_profile,
        )
        s3 = ses.resource("s3")
        bucket = s3.Bucket(bucket_name)
        object = bucket.Object(key)
        data = json.loads(object.get()["Body"].read().decode("utf-8"))
        return cls._from_json_data(data, json_path, key_mapping)
Load database credential from json on s3.

        :param bucket_name: str
        :param key: str
        :param aws_profile: if None, assume that you are using this from
            AWS cloud. (service on the same cloud doesn't need profile name)
        :param aws_access_key_id: str, not recommend to use
        :param aws_secret_access_key: str, not recommend to use
        :param region_name: str