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 launch type: run
$ ./newrelic-infrastructure-ecs-installer.sh -u -c YOUR_CLUSTER_NAME
For Fargate launch type:
$ ./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:
$ aws configure get region us-east-1 $ aws ecs list-clusters YOUR_CLUSTER_ARNS arn:aws:ecs:us-east-1:YOUR_AWS_ACCOUNT:cluster/YOUR_CLUSTER
Delete the Systems Manager (SSM) parameter that stores the New Relic license key:
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:
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:
aws iam detach-role-policy --role-name "NewRelicECSTaskExecutionRole" --policy-arn "POLICY_ARN"
Delete the IAM role:
aws iam delete-role --role-name "NewRelicECSTaskExecutionRole"Delete the IAM policy
NewRelicSSMLicenseKeyReadAccess
, which grants System Manager license key access:aws iam delete-policy --policy-arn "POLICY_ARN"
The remaining steps are only for EC2 launch type, and not Fargate:
Delete the service:
aws ecs delete-service --service "newrelic-infra" --cluster "YOUR_CLUSTER_NAME"
List the task definition for the
newrelic-infra
family of tasks:aws ecs list-task-definitions \--family-prefix newrelic-infra \--output text \--query taskDefinitionArnsDeregister the tasks:
aws ecs deregister-task-definition --task-definition "TASK_DEFINITION_ARN"
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's and and documentation.