To remove a gateway, you must first remove all of its components, such as its networks, instances, and bridges. The following is the process for removing a gateway and its components.
Contents
Prerequisites
The following procedure assumes that you have previously created at least one MediaConnect Gateway.
Procedure
You can remove a gateway using the console or the AWS CLI.
To remove a gateway using the console
Open the MediaConnect console at https://console.aws.amazon.com/mediaconnect/
. -
From the navigation pane, select Gateways. In the Gateways section, select the gateway you want to delete.
-
On the MediaConnect Gateway details page, select the Bridges tab. Complete the following steps to delete the bridges:
-
Select the bridge you want to delete.
-
If the bridge has been started, select Stop.
-
When the bridge is stopped, select Delete.
-
Confirm the deletion of the bridge by selecting Delete bridge.
-
Repeat these steps for any additional bridges you need to delete.
-
-
Return to the gateway's Details page, select the Instances tab. Complete the following steps to delete the instances:
-
Select the instance you want to delete.
-
Select Deregister.
-
Confirm the deregistration of the instance by selecting Deregister instance.
-
Repeat these steps for any additional instances you need to deregister.
Note
OPTIONAL: If you want to reuse the instance for Amazon ECS Anywhere or as another gateway instance, you will need to complete the following steps. If not, continue with Step 5.
-
Make sure that the Instance state is Deregistered for the instance you want to reuse.
-
From a computer with the access to do so, connect to the instance using SSH.
-
Run the following commands, in order:
sudo docker stop $(sudo docker ps -f "name=MediaConnectGatewayAgent" -q); \ sudo docker stop ecs-agent; \ sudo systemctl stop ecs amazon-ssm-agent; \ sudo yum remove -y amazon-ecs-init amazon-ssm-agent; `# or apt or snap as needed` \ sudo rm /var/lib/ecs /etc/ecs /var/lib/amazon/ssm /var/log/ecs /var/log/amazon/ssm -rf; \ sudo docker rm -f ecs-agent ssm-agent; \ sudo docker container rm -f $(sudo docker ps -a -f "name=MediaConnectGatewayAgent" -q); \ sudo docker volume rm -f ecsdata docker run; \ sudo pkill -f -KILL network_bootstra[p]; \ sudo pkill -KILL mcproxy;
-
-
After successfully deleting all bridges and deregistering all instances associated with the gateway, you may delete the gateway. Deleting the gateway will delete all networks created under that gateway.
-
From the navigation pane, select Gateways.
-
In the Gateways section, select the gateway that you want to delete to view that gateway's Details page.
-
Choose the Delete button.
-
Confirm the deletion of the gateway by choosing Delete gateway.
-