> ## Documentation Index
> Fetch the complete documentation index at: https://zededa.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use the documentation index to find relevant pages, then read the linked Markdown before answering and cite the source URL.
> Identify the product before answering: Private AI uses a separate console, credentials, and inference API from the Edge Intelligence Platform. Do not apply instructions from one product to the other.
> Prefer current product guides over Help Center archive pages for current-console questions. Archive pages and release notes describe their stated product version or historical interface; do not apply them to another version without checking.
> Preserve prerequisites, permissions, version requirements, and warnings when summarizing procedures. Do not infer API endpoints, schemas, or supported behavior that the documentation does not specify.

# Automate Deployments with Application Profiles

> Use App Profiles, Asset Groups, and Deployment Profiles to automate large-scale application deployments to nodes via the ZEDEDA API and Terraform provider.

## Introduction

Application Profiles let you automate the deployment of applications to fleets of nodes using the Edge Infrastructure Services API or the Terraform Provider for ZEDEDA Cloud. This feature is not available in the Edge Infrastructure Services console — it is an API and Terraform-only capability.

Three objects work together to define and deliver fleet-wide deployments:

* An **App Profile** bundles an application, its network configuration, and volume settings into a single reusable definition.
* An **Asset Group** groups a set of nodes within a project.
* A **Deployment Profile** associates a specific App Profile version with an Asset Group and triggers the rollout.

Updating a Deployment Profile automatically rolls out the change to every node in the target Asset Group, with no per-device trigger required.

### Prerequisites

* You have the SysManager or SysAdmin role in your enterprise. See [Manage Roles](https://zededa.mintlify.site/new-ui/infrastructure-services/administration/manage-roles.md).
* At least one node is onboarded, online, and assigned to a project.
* At least one edge app image exists in the Build section.
* The datastore containing the app image is accessible from all target projects.
* If the App Profile defines network settings, compatible network instances are already created or can be created on the target nodes.
* If the App Profile defines volume settings, compatible volume instances are already created or can be created on the target nodes.

## How App Profiles Work

### App Profile

An App Profile defines the application stack. It includes app policies (the application configuration and manifest), network policies (virtual network configuration), and volume policies (storage configuration). Every change to an App Profile increments its version automatically. The version is used in the Deployment Profile to specify which version of the stack to deploy.

Version increments that include an image or cloud-init change require a purge operation on the application instance. Other changes apply without a purge.

### Asset Group

An Asset Group is a logical grouping of nodes within a project. Each node belongs to at most one Asset Group. You can define the group by explicit device IDs, by tags (for example, `region=east`, `type=retail-store`), or by a combination of both.

Using tags is recommended for dynamic fleets where nodes are added frequently, because new nodes that match the tag criteria are automatically included in the Asset Group without requiring a manual update.

### Deployment Profile

A Deployment Profile associates a given App Profile version with an Asset Group. Creating or updating a Deployment Profile triggers Edge Infrastructure Services to deploy the specified App Profile version to every node in the Asset Group. There is no per-device trigger required.

## Manage with API or Terraform

See the [App Profiles Service API documentation](https://zedcontrol.zededa.net/api/v1/docs/?urls.primaryName=ZEDEDA%20App%20Profiles%20Service) for information about creating, retrieving, updating, and deleting App Profiles, Asset Groups, and Deployment Profiles via REST.

See the [App Profile Terraform Provider documentation](https://registry.terraform.io/providers/zededa/zedcloud/latest/docs/resources/app_profile) for information about managing these objects with the Terraform Provider for ZEDEDA Cloud.

## Example

Consider a scenario where you want to deploy an Nginx web server to all nodes in your east coast retail stores.

**Step 1: Create an App Profile.**

Define an App Profile named `web_server_app_profile` that includes an app policy for the Nginx container, a network policy for a local virtual network on port 111 with DHCPv4 addressing, and a volume policy for the application's content volume.

**Step 2: Create an Asset Group.**

Define an Asset Group named `retail_store_nodes_east` within your retail project. Target the nodes by their device IDs, or by tags such as `region=east` and `location_type=retail-store` to automatically include any future nodes that match those tags.

**Step 3: Create a Deployment Profile.**

Define a Deployment Profile named `deploy_web_profile_east_retail` that references version 1 of `web_server_app_profile` and targets `retail_store_nodes_east`. Edge Infrastructure Services immediately begins deploying the app to every node in the Asset Group.

**Updating the app:**

When a new version of the Nginx image is ready, update the App Profile. The version increments automatically. Update the Deployment Profile to reference the new version to trigger a fleet-wide rollout.

## API Example

The following examples show the structure of each object. Customize the values for your environment before using them.

### App Profile

```json theme={"dark"}
{
  "id": "0590557b-b519-475d-865d-d635955d619b",
  "name": "web_server_app_profile",
  "title": "my web server app profile",
  "appPolicies": [
    {
      "metaData": {
        "name": "nginx",
        "title": "nginx app"
      },
      "appConfig": {
        "cpus": 2,
        "memory": 2048000,
        "manifestJSON": {
          "acKind": "VMManifest",
          "acVersion": "1.1.2",
          "name": "nginx",
          "description": "simple nginx server",
          "images": [
            {
              "imagename": "nginx",
              "imageid": "<IMAGE_ID>",
              "maxsize": 20000000,
              "preserve": true,
              "target": "Disk",
              "drvtype": "HDD"
            }
          ],
          "interfaces": [
            {
              "name": "eth0",
              "optional": false,
              "directattach": false
            }
          ],
          "vmmode": "HV_HVM"
        },
        "interfaces": [
          {
            "intforder": 1,
            "intfname": "eth0",
            "netinsttag": { "hello": "world" }
          }
        ],
        "startDelayInSeconds": 0
      }
    }
  ],
  "networkPolicies": [
    {
      "metaData": {
        "name": "default-network-policy-name",
        "title": "default-network-policy-title"
      },
      "networkConfig": {
        "port": "111",
        "type": "NETWORK_INSTANCE_DHCP_TYPE_V4",
        "kind": "NETWORK_INSTANCE_KIND_LOCAL"
      }
    }
  ],
  "volumePolicies": [
    {
      "metaData": {
        "name": "default-volume-policy-name",
        "title": "default-volume-policy-title"
      },
      "volumeConfig": {
        "image": "nginx",
        "label": "default-label",
        "accessmode": "VOLUME_INSTANCE_ACCESS_MODE_READONLY",
        "type": "VOLUME_INSTANCE_TYPE_CONTENT_TREE"
      }
    }
  ]
}
```

### Asset Group

```json theme={"dark"}
{
  "name": "retail_store_nodes_east",
  "title": "East Region Retail Store Nodes",
  "description": "All nodes deployed in retail stores across the Eastern region.",
  "projectId": "<PROJECT_ID>",
  "assetIds": {
    "ids": [
      "<NODE_ID_1>",
      "<NODE_ID_2>",
      "<NODE_ID_3>"
    ]
  }
}
```

Alternatively, target by tags instead of explicit IDs:

```json theme={"dark"}
{
  "assetTags": {
    "assetTag": [
      {
        "tag": {
          "region": "east",
          "location_type": "retail-store"
        }
      }
    ]
  }
}
```

### Deployment Profile

```json theme={"dark"}
{
  "name": "deploy_web_profile_east_retail",
  "title": "Deploy Web Server Profile to East Retail Stores",
  "projectId": "<PROJECT_ID>",
  "appProfileInfo": {
    "appProfileId": "<APP_PROFILE_ID>",
    "version": 1
  },
  "targetAssetGroup": {
    "group_id": "<ASSET_GROUP_ID>"
  }
}
```

## Terraform Example

The Terraform Provider for ZEDEDA Cloud provides corresponding resource types for all three objects. The App Profile resource also depends on `zedcloud_datastore` and `zedcloud_image` resources.

```hcl theme={"dark"}
resource "zedcloud_app_profile" "web_server_app_profile" {
  depends_on = [zedcloud_image.nginx_image]
  name  = "web_server_app_profile"
  title = "my web server app profile"

  app_policies {
    meta_data {
      name  = "nginx"
      title = "nginx app"
    }
    app_config {
      cpus   = 2
      memory = 2048000
      manifest_json {
        ac_kind     = "VMManifest"
        ac_version  = "1.1.2"
        name        = "nginx"
        description = "simple nginx server"
        vmmode      = "HV_HVM"
        images {
          imagename = zedcloud_image.nginx_image.name
          imageid   = zedcloud_image.nginx_image.id
          maxsize   = zedcloud_image.nginx_image.image_size_bytes
          target    = "Disk"
          drvtype   = "HDD"
          preserve  = true
        }
        interfaces {
          name = "eth0"
        }
      }
      interfaces {
        intf_name    = "eth0"
        net_inst_tag = { "hello" = "world" }
      }
      start_delay_in_seconds = 0
    }
  }

  network_policies {
    meta_data {
      name  = "default-network-policy-name"
      title = "default-network-policy-title"
    }
    network_config {
      port = "111"
      type = "NETWORK_INSTANCE_DHCP_TYPE_V4"
      kind = "NETWORK_INSTANCE_KIND_LOCAL"
    }
  }

  volume_policies {
    meta_data {
      name  = "default-volume-policy-name"
      title = "default-volume-policy-title"
    }
    volume_config {
      image      = zedcloud_image.nginx_image.name
      label      = "default-label"
      accessmode = "VOLUME_INSTANCE_ACCESS_MODE_READONLY"
      type       = "VOLUME_INSTANCE_TYPE_CONTENT_TREE"
    }
  }
}

resource "zedcloud_asset_group" "retail_store_nodes_east" {
  name        = "retail_store_nodes_east"
  title       = "East Region Retail Store Nodes"
  description = "All nodes deployed in retail stores across the Eastern region."
  project_id  = data.zedcloud_project.retail_project_data.id

  asset_ids {
    ids = [
      data.zedcloud_edgenode.retail_node_1_data.id,
      data.zedcloud_edgenode.retail_node_2_data.id
    ]
  }

  asset_tags {
    tag = {
      "region"        = "east"
      "location_type" = "retail-store"
    }
  }
}

resource "zedcloud_profile_deployment" "deploy_web_profile_east_retail" {
  name        = "deploy_web_profile_east_retail"
  title       = "Deploy Web Server Profile to East Retail Stores"
  project_id  = data.zedcloud_project.retail_project_data.id

  app_profile_info {
    app_profile_id = data.zedcloud_app_profile.web_server_app_profile_data.id
    version        = 1
  }

  target_asset_group {
    group_id = data.zedcloud_asset_group.east_retail_asset_group_data.id
  }

  depends_on = [
    zedcloud_app_profile.web_server_app_profile,
    zedcloud_asset_group.retail_store_nodes_east
  ]
}
```

## Next Steps

> [card] [Deploy an Application Instance](https://zededa.mintlify.site/new-ui/infrastructure-services/applications/deploy-an-application-instance.md)
>
> Deploy individual instances through the console.

> [card] [Manage an Application Instance](https://zededa.mintlify.site/new-ui/infrastructure-services/applications/manage-an-application-instance.md)
>
> Check the status of deployed instances.

> [card] [Deploy AI Applications to a Fleet of Nodes](https://zededa.mintlify.site/new-ui/infrastructure-services/applications/deploy-ai-applications-to-a-fleet.md)
>
> A use case walkthrough that combines console and API approaches.
