hcp iam service-principals create
Command: hcp iam service-principals create
The hcp iam service-principals create
command creates a new service
principal.
Once a service principal is created, access to the service principal can be
granted by generating keys using the hcp iam service-principals keys create
command or by federating access using an external workload identity provider
using hcp iam service-principals workload-identity-provider create
.
Service principals can be created at the organization scope or project scope. It is recommended to create service principals at the project scope to limit access to the service principal and to locate the service principal near the resources it will be accessing.
To create an organization service principal, set the --project
flag to -
.
Usage
Examples
Create a new service principal:
Create a new organization service principal:
Positional arguments
SP_NAME
- The name of the service principal to create.