You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Serverless admin user and API-only key workflow improvements (#7277)
Clarifies the confusion around the built-in `admin` user returned when
creating
Serverless projects via the API (see elastic/docs-content-internal#546).
---------
Co-authored-by: wajihaparvez <wajiha.parvez@elastic.co>
Copy file name to clipboardExpand all lines: deploy-manage/deploy/elastic-cloud/manage-serverless-projects-using-api.md
+21-18Lines changed: 21 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,11 @@ navigation_title: Manage projects with API
8
8
9
9
# Manage serverless projects using the API [serverless-api]
10
10
11
-
On this page, you can find examples of how to create and manage serverless projects using the [Elastic Cloud Serverless API]({{cloud-serverless-apis}}), covering common operations such as:
11
+
On this page, you can find examples of how to create and manage serverless projects using the [{{serverless-full}} API]({{cloud-serverless-apis}}), covering common operations such as:
12
12
13
13
-[Creating a project](#general-manage-project-with-api-create-a-serverless-elasticsearch-project)
-[Deleting a project](#general-manage-project-with-api-delete-project)
18
17
-[Updating a project](#general-manage-project-with-api-update-project)
19
18
-[Listing regions where projects can be created](#general-manage-project-with-api-list-available-regions)
@@ -26,7 +25,7 @@ To try the examples in this section, start by [setting up an API key](#general-m
26
25
27
26
## API resources
28
27
29
-
To learn about API principles, authentication, and how to use the OpenAPI specification, refer to the [Elastic Cloud Serverless API]({{cloud-serverless-apis}}) documentation.
28
+
To learn about API principles, authentication, and how to use the OpenAPI specification, refer to the [{{serverless-full}} API]({{cloud-serverless-apis}}) documentation.
30
29
31
30
The available APIs are grouped by project type:
32
31
@@ -36,12 +35,20 @@ The available APIs are grouped by project type:
36
35
37
36
## Set up an API key [general-manage-project-with-api-set-up-api-key]
38
37
39
-
1.[Create an API key](https://www.elastic.co/docs/deploy-manage/api-keys/elastic-cloud-api-keys).
38
+
To create and manage projects with the {{serverless-full}} API, you must authenticate your requests with an {{ecloud}} API key.
39
+
40
+
1. As an **Organization owner**, [create an {{ecloud}} API key](/deploy-manage/api-keys/elastic-cloud-api-keys.md) with one of the following roles:
41
+
42
+
-**Organization owner**
43
+
-**Cloud resource access** with the **Admin** role assigned to **all projects** of the relevant type ({{es}}, {{observability}}, or Security)
44
+
45
+
Select the key's **API access** level based on what you need it to do: **Cloud API** access is enough to manage projects, while **Cloud, {{es}}, and {{kib}} API** access also grants access to the project's {{es}} and {{kib}} endpoints. For more details, refer to [User roles and privileges](/deploy-manage/users-roles/cloud-organization/user-roles.md).
46
+
40
47
2. Store the generated API key as an environment variable so that you don’t need to specify it again for each request:
41
48
42
-
```console
43
-
export API_KEY="YOUR_GENERATED_API_KEY"
44
-
```
49
+
```console
50
+
export API_KEY="YOUR_GENERATED_API_KEY"
51
+
```
45
52
46
53
## Create an {{serverless-full}} project [general-manage-project-with-api-create-a-serverless-elasticsearch-project]
1. Replace `My project` with a more descriptive name in this call.
62
69
2. You can obtain a [list of available regions](#general-manage-project-with-api-list-available-regions).
63
70
64
-
The response from the create project request will include the created project details, such as the project ID, the credentials to access the project, and the endpoints to access different apps such as {{es}} and {{kib}}.
71
+
The response from the create project request will include the created project details, including the project ID, the endpoints to access different apps such as {{es}} and {{kib}}, and a set of default credentials.
65
72
66
73
Example of `Create project` response:
67
74
@@ -80,6 +87,12 @@ Example of `Create project` response:
80
87
}
81
88
```
82
89
90
+
:::{note}
91
+
For programmatic access to the project's {{es}} and {{kib}} APIs, we recommend creating an [{{ecloud}} API key with access to the {{es}} and {{kib}} APIs](/deploy-manage/api-keys/elastic-cloud-api-keys.md#project-access) rather than using the default credentials.
92
+
93
+
The default credentials returned in the `credentials` field serve as a fallback mechanism to access the project when no API key is available. Store them in a secure location, and use the [reset credentials API]({{cloud-serverless-apis}}operation/operation-resetelasticsearchprojectcredentials) if you need to recover or rotate them.
94
+
:::
95
+
83
96
You can store the project ID as an environment variable for the next requests:
0 commit comments