def write_json_file()

in cicd-deployers/metadata_deployer.py [0:0]


def write_json_file(project_id, location, output_filename="cortex_config.json"):
    """Creates a JSON file with the specified project ID and location.
    Args:
        project_id (str): The project ID to include in the JSON.
        location (str):  The location to include in the JSON.
        output_filename (str, optional): The filename of the output JSON file. Defaults to "config.json".
    """
    data = {
        "deployDataMesh": True,
        "projectIdSource": project_id,
        "projectIdTarget": project_id,
        "targetBucket": f"{project_id}-cortex-tmp-bucket",
        "location": location,
        "DataMesh": {
            "deployDescriptions": True,
            "deployLakes": True,
            "deployCatalog": True,
            "deployACLs": True
        },
        "k9": {
            "datasets": {
                "processing": "K9_PROCESSING",
                "reporting": "K9_REPORTING"
            }
        },
        "VertexAI": {
            "region": "REGION",
            "processingDataset": "VERTEXDATASET"
        }
    }
    with open(output_filename, "w") as outfile:
        json.dump(data, outfile, indent=4)
    return output_filename