New Relic's on-host ECS integration reports and displays performance data from your Amazon ECS environment. Read on to learn how to uninstall this integration.
Uninstall
There are several uninstall options, depending on how you installed:
CloudFormation uninstall
To uninstall the ECS integration using the CloudFormation templates:
- Go to the list of stacks in your AWS console.
- For each New Relic stack:
- Select the stack
- Click the delete button
- Click the delete stack button on the confirmation pop-up.
Automatic uninstall
To uninstall the ECS integration using the installer script:
For EC2 and EXTERNAL launch type: run
./newrelic-infrastructure-ecs-installer.sh -u -c YOUR_CLUSTER_NAMEFor Fargate launch type:
bash$./newrelic-infrastructure-ecs-installer.sh -f -u -c YOUR_CLUSTER_NAME
You only need to execute the command once, regardless of the number of nodes in your cluster. The command will delete the AWS resources created during the install procedure.
The installer provides a dry run mode that shows you the awscli commands that are going to be executed. The dry run mode for the uninstall process is activated by passing the -d
flag to the command:
$./newrelic-infrastructure-ecs-installer.sh -d -u -c YOUR_CLUSTER_NAME
Manual uninstall
To uninstall manually, you must delete all the AWS resources related to the integration. To do this:
Check that your AWS profile points to the same region where your ECS cluster was created:
bash$aws configure get regionus-east-1$aws ecs list-clustersYOUR_CLUSTER_ARNSarn:aws:ecs:us-east-1:YOUR_AWS_ACCOUNT:cluster/YOUR_CLUSTERDelete the Systems Manager (SSM) parameter that stores the New Relic :
bash$aws ssm delete-parameter --name "/newrelic-infra/ecs/license-key"Before deleting the IAM role, you need to detach all of its policies. To get a list of the attached policies:
bash$aws iam list-attached-role-policies \>--role-name "NewRelicECSTaskExecutionRole" \>--output text \>--query 'AttachedPolicies[*].PolicyArn'Detach all the policies returned in the previous step from the IAM role:
bash$aws iam detach-role-policy --role-name "NewRelicECSTaskExecutionRole" --policy-arn "POLICY_ARN"Delete the IAM role:
bash$aws iam delete-role --role-name "NewRelicECSTaskExecutionRole"Delete the IAM policy
NewRelicSSMLicenseKeyReadAccess
, which grants System Manager license key access:bash$aws iam delete-policy --policy-arn "POLICY_ARN"The remaining steps are only for EC2 and EXTERNAL launch type, and not Fargate:
Delete the services:
bash$aws ecs delete-service --service "newrelic-infra" --cluster "YOUR_CLUSTER_NAME"bash$aws ecs delete-service --service "newrelic-infra-external" --cluster "YOUR_CLUSTER_NAME"List the task definition for the
newrelic-infra
family of tasks:bash$aws ecs list-task-definitions \>--family-prefix newrelic-infra \>--output text \>--query taskDefinitionArnsDeregister the tasks:
bash$aws ecs deregister-task-definition --task-definition "TASK_DEFINITION_ARN"