Manage scopes
Scopes are a foundational part of Boundary. By modeling permission boundaries as a container, scopes allow users to partition resources and assign ownership of resources to principals.
There are three types of scopes within Boundary:
- Global (
global
) - Org
- Project
Note
Within the software itself and in the documentation, Boundary uses org instead of organization to remove ambiguity between different regional spellings of the word.
Scopes hierarchy:
- The
global
scope is the outermost scope. There is only oneglobal
scope, and it cannot be deleted. It is the entry point for initial administration, setup, and management of the org scopes. - The
global
scope can contain multiple org scopes. Orgs are used to hold IAM-related resources and project scopes. - Each org scope can contain multiple project scopes. Projects are used to hold infrastructure-related resources.
Some resources can only be associated with a specific level of scope. For example, targets can only be created within a project, while users can be created at the global-level or an org-level. See the domain model for detailed resource-specific information.
In this tutorial, you will create two scopes: an org and a project.
All resource IDs in this tutorial are illustrations only. IDs are uniquely
generated for every resource upon creation, except for the resources generated
in dev
mode. Be sure to use the resource IDs generated for your
environment. For example, if you execute boundary users create
, use the
resource ID of the user printed in stdout
, not the ID in the example
command.
Prerequisites
To perform the tasks described in this tutorial, you need to have a Boundary
environment. Refer to the Getting
Started tutorial to learn about
installation and Boundary's dev
mode.
To complete this tutorial, you need:
A Boundary binary in your
PATH
. This tutorial uses the 0.8.1 version of Boundary.Boundary must be running in
dev
mode.Terraform 0.13.0 or greater provides an optional workflow for these tutorials. The binary must be available in your
PATH
. A Recovery Key must also be copied from the output ofboundary dev
. See the tutorial introduction if you do not have a recovery key.
Create an org
Start by creating an org under the global
scope.
The CLI and Admin Console create administrative roles automatically when a scope is generated. This allows the user that created the scope to immediately manage it.
Log in to Boundary as the admin user.
Create a new org under the global
scope named "IT_Support" with the
description "IT Support Team".
List the existing scopes.
In this example, the generated scope ID for IT_Support is o_u54jrD6ydN
.
Notice that org ID starts with o_
.
Copy the ID of the IT_Support
org and save it as the environment variable
ORG_ID
.
Example:
Create a project
Next, create a new project named QA_Tests under the "IT_Support" scope with the description "Manage QA machines".
To create a project under the IT_Support
org, execute the boundary scopes
create
command.
List the project under the IT_Support
org to verify.
In this example, the generated project ID is p_MoXk2hMkhW
. Notice that project
ID starts with p_
.
Copy the ID of the QA_Tests
project and save it as an environment variable,
PROJECT_ID
.
Example:
Next steps
You created a new org, IT_Support which has the QA_Tests project. Those new scopes can help create logical groupings of Boundary resources such as targets, users, groups, and roles.
You are now ready to define scope-level resources and manage them per scope. Next, the Manage Targets tutorial demonstrates adding Targets to Boundary.