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.
- Create worker nodes in your ECS cluster.
- Create a task definition for the Prisma Cloud Defender.
- 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.configECS_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 ClusterCreate 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.
- Log into the AWS Management Console.
- Go toServices > Containers > Elastic Container Service.
- ClickCreate Cluster.
- SelectNetworking only, then clickNext Step.
- Enter a cluster name, such as pc-ecs-cluster.
- ClickCreate.
Create a launch configuration for worker nodesCreate 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.
- Go toServices > Compute > EC2.
- In the left menu, clickAuto Scaling > Launch Configurations.
- ClickCreate Launch Configuration
- InName, enter a name for your launch configuration, such as pc-worker-node.
- In Amazon machine image, selectAmazon ECS-Optimized Amazon Linux 2 AMI.You can get a complete list of per-region Amazon ECS-optimized AMIs from here.
- Choose an instance type, such as t2.medium.
- UnderAdditional configuration:
- InIAM instance profile, select ecsInstanceRole.
- UnderUser data, selectText, and paste the following code snippet:#!/bin/bash echo ECS_CLUSTER=pc-ecs-cluster >> /etc/ecs/ecs.configWhere:
- 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.
(Optional) InIP Address Type, selectAssign a public IP address to every instance.With this option, you can easily SSH to this instance to troubleshoot issues. - UnderSecurity groups:
- SelectSelect an existing security group.
- Selectpc-security-group.
- UnderKey pair (login), select an existing key pair, or create a new key pair so that you can access your instances.
- ClickCreate launch configuration.
Create an auto scaling group for worker nodesLaunch two worker nodes into your cluster.- Go toServices > Compute > EC2.
- In the left menu, clickAuto Scaling > Auto Scaling Groups.
- ClickCreate an Auto Scaling group.
- InChoose launch template or configuration: