Installing the Cdev Sdk

The Cdev Sdk is currently distributed as a Python Package with PyPi, so you can install it using a single command with pip. Note that it is always recommended working with a python virtual environment

Installing the SDK

pip install cdev

Once you have installed the package, the CLI tool should be available to your environment. You can check that the tool has properly installed by running the following command.

cdev -h

Create Your First Project

Artifacts S3 Bucket

When creating a new project, you will be prompted to link to a S3 Bucket for your deployment artifacts.

You will need to provide a S3 Bucket in your AWS Account. If you do not already have one, you can create a bucket with the following command.

aws s3 mb s3://<bucket-name>

This bucket can be used for managing the deployment artifacts for multiple projects.

Now that we have the Cdev Sdk installed, we can use it to create a new Project. We can start our Project from a template that will help us get started faster.

cdev init demo-project --template quick-start
Name of bucket to store artifacts (): <bucket-name>

Deploying Resources

Cdev helps developers manage and deploy the changes to their Project onto the Cloud. You can use the plan command to check the current set of changes that would be deployed in the Cloud based on the changes you have made to the Project. Since we have not deployed anything in the Cloud for this Project, it will show that we want to create an API and Serveless Function.

cdev plan

When you are ready to deploy your changes, you can use the deploy command to deploy the changes. You will be prompted to confirm the set of changes that you are about to deploy. Note that Cdev will use the currently configured Aws credentials for your environment to deploy the resources

cdev deploy

Testing Serverless Function

Now that we have deployed our Serverless Function and API, we can test that they have been created in the Cloud. We can use Commands to execute our function in the Cloud and then retrieve the logs of the Serverless Function.

cdev run function.execute hello_world_comp.hello_world_function

You might have to wait a sec for the logs to process in the cloud

cdev run function.logs hello_world_comp.hello_world_function

Test API Endpoint

We can also check that our API has been properly created and configured with our Serverless Function. We can use the Output command to get the url that the Cloud generated for our API.

cdev output hello_world_comp.api.demoapi.endpoint



We can now use the curl cli tool to call our API Endpoint or visit <your-url>/hello_world directly in your web browser!

curl <your-url>/hello_world

Clean Up

We can delete all the created resources using the destroy command.

cdev destroy

Next Steps

Now that you have created and deployed your first API and Serverless Function, you can follow one of our tutorials to learn how to create a larger project.