# Set up your company cloud

> Bring your own cloud: connect your account and create the shared infrastructure apps run on. AWS and Google Cloud today, Azure coming soon.

Source: https://diakrin.com/docs/company-cloud

Diakrin is bring your own cloud (BYOC): your apps run in your cloud account, not ours. A company cloud setup is the shared foundation they run on: a connected cloud account plus the infrastructure created from a reviewed template. You create it once; each app later adds its own service when it is deployed.

## What each cloud provides today

| | Amazon Web Services | Google Cloud | Microsoft Azure |
| --- | --- | --- | --- |
| **Status** | Available | Available | Coming soon |
| **Runs apps on** | ECS on Fargate | Cloud Run | |
| **How Diakrin connects** | IAM roles from a `DiakrinAccess` CloudFormation stack | Keyless workload identity, with no service-account keys | |
| **How employees reach apps** | Diakrin company sign-in at the app address | Private network, through an internal load balancer with Identity-Aware Proxy | |
| **Service and secrets per app** | Supported | Supported | |
| **Database per app** | Supported: Amazon RDS PostgreSQL | Supported: Cloud SQL PostgreSQL | |
| **File storage** | Supported: Amazon S3 | Supported: Cloud Storage | |
| **Company-managed source** | Available | Not yet | |
| **Company hostname with HTTPS** | Available | DNS record only | |
| **App data inventory** | Available | Not yet | |

Scheduled jobs and general internet access from apps are not offered on any cloud yet. Tell your Diakrin onboarding contact if your first app needs one of these, so you can plan around it before you start.

## Create a setup

Open **Infrastructure → New setup** as an organization owner or administrator. The step names differ slightly between clouds, but the order is the same.

> [!SELF-HOSTED]
> The installer sets up your cloud foundation inside your own account, so there is no connection role for Diakrin's hosted service to assume. The owner checks it in setup under **Deployment prerequisites**: DNS and TLS, isolation, audit archive, scanner and spending limits. Each check shows who verified it and, when blocked, the one thing to fix. A green state always comes from a fresh provider read, never from saved settings. GitHub is connected to selected private repositories only.

```steps
Configure | Owner or admin | Name the setup, choose your cloud, pick a template and set a monthly budget ceiling.
Connect cloud | Owner, admin or delegated Technical administrator | Create the reviewed connection in your cloud: [AWS](#connect-your-aws-account) or [Google Cloud](#connect-google-cloud). Diakrin verifies it independently.
Review and create | Owner or admin | Check the network, cost estimate and approval policy, then start creation.
Watch it build | Diakrin | **Preparing → Creating resources → Checking infrastructure → Ready** from persisted receipts. You can leave; creation continues.
Ready for apps | | The template's infrastructure is verified and the deployment path is available. Deploying a specific app is a separate, later action.
```

## Templates

Enter a setup name, choose your cloud and pick a template. Each card names what it is for and what it includes. The template's version and digest are pinned when you continue; a newer release is a new, reviewed choice, never a silent upgrade. Display names can change without affecting a saved setup.

| Template | Runs on | Includes | Not included |
| --- | --- | --- | --- |
| **AWS Container Apps** | ECS on Fargate | Private VPC with endpoints, internal load balancer for employee access, private ECR registry, Amazon S3 file storage, Amazon RDS PostgreSQL 17 (encrypted, deletion-protected, seven-day backups), Secrets Manager credentials, CloudWatch logs, KMS key | Queues, scheduled jobs, public internet hosting |
| **Google Cloud Apps** | Cloud Run | Private VPC (managed or explicitly referenced), internal HTTPS load balancer with Identity-Aware Proxy, internal-only Cloud Run, Cloud SQL PostgreSQL, Cloud Storage, Cloud Logging | Queues, scheduled jobs, public internet hosting |

Good fits are internal web apps and APIs. An ECS cluster or a Cloud Run project is not a running app: each app adds its own service when it is deployed.

The AWS template offers all 34 current commercial (`aws` partition) regions; GovCloud and China need different trust roots. The Google template offers all 43 current Cloud Run regions. Choosing a region does not enable an opt-in AWS region or guarantee quotas; the connection and creation checks still have to pass.

Only published, reviewed templates appear. If none are available, contact your Diakrin onboarding contact; your other choices are kept.

## Connect your AWS account

Before the first setup, an owner or administrator connects each AWS account once under **Settings → Cloud accounts** (the **Connect your cloud account** step in Get started). Enter the account ID and home region, choose whether to **show actual AWS cost**, then review the permissions. Diakrin lists every role and policy and what Diakrin can never do, and links the raw template.

Choose **Open AWS to create the stack**. AWS opens the CloudFormation page for the stack `DiakrinAccess` with everything filled in. Review it, acknowledge IAM role creation and choose **Create stack**, then come back and choose **Verify**. Diakrin checks the account, the exact template and every role's trust and permissions, and the page shows **Connected**. If a check fails, the page names the one thing to fix in plain words and offers **Update in AWS**.

```diagram aws-roles
Diakrin never holds long-lived AWS keys. It assumes roles in your account, and only CloudFormation can use the role that creates resources.
```

The stack creates three roles: a **Reader** (read-only metadata and, if you allow it, billed cost), a **Controller** that Diakrin assumes to start reviewed changes, and an **Execution** role that only CloudFormation can use to create resources. Every resource Diakrin creates is tagged `diakrin:managed=true` and every role it creates is capped by a permissions boundary. To remove all access, delete the `DiakrinAccess` stack.

## Create the setup on AWS

In **Setup**, choose a connected AWS account (the region defaults to its home region), choose **Starter** or **Resilient**, and set a monthly budget ceiling. **Advanced options** holds database size and storage, who approves creation, and the policy for later changes. **Review** shows the exact template, estimate and ceiling; **Create** starts the foundation. Diakrin then creates the setup's runtime resources itself; there is nothing more to apply in AWS.

## Choose the network on AWS

In **Review**, choose where the setup's network lives. By default Diakrin places it in an **existing VPC**, so several setups can share one network. Diakrin lists the VPCs in the account and region and preselects the only one that has two private subnets in different Availability Zones; with several candidates you pick one. Tick **Create a new VPC for this setup** to get a dedicated private VPC with its own endpoints instead.

In an existing VPC each setup still gets its own security groups, database, internal load balancer and image registry. Diakrin creates no subnets, routes or endpoints there. Apps are published through CloudFront, which needs an internet gateway on the VPC: the Diakrin setup stack uses the one already attached (Diakrin fills it in on the stack form) and attaches a new one only when the VPC has none. If your VPC has a gateway that no route table uses yet, enter its ID in the stack's **ExistingInternetGatewayId** field. Diakrin never adds routes to it, detaches it or deletes it. Your network must give the chosen private subnets outbound HTTPS to ECR, CloudWatch Logs, Secrets Manager and S3, through a NAT gateway or your own VPC endpoints; Diakrin warns when it finds neither. The network is fixed once the setup is created.

## Connect Google Cloud

Choose **Google Cloud** in **New setup**, continue to **Connect cloud**, authorize in Google's consent screen, then search for and select a project and region. Diakrin discovers the project number. Review access and choose **Approve and connect**. When installation finishes, Diakrin verifies the ongoing keyless connection automatically.

The approval creates, in that project only:

- A setup-specific workload identity pool and provider.
- A metadata-reader service account with a custom read-only role.
- The IAM, IAM Credentials, STS, Resource Manager and Service Usage APIs are enabled if they are off.

Existing IAM bindings are preserved, and this step creates no app, database or billable foundation. The person approving needs Google permissions to enable services, create these identities and the role, and update IAM policies. Your organization policies can deny the installation; the page names what failed.

No terminal, Cloud Shell, copied script or service-account key is used. The one-time installation grant is **not read-only**: it authorizes the reviewed Google API changes. Ongoing observation uses Diakrin's separate keyless identity. Creating the foundation needs its own separately authorized execution access. Cancellation, consent denial and interrupted installation keep the draft; resume the same attempt.

## Permissions

Organization owners, administrators and Technical administrators create and approve setups; spending ceilings are set by owners and administrators. Technical ownership never grants cloud access, spending or deletion rights. An administrator can delegate **connecting AWS** to an assigned Technical administrator as technical owner in setup settings; that delegation never includes creating infrastructure or approving spending.

**Who approves creation** is separate from the policy for later changes:

- **The owner or administrator who creates it** (default for new setups): one explicit review and **Create infrastructure**.
- **A second owner or administrator**: Review shows this before the final step. **Request approval** records the exact request; the setup shows **Awaiting approval** until a different current owner or administrator approves it. The requester cannot approve their own request.

Setups created before this policy existed keep their previous behaviour: if their later-changes policy was **Independent approval**, creation also needs a second approver until an owner or administrator changes it. The server enforces the policy in the console, the API and the database.

## Costs and approval

The monthly budget ceiling is the most Diakrin will approve for the shared foundation's estimated monthly cost. **It is not a cloud billing cap**: usage, retained data and other services can cost more. Review shows one estimate when current regional pricing is available, or **Estimate unavailable**. Unknown pricing is never shown as zero and does not by itself block creation; a known estimate above the ceiling does. Detailed cost assumptions are in **Costs**.

## Verification and recovery

Diakrin checks access automatically while it waits for you in AWS or Google Cloud and immediately before creating anything. A rename, budget change or policy change never sends you back to Connect. A resource change, such as a new size, makes the short-lived connection check out of date, so **Create infrastructure** repeats it without asking you to reconnect.

After **Create infrastructure**, the setup shows **Preparing → Creating resources → Checking infrastructure → Ready** from persisted receipts. You can leave; creation continues and the page resumes when you return. Diakrin shows no percentage or ETA.

If something stops, the setup shows what failed, whether the provider stopped, and one next action:

- **Failed**: the provider stopped creating resources. The first resource listed is the cause; the others could not be removed during rollback. Review them with your cloud administrator in your cloud console. Diakrin does not delete or recreate the stack automatically.
  - **On AWS, if the ECS service role wasn't ready:** Diakrin creates the ECS, Elastic Load Balancing and RDS service-linked roles before the first setup, so this is rare. If it happens, run the command shown, for example `aws iam create-service-linked-role --aws-service-name ecs.amazonaws.com`, then set up again.
  - **On AWS, if rollback failed:** delete the stack in CloudFormation and retain the resources AWS can't delete, remove those resources, then delete the setup in Diakrin and create a new one.
- **Action required**: Diakrin can't yet tell whether a submitted request reached the cloud, or the connection needs attention. **Check status** reconciles first; Diakrin never starts a duplicate.
- **Access needs attention**: management access could not be confirmed recently. Your resources are unaffected and the last confirmed state is shown.

**Ready for apps** means the template's infrastructure is verified and the authorized deployment path is available. It does not mean any specific app is deployed. If the deployment path is not yet available, the setup says **Infrastructure ready** and names the missing prerequisite.

## Maintenance

| Policy for later changes | Change authority |
| --- | --- |
| Automatic | Supported changes within the current approved resource and cost envelope. |
| Approve critical changes | Approval for cost increases, reduced protection and security-impacting changes. |
| Independent approval | A different current owner or administrator approves each proposed operation. |

Monitoring never approves changes, and every policy stays inside your organization's scope, cloud permissions, spending limits and resource protections. **Settings** changes name, technical owner, budget ceiling and policy; saving records intent and does not change resources or activate controller authority. After creation, resource changes go through **Settings → Current cloud maintenance authority**.

## Technical owner

The authenticated creator becomes the initial technical owner on the server. Reassign responsibility in **Settings** to an active eligible owner, administrator or Technical administrator. Reassignment is audited and grants no cloud, spending or approval rights.

## Technical issues

Persisted actionable infrastructure incidents notify active, enabled organization **owner, admin and Technical administrator** members. Member and builder roles are excluded.

**Accepted by provider** means the email service accepted a submission, not that someone read it. **Delivered to recipient server** requires a verified delivery event. Email problems stay visible; in-app notifications and actions keep working. Incidents resolve only from later recovery evidence; acknowledgment is not recovery.

## Disconnect and decommission

**Disconnect** stops Diakrin's management and keeps cloud resources, apps, data and costs. Revoking AWS trust or the Google federation/IAM grant is a separate step your cloud administrator takes in the provider.

**Delete** removes the setup from Diakrin and stops management. **It never deletes anything in your cloud**: resources, data, roles, history and audit stay, and charges can continue until you delete them yourself. Before **Delete setup** is enabled you must confirm that you understand this and type the setup name. Apps that still use the setup must be moved or removed first; Diakrin never moves an app automatically.

On AWS, use the links in the dialog to open the exact stacks in the AWS console: delete the infrastructure stack, then the connection stack. The database is deletion-protected, and its storage, registry, key and logs are retained when the stack is deleted; remove them separately if you want them gone, after taking a final snapshot. Roles you created yourself are never part of this.

On Google Cloud, delete only the resources this setup created, never the whole project.

Custom hostnames for apps are covered in [Company domains](/docs/domains).

If Delete says **Permissions could not be checked**, nothing was changed; try again. A real denial says who can delete instead.
