Starting the Amazon AppConfig agent for Amazon ECS integration
The Amazon AppConfig Agent sidecar container is automatically available in your Amazon ECS environment. To use it, you must start it, as described in the following procedure.
To start Amazon ECS (console)
Open the console at https://console.amazonaws.cn/ecs/v2
. -
In the navigation pane, choose Task definitions.
-
Choose the task definition for your application, and then select the latest revision.
-
Choose Create new revision, Create new revision.
-
Choose Add more containers.
-
For Name, enter a unique name for the Amazon AppConfig Agent container.
-
For Image URI, enter:
public.ecr.aws/aws-appconfig/aws-appconfig-agent:2.x
-
For Essential container, choose Yes.
-
In the Port mappings section, choose Add port mapping.
-
For Container port, enter
2772
.Note
Amazon AppConfig Agent runs on port 2772, by default. You can specify a different port.
-
Choose Create. Amazon ECS creates a new container revision and displays the details.
-
In the navigation pane, choose Clusters, and then choose your application cluster in the list.
-
On the Services tab, select the service for your application.
-
Choose Update.
-
Under Deployment configuration, for Revision, choose the latest revision.
-
Choose Update. Amazon ECS deploys the latest task definition.
-
After the deployment finishes, you can verify that Amazon AppConfig Agent is running on the Configuration and tasks tab. On the Tasks tab, choose the running task.
-
In the Containers section, verify that the Amazon AppConfig Agent container is listed.
-
To verify that Amazon AppConfig Agent started, choose the Logs tab. Locate a statement like the following for the Amazon AppConfig Agent container:
[appconfig agent] 1970/01/01 00:00:00 INFO serving on localhost:2772
Note
Note the following information.
-
Amazon AppConfig Agent is a long-running process. As a best practice for Amazon ECS containers, configure health checks for your containers, specifically setting the container dependency to the HEALTHY condition. For more information, see ContainerDependency in the Amazon Elastic Container Service API Reference.
-
You can adjust the default behavior of Amazon AppConfig Agent by entering or changing environment variables. For information about the available environment variables, see (Optional) Using environment variables to configure Amazon AppConfig Agent for Amazon ECS and Amazon EKS. For information about how to change environment variables in Amazon ECS, see Passing environment variables to a container in the Amazon Elastic Container Service Developer Guide.