Skip to content

Commit

Permalink
Update examples and add README to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sahaqaa committed Aug 29, 2024
1 parent 3bc4984 commit ff92322
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
9 changes: 9 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Important
As for now currently examples inside this folder are just to show how some specific resources could look like, or how they could be implemented.
Examples inside this folder are not intended to provide complete picture or full working example.
Please be careful to understand what resources you copy from this folder and give it a double check if it will suite your needs (or not) and adjust this code to your specific needs.

## Some generic consideration
If you have small amount of users it is okay to use local users (created inside CloudConnexa), examples in this folder will help you to achieve this.
If you have quite big amount of users - at some point it would be beneficial to look into managing users via LDAP or SAML. It is not possible (yet) configure LDAP and SAML settings via Terraform provider, this functionality will be added in the future releases.
If you have configured LDAP or SAML via CloudConnexa Admin UI - then using Terraform resource "cloudconnexa_user" will be not needed.
11 changes: 11 additions & 0 deletions example/user_groups.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Simple example
resource "cloudconnexa_user_group" "this" {
name = "test-group"
vpn_region_ids = ["eu-central-1"]
connect_auth = "AUTH"
}

# Advanced example
resource "cloudconnexa_user_group" "this" {
for_each = var.user_groups
name = each.key
connect_auth = try(each.value.connect_auth, "AUTO")
internet_access = try(each.value.internet_access, "LOCAL")
max_device = try(each.value.max_device, 3)
all_regions_included = true
}
17 changes: 16 additions & 1 deletion example/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ variable "users" {
group = "Developer"
role = "MEMBER"
}
"Username3" = {
"Max_Mustermann" = {
username = "Username3"
email = "[email protected]"
group = "Support"
Expand Down Expand Up @@ -68,3 +68,18 @@ variable "routes" {
},
]
}

variable "user_groups" {
description = "Variable for specifying configuration for User Groups"
type = map(object({
connect_auth = optional(string)
internet_access = optional(string)
max_device = optional(number)
}))
default = {
admins = { max_device = 10 }
users = { max_device = 6 }
support = {}
marketing = {}
}
}

0 comments on commit ff92322

Please sign in to comment.