Create AWS Account API
Use this API to create a new AWS account connection in your Flightcontrol organization. This will generate a CloudFormation stack link that you can use to connect your AWS account.
You must have AdministratorAccess
(recommended) or be the root user (not recommended). If you need help, see this AWS guide
- After creating the AWS account connection, you’ll receive a CloudFormation stack link. You need to open this link and create the stack in your AWS account to complete the connection.
- The connection status will be
AWAITING_CONNECTION
until you create the CloudFormation stack in your AWS account. - Once the CloudFormation stack is deployed, the status will change to
CONNECTED
. - You can use the Get AWS Account API to check the connection status.
API Description
Method | Path |
---|---|
POST | /v1/aws-accounts |
Headers | |
---|---|
Authorization | Bearer: [API key] |
Content-Type | application/json |
Full Endpoint URL https://api.flightcontrol.dev/v1/aws-accounts
Body | ||
---|---|---|
Parameter | Type | Description |
name | string | The name of your AWS account connection. |
Response Example
{
"id": "cmadqj0k400000cjs6wwu2n5y",
"name": "My AWS Account",
"status": "AWAITING_CONNECTION",
"cloudFormation": {
"consoleUrl": "https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?templateUrl=https://fc-public-cf-templates.s3.us-west-2.amazonaws.com/flightcontrol-cloudformation-v2.json",
"template": {
"url": "https://fc-public-cf-templates.s3.us-west-2.amazonaws.com/flightcontrol-cloudformation-v2.json",
"stackName": "flightcontrol-access-cmadqj0k400000cjs6wwu2n5y",
"region": "us-east-1",
"parameters": {
"FlightcontrolId": "cmadqj0k400000cjs6wwu2n5y"
}
}
}
}
Response Conditions
Success
Errors
Guide to Creating a New AWS Account
- Use the Create AWS Account API to create a new AWS account
curl --request POST \
--url https://api.flightcontrol.dev/v1/aws-accounts \
--header 'authorization: Bearer ${TOKEN}' \
--header 'content-type: application/json' \
--data '{
"name": "My AWS Account"
}'
- The response will contain the connection stack link that you can use to connect your AWS account to Flightcontrol:
{
"id": "cmadqj0k400000cjs6wwu2n5y",
"name": "My AWS Account",
"status": "AWAITING_CONNECTION",
"cloudFormation": {
"consoleUrl": "https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?templateUrl=https://fc-public-cf-templates.s3.us-west-2.amazonaws.com/flightcontrol-cloudformation-v2.json",
"template": {
"url": "https://fc-public-cf-templates.s3.us-west-2.amazonaws.com/flightcontrol-cloudformation-v2.json",
"stackName": "flightcontrol-access-cmadqj0k400000cjs6wwu2n5y",
"region": "us-east-1",
"parameters": {
"FlightcontrolId": "cmadqj0k400000cjs6wwu2n5y"
}
}
}
}
- Create the cloudformation stack in your AWS account to authenticate Flightcontrol
- Open the link in the
cloudFormation.consoleUrl
field of the response. - Click on the “Create stack” button.
