visit
In the most classic version, when a new employee
Also, people are leaving us, and we must not forget to deny access to systems. Here it would be best if you acted strictly in the reverse order of the scheme (scheme 1).
The schemes perfectly describe the procedure, but to understand how Terraform will help us, let’s remember its ability to save and share from the output.
I use app.terraform.io to launch terraform and share it with outputs
terraform {
backend "remote" {
hostname = "app.terraform.io"
organization = "EXAMPLE"
workspaces {
name = "google-workspace"
}
}
}
provider "googleworkspace" {
# Use GOOGLEWORKSPACE_CREDENTIALS env
# More settings: //registry.terraform.io/providers/hashicorp/googleworkspace/latest/docs
customer_id = "XXXXXXX"
}
resource "googleworkspace_user" "arslanbekov" {
primary_email = "[email protected]"
org_unit_path = "developer"
name {
family_name = "Denis"
given_name = "Arslanbekov"
}
}
output "email" {
value = googleworkspace_user.arslanbekov.primary_email
}
output "name" {
value = googleworkspace_user.arslanbekov.name
}
If the user already exists, import it.
terraform import googleworkspace_user.arslanbekov [email protected]
terraform {
backend "local" {}
required_providers {
openvpncloud = {
source = "OpenVPN/openvpn-cloud"
version = "0.0.7"
}
}
}
provider "openvpncloud" {
base_url = "//company-name.api.openvpn.com"
}
data "terraform_remote_state" "google_workspace_email" {
backend = "remote"
config = {
organization = "EXAMPLE"
workspaces = {
name = "google-workspace"
}
}
}
resource "openvpncloud_user" "arslanbekov" {
username = "arslanbekov"
email = data.terraform_remote_state.google_workspace_email.outputs.arslanbekov
first_name = data.terraform_remote_state.google_workspace_email.outputs.name.family_name
last_name = data.terraform_remote_state.google_workspace_email.outputs.name.given_name
role = "USER"
}
For example, SendGrid:
terraform {
required_providers {
sendgrid = {
version = "1.0.0"
source = "anna-money/sendgrid"
}
}
}
provider "sendgrid" {
api_key = "SECRET_API_KEY"
}
data "terraform_remote_state" "google_workspace_email" {
backend = "remote"
config = {
organization = "EXAMPLE"
workspaces = {
name = "google-workspace"
}
}
}
resource "sendgrid_teammate" "arslanbekov" {
email = data.terraform_remote_state.google_workspace_email.outputs.arslanbekov
scopes = [
"alerts.create",
"alerts.read",
"alerts.update",
"alerts.delete",
]
is_admin = false
}