HashiCorp Cloud Platform
Create and manage agents
This page describes how to manage HCP Waypoint agents to run actions. Platform engineers often perform these tasks. Refer to Actions for additional information.
Create an agent group
To create an agent group, complete the following steps:
- From the HCP Waypoint overview, click Agents in the side navigation.
- Click Create an agent group.
- Enter an Agent group name and Description for the agent group. An agent group name defines which Waypoint agents should execute a particular action.
- Click Create agent group.
After you create the agent group, HCP Waypoint shows an example agent configuration file.
Create an action
To create an action, complete the following steps:
- From the HCP Waypoint overview, click Actions.
- Click Create an action.
- Enter an Action name and Description for the action.
- Under Action type select Agent.
- Under Action details select your agent group.
- Enter the action identifier that matches the name of the
action
block in your agent configuration.
Create an agent configuration file
An agent configuration file defines one or more actions that the agent can run. For more information, refer to the agent configuration syntax documentation for more information.
group "internal-us-west-2" {
action "hello-action" {
run {
command = ["echo", "hello", var.waypoint_action]
}
}
}
Run the agent
To run an agent with your configuration, complete the following steps:
Install the HCP CLI
Authenticate the HCP CLI with the
hcp auth login
commandStart the agent:
$ hcp waypoint agent run --config=PATH_TO_CONFIG_FILE