- Reference Documentation - Reference
- Technical Documentation(Rust) - Markdown
- Technical Documentation(CPP) - Coming Soon
render_cdk
provides a streamlined interface for interacting with Render, a platform that allows you to build, deploy, and scale your apps with ease. This crate abstracts Render's API, making it easier to work with Render cloud programmatically.
- Name: render_cdk
- Version: 0.0.12
- License: MIT
Work on the resource management module is currently under way. The API supports many of the same actions available from the Render Dashboard. It currently provides endpoints for managing:
- Services
- Deploys
- Custom domains
- Jobs
The CDK will provide an abstraction that will make it easier to work with the Render cloud programmatically.
Automate tests for deployed services e.g Connecting and running queries on created database instances etc.
The render_cdk
crate provides a comprehensive toolkit for managing cloud environments, IaaS, resource management, and state management within a Continuous Deployment/Continuous Integration (CDK) environment. This documentation provides an overview of the primary components and usage examples to help you get started.
- environment_management: Tools and utilities for managing the deployment environment.
- iaas: Infrastructure as a Service functionalities.
- resource_management: Tools for managing resources, including models and utilities.
- state_management: Utilities for managing the state of deployed services.
- logger: Logging utilities for debugging and tracking operations.
To use render_cdk
, include the following in your Cargo.toml
:
[dependencies]
render_cdk = "0.0.12"
The following examples demonstrate how to query for various deployed services using the ServiceManager
.
use render_cdk::iaas::prelude::*;
use tokio::main;
#[main]
async fn main() {
let services = ServiceManager::list_services_with_status("suspended", "50").await;
let services = ServiceManager::find_service_by_name_and_type("whoami", "web_service").await;
let services = ServiceManager::find_service_by_region("oregon", "10").await;
let services = ServiceManager::find_service_by_environment("image", "10").await;
}
The following section demonstrates how to use a simple configuration file to provision resources on Render Cloud.
use render_cdk::resource_management::prelude::*;
#[main]
async fn main() {
let config = config::Conf::read_configuration_file().unwrap();
println!("Sample Configuration: {:?}\n", config);
}
The Owner Id is used to tie the deployed resource to the Acting Service Principal/Render Account Owner.
use crate::authentication::owner::*;
use tokio::main;
#[main]
async fn main() {
let owner_id = Info::get_owner_id().await;
}
use render_cdk::resource_management::prelude::*;
#[main]
async fn main() {
let deployment_config = template::Template {
type_: "static_site".to_owned(),
name: "test_deployment".to_owned(),
owner_id: "owner_id_value".to_owned(),
repo: "https://github.com/<username>/<repo_name>".to_owned(),
auto_deploy: "yes".to_owned(),
branch: None,
image: None,
build_filter: None,
root_dir: Some("./public".to_owned()),
env_vars: vec![],
secret_files: vec![],
service_details: Some(ServiceDetails {
build_command: None,
headers: vec![],
publish_path: Some("./".to_owned()),
pull_request_previews_enabled: Some("yes".to_owned()),
routes: vec![],
}),
};
let service = ServiceManager::create_service(deployment_config).await.unwrap();
println!("Service Created: {:?}", service);
}
use render_cdk::resource_management::prelude::*;
#[main]
async fn main() {
let template_with_image = Template {
type_: "static_site".to_owned(),
name: "test".to_owned(),
owner_id: "owner123".to_owned(),
repo: "httpe".to_owned(),
auto_deploy: true,
branch: Some("main".to_owned()),
image: Some(Image {
owner_id: "owner123".to_owned(),
registry_credential_id: "cred123".to_owned(),
image_path: "path/to/image".to_owned(),
}),
build_filter: BuildFilter { /* Initialize your fields here */ },
root_dir: "./".to_owned(),
env_vars: vec![
EnvVar {
key: "EXAMPLE".to_owned(),
value: Some("EXAMPLE".to_owned()),
generate_value: false,
}
],
secret_files: vec![],
service_details: ServiceDetails { /* Initialize your fields here */ },
};
}
use render_cdk::resource_management::prelude::*;
#[main]
async fn main() {
let template_without_image = Template {
type_: "static_site".to_owned(),
name: "test".to_owned(),
owner_id: "test".to_owned(),
repo: "httpe".to_owned(),
auto_deploy: true,
branch: None,
image: None,
build_filter: BuildFilter { /* Initialize your fields here */ },
root_dir: "./".to_owned(),
env_vars: vec![],
secret_files: vec![],
service_details: ServiceDetails { /* Initialize your fields here */ },
};
}
The logging module has also been made public if you prefer making all application logs consistent.
use render_cdk::logger::prelude::*;
#[main]
async fn main() {
LOGGER::INFO("Deployment Config. : ", &deployment_config.to_json_string(), LogLevel::WARN);
}
Contributions are welcome! Please see the repository for more information on how to contribute.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions, issues, or suggestions, please open an issue on the repository.
Thank you for using render_cdk
! We hope this documentation helps you get started quickly.