ReferenceFlightcontrol APIAWS AccountsCreate AWS Account

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

  1. 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.
  2. The connection status will be AWAITING_CONNECTION until you create the CloudFormation stack in your AWS account.
  3. Once the CloudFormation stack is deployed, the status will change to CONNECTED.
  4. You can use the Get AWS Account API to check the connection status.

API Description

MethodPath
POST/v1/aws-accounts
Headers
AuthorizationBearer: [API key]
Content-Typeapplication/json

Full Endpoint URL https://api.flightcontrol.dev/v1/aws-accounts

Body
ParameterTypeDescription
namestringThe 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

  1. 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"
}'
  1. 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"
      }
    }
  }
}
  1. Create the cloudformation stack in your AWS account to authenticate Flightcontrol
  1. Open the link in the cloudFormation.consoleUrl field of the response.
  2. Click on the “Create stack” button.
AWS Create Stack Button