Nitric allows you to define cloud resources (APIs, Jobs, Buckets, Topics) in your code. These definitions act as the blueprint for the infrastructure Nitric will provision.
Common resource types include:
api(name): Defines an HTTP API endpoint.job(name): Defines a batch job for asynchronous processing.bucket(name): Defines a storage bucket.topic(name): Defines a Pub/Sub topic for asynchronous messaging.
Example resource definitions in common/resources.py:
from nitric.resources import api, bucket, job, topic
main_api = api("main")
gen_audio_job = job("audio")
clips_bucket = bucket("clips")
models_bucket = bucket("models")
download_audio_model_topic = topic("download-audio-model")