Skip to content

Commit e25a01c

Browse files
lantoliCopilot
andauthored
chore: Update examples and doc to use SA instead of PAK (#3804)
Co-authored-by: Copilot <[email protected]>
1 parent 8cf71d8 commit e25a01c

File tree

230 files changed

+954
-728
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+954
-728
lines changed

examples/migrate_atlas_user_and_atlas_users/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Clean final configuration using only:
3939
Set these variables for all versions:
4040

4141
```terraform
42-
public_key = "your-mongodb-atlas-public-key" # Optional, can use env vars
43-
private_key = "your-mongodb-atlas-private-key" # Optional, can use env vars
42+
client_id = "<ATLAS_CLIENT_ID>" # Optional, can use env vars
43+
client_secret = "<ATLAS_CLIENT_SECRET>" # Optional, can use env vars
4444
org_id = "your-organization-id"
4545
project_id = "your-project-id"
4646
team_id = "your-team-id"
@@ -50,6 +50,6 @@ username = "[email protected]"
5050

5151
Alternatively, set environment variables:
5252
```bash
53-
export MONGODB_ATLAS_PUBLIC_KEY="your-public-key"
54-
export MONGODB_ATLAS_PRIVATE_KEY="your-private-key"
53+
export MONGODB_ATLAS_CLIENT_ID="<ATLAS_CLIENT_ID>"
54+
export MONGODB_ATLAS_CLIENT_SECRET="<ATLAS_CLIENT_SECRET>"
5555
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
provider "mongodbatlas" {
2-
public_key = var.public_key
3-
private_key = var.private_key
2+
client_id = var.atlas_client_id
3+
client_secret = var.atlas_client_secret
44
}

examples/migrate_atlas_user_and_atlas_users/v1/variables.tf

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
variable "public_key" {
2-
type = string
3-
default = ""
1+
variable "atlas_client_id" {
2+
description = "MongoDB Atlas Service Account Client ID"
3+
type = string
4+
default = ""
45
}
5-
variable "private_key" {
6-
type = string
7-
default = ""
6+
variable "atlas_client_secret" {
7+
description = "MongoDB Atlas Service Account Client Secret"
8+
type = string
9+
sensitive = true
10+
default = ""
811
}
912

1013
variable "org_id" {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
provider "mongodbatlas" {
2-
public_key = var.public_key
3-
private_key = var.private_key
2+
client_id = var.atlas_client_id
3+
client_secret = var.atlas_client_secret
44
}

examples/migrate_atlas_user_and_atlas_users/v2/variables.tf

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
variable "public_key" {
2-
type = string
3-
default = ""
1+
variable "atlas_client_id" {
2+
description = "MongoDB Atlas Service Account Client ID"
3+
type = string
4+
default = ""
45
}
5-
variable "private_key" {
6-
type = string
7-
default = ""
6+
variable "atlas_client_secret" {
7+
description = "MongoDB Atlas Service Account Client Secret"
8+
type = string
9+
sensitive = true
10+
default = ""
811
}
912

1013
variable "org_id" {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
provider "mongodbatlas" {
2-
public_key = var.public_key
3-
private_key = var.private_key
2+
client_id = var.atlas_client_id
3+
client_secret = var.atlas_client_secret
44
}

examples/migrate_atlas_user_and_atlas_users/v3/variables.tf

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
variable "public_key" {
2-
type = string
3-
default = ""
1+
variable "atlas_client_id" {
2+
description = "MongoDB Atlas Service Account Client ID"
3+
type = string
4+
default = ""
45
}
5-
variable "private_key" {
6-
type = string
7-
default = ""
6+
variable "atlas_client_secret" {
7+
description = "MongoDB Atlas Service Account Client Secret"
8+
type = string
9+
sensitive = true
10+
default = ""
811
}
912

1013
variable "org_id" {

examples/migrate_cluster_to_advanced_cluster/module_user/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ The rest of this example is a step by step guide on how to migrate from `mongodb
3333
- Terraform CLI >= 1.8
3434
- Terraform MongoDB Atlas Provider `>=v1.29.0`
3535
- A MongoDB Atlas account.
36-
- Configure the provider (can also be done by configuring `public_key` and `private_key` in a `provider.tfvars`).
36+
- Configure the provider (can also be done by configuring `atlas_client_id` and `atlas_client_secret` in a `provider.tfvars`).
3737

3838
```bash
39-
export MONGODB_ATLAS_PUBLIC_KEY="<ATLAS_PUBLIC_KEY>"
40-
export MONGODB_ATLAS_PRIVATE_KEY="<ATLAS_PRIVATE_KEY>"
39+
export MONGODB_ATLAS_CLIENT_ID="<ATLAS_CLIENT_ID>"
40+
export MONGODB_ATLAS_CLIENT_SECRET="<ATLAS_CLIENT_SECRET>"
4141
```
4242

4343
## Step 1: Create the `mongodbatlas_cluster` with `v1` of the module

examples/migrate_cluster_to_advanced_cluster/module_user/v1/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
provider "mongodbatlas" {
2-
public_key = var.public_key
3-
private_key = var.private_key
2+
client_id = var.atlas_client_id
3+
client_secret = var.atlas_client_secret
44
}
55

66
module "cluster" {

examples/migrate_cluster_to_advanced_cluster/module_user/v1/variables.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
variable "public_key" {
2-
description = "Public API key to authenticate to Atlas"
1+
variable "atlas_client_id" {
2+
description = "MongoDB Atlas Service Account Client ID"
33
type = string
44
default = ""
55
}
6-
variable "private_key" {
7-
description = "Private API key to authenticate to Atlas"
6+
variable "atlas_client_secret" {
7+
description = "MongoDB Atlas Service Account Client Secret"
88
type = string
9+
sensitive = true
910
default = ""
1011
}
1112

0 commit comments

Comments
 (0)