Create Environment API
Use this API to create a new environment in your project.
API Description
Method | Path |
---|---|
POST | /v1/projects/{projectId}/environments |
Headers | |
---|---|
Authorization | Bearer: [API key] |
Full Endpoint URL https://api.flightcontrol.dev/v1/projects/{projectId}/environments
Body | ||
---|---|---|
Parameter | Type | Description |
name | string | The environment name displayed in Flightcontrol dashboard. |
region | string | The region used to deploy the application in AWS. |
source | object: check below for detail | The source used to build your environment. |
services | array: check below for detail | An array of services configuration. |
vpc | object: check below for detail | The networking configuration for your environment. |
envVariables | object: check below for detail | The environment variables and secrets used for your build and runtime. |
The source
object
Parameter | Type | Description |
---|---|---|
branch | string | The Git branch in github used to provision and build the environment’s services. |
trigger | ”push” or “manual” | Whether the environment is deployed automatically with every Git push (Git push to deploy) or deployed manually through the dashboard or deploy hooks |
The services
array
This is an array of service
object, a service object requires at least id
, name
and type
. For the complete list of the available properties, please refer to the relevant section of each service-type in the Configuring with code section
The vpc
object
This is an optional configuration, required for advanced networking configuration, which gives you more control over the deployed infrastructure
Parameter | Type | Description |
---|---|---|
id | string | Optional This is the VPC is in AWS, it needs to be an existing VPC in the same region |
cidr | string | Optional The exact CIDR that Flightcontrol will use to provision the new subnet for your application, make sure it does not overlap with existing CIDR in your VPC |
private | boolean | Optional Whether this VPC will hold any private resources, like private RDS |
The envVariables
object
This is an object of key-value pairs, where the key is the envrionment variable name, for example DATABASE_URL
, and the value is the plain text value of the secret that will be stored in the regional Parameter Store, for example postgres://root:password@host:port/dbName
. All secrets are stored in your account, Flightcontrol never stores your secrets.
Response Example
[
{
"id": "project-id",
"name": "My Project",
"repoUrl": "https://github.com/team/project"
}
]
Response Conditions
Success
Errors