Create a Deployment service account with the APC API

The examples on this page show common ways to use the APC API — they’re not a complete API reference. For the full, interactive API documentation for your installation, including every available query, mutation, and type, go to https://houston.<your-base-domain>/v1, and click on the Docs tab. See Develop and test APC API queries for more on using the built-in GraphQL explorer.

You can also create a service account using the GraphQL API. The deploymentUuid field is the same Deployment ID (UUID) returned by astro deployment list.

1mutation {
2 createDeploymentServiceAccount(
3 deploymentUuid: "<deployment-id>"
4 label: "CI/CD Pipeline"
5 role: DEPLOYMENT_ADMIN
6 ) {
7 id
8 apiKey
9 }
10}

Set in CI/CD environment:

$export ASTRONOMER_KEY_ID=<service-account-id>
$export ASTRONOMER_KEY_SECRET=<api-key>

For the full CI/CD setup, including Workspace-level service accounts and platform examples, see Configure CI/CD on Astro Private Cloud.