Deploy Orchestrator Defenders on Amazon ECS

This guide shows you how to deploy Prisma Cloud Defenders in an ECS cluster.
The Defender protects your containerized environment according to the policies you set in Prisma Cloud Console. It runs as a service in your ECS cluster. The parameters of the service are described in a task definition, and the task definition is written in JSON format. To automatically deploy an instance of Defender on each node in your cluster, you’ll run the Defender task as a daemon service.
The Defender deployment process consists of the following steps.
  1. Create worker nodes in your ECS cluster.
  2. Create a task definition for the Prisma Cloud Defender.
  3. Create a service of type Daemon to deploy Defender to every node in the cluster.
This deployment guide includes the following steps you need to take in AWS before you deploy the Defender if you haven’t provisioned a cluster.
If you already have an AWS ECS cluster with worker nodes and are familiar with the AWS interface, you can skip directly to creating the Defender task definition.
Before you create the task definition, ensure that the launch configuration for your worker nodes in ECS includes the following actions.
  • Run the Amazon ECS-Optimized Amazon Linux 2 AMI.
  • Use the ecsInstanceRole IAM role.
  • Run the following script for worker nodes to join the cluster and install the Defender.
    #!/bin/bash echo ECS_CLUSTER=pc-ecs-cluster >> /etc/ecs/ecs.config
ECS_CLUSTER must match your cluster name. Replace pc_ecs_cluster with the name of the cluster where you create launch configurations and auto-scaling groups to start EC2 instances for Prisma Cloud. Modify your user data scripts accordingly.
To better understand clusters, read our cluster context topic.

Create your ECS Cluster

Create an empty cluster named pc-ecs-cluster. This is the cluster where you will create launch configurations and auto-scaling groups to start EC2 instances.
  1. Log into the AWS Management Console.
  2. Go to
    Services > Containers > Elastic Container Service
    .
  3. Click
    Create Cluster
    .
  4. Select
    Networking only
    , then click
    Next Step
    .
  5. Enter a cluster name, such as pc-ecs-cluster.
  6. Click
    Create
    .

Create a launch configuration for worker nodes

Create a launch configuration named pc-worker-node that:
  • Runs the Amazon ECS-Optimized Amazon Linux 2 AMI.
  • Uses the ecsInstanceRole IAM role.
  • Runs a user data script that joins the pc-ecs-cluster and runs the commands required to install Defender.
  1. Go to
    Services > Compute > EC2
    .
  2. In the left menu, click
    Auto Scaling > Launch Configurations
    .
  3. Click
    Create Launch Configuration
  4. In
    Name
    , enter a name for your launch configuration, such as pc-worker-node.
  5. In Amazon machine image, select
    Amazon ECS-Optimized Amazon Linux 2 AMI
    .
    You can get a complete list of per-region Amazon ECS-optimized AMIs from here.
  6. Choose an instance type, such as t2.medium.
  7. Under
    Additional configuration
    :
    1. In
      IAM instance profile
      , select ecsInstanceRole.
    2. Under
      User data
      , select
      Text
      , and paste the following code snippet:
      #!/bin/bash echo ECS_CLUSTER=pc-ecs-cluster >> /etc/ecs/ecs.config
      Where:
      • ECS_CLUSTER must match your cluster name. If you’ve named your cluster something other than pc_ecs_cluster, then modify your user data script accordingly.
    3. (Optional) In
      IP Address Type
      , select
      Assign a public IP address to every instance
      .
      With this option, you can easily SSH to this instance to troubleshoot issues.
  8. Under
    Security groups
    :
    1. Select
      Select an existing security group
      .
    2. Select
      pc-security-group
      .
  9. Under
    Key pair (login)
    , select an existing key pair, or create a new key pair so that you can access your instances.
  10. Click
    Create launch configuration
    .

Create an auto scaling group for worker nodes

Launch two worker nodes into your cluster.
  1. Go to
    Services > Compute > EC2
    .
  2. In the left menu, click
    Auto Scaling > Auto Scaling Groups
    .
  3. Click
    Create an Auto Scaling group
    .
  4. In
    Choose launch template or configuration
    :