Skip to content

Commit

Permalink
Merge pull request #11 from Spotnana-Tech/typename
Browse files Browse the repository at this point in the history
Provider Typename alterations
kgibson-spotnana authored Feb 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents de0c2a5 + 2c1491f commit f599e1c
Showing 32 changed files with 145 additions and 142 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
A Terraform provider for managing Jumpcloud resources.

### Requirements
- [Spotnana Jumpcloud Go Client](https://github.com/Spotnana-Tech/sec-jumpcloud-client-go) >= 0.0.2
- [Spotnana Jumpcloud Go Client](https://github.com/Spotnana-Tech/sec-jumpcloud-client-go) >= 1.0.0
- [Terraform](https://developer.hashicorp.com/terraform/downloads) >= 1.0
- [Go](https://golang.org/doc/install) >= 1.20

@@ -12,8 +12,8 @@ A Terraform provider for managing Jumpcloud resources.
## Installation
Clone the repository locally
```shell
git clone https://github.com/Spotnana-Tech/sec-terraform-provider-snjumpcloud.git
cd sec-terraform-provider-snjumpcloud
git clone https://github.com/Spotnana-Tech/terraform-provider-jumpcloud.git
cd terraform-provider-jumpcloud
```
Build the provider using the Go `install` command:

@@ -30,7 +30,7 @@ cat > ~/.terraformrc <<EOF
provider_installation {
dev_overrides {
"github.com/Spotnana-Tech/snjumpcloud" = "$SN_GOPATH"
"Spotnana-Tech/jumpcloud" = "$SN_GOPATH"
}
# For all other providers, install them directly from their origin provider
@@ -42,7 +42,7 @@ EOF
```

## Testing
See [examples](examples/snjumpcloud) for usage and consult [Spotnana Security & Trust](https://spotnana.slack.com/archives/C03SV2FGLN7) team for help
See [examples](examples/jumpcloud) for usage and consult [Spotnana Security & Trust](https://spotnana.slack.com/archives/C03SV2FGLN7) team for help

While using local build of the provider, compact warnings to avoid long warnings in the output
```shell
@@ -55,19 +55,19 @@ export TF_VAR_api_key=<<YOUR_JUMPCLOUD_API_KEY>>
```
Navigate to the example directory and check the plan. If the plan is successful, the provider is installed correctly.
```shell
cd ./examples/snjumpcloud/confirm_install && terraform plan
cd ./examples/jumpcloud/confirm_install && terraform plan
```
---
# Usage
### All Features Example
See the [core example](examples/snjumpcloud/main.tf) to see all features executed in a single plan. Alternatively browse the [documentation](/docs) for a detailed list.
See the [core example](examples/jumpcloud/main.tf) to see all features executed in a single plan. Alternatively browse the [documentation](/docs) for a detailed list.
### Importing Existing Resources
Add an import block to the Terraform configuration file for the resource you want to import.
```terraform
import {
to = snjumpcloud_app.example_app
to = jumpcloud_app.example_app
id = "6abcd1230987654321" # The `app_id` of the application in Jumpcloud
}
```
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "snjumpcloud_apps Data Source - sec-terraform-provider-snjumpcloud"
page_title: "jumpcloud_apps Data Source - terraform-provider-jumpcloud"
subcategory: ""
description: |-
---

# snjumpcloud_apps (Data Source)
# jumpcloud_apps (Data Source)



## Example Usage

```terraform
data "snjumpcloud_apps" "all_apps" {}
data "jumpcloud_apps" "all_apps" {}
```

<!-- schema generated by tfplugindocs -->
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "snjumpcloud_usergroups Data Source - sec-terraform-provider-snjumpcloud"
page_title: "jumpcloud_usergroups Data Source - terraform-provider-jumpcloud"
subcategory: ""
description: |-
---

# snjumpcloud_usergroups (Data Source)
# jumpcloud_usergroups (Data Source)



## Example Usage

```terraform
data "snjumpcloud_usergroups" "all_usergroups" {}
data "jumpcloud_usergroups" "all_usergroups" {}
```

<!-- schema generated by tfplugindocs -->
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sec-terraform-provider-snjumpcloud Provider"
page_title: "jumpcloud Provider"
subcategory: ""
description: |-
---

# sec-terraform-provider-snjumpcloud Provider
# jumpcloud Provider



@@ -15,16 +15,16 @@ description: |-
```terraform
terraform {
required_providers {
snjumpcloud = {
source = "github.com/Spotnana-Tech/snjumpcloud"
jumpcloud = {
source = "Spotnana-Tech/jumpcloud"
}
}
}
variable "api_key" {
type = string
sensitive = true
}
provider "snjumpcloud" {
provider "jumpcloud" {
api_key = var.api_key
}
```
6 changes: 3 additions & 3 deletions docs/resources/snjumpcloud_app.md → docs/resources/app.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "snjumpcloud_app Resource - sec-terraform-provider-snjumpcloud"
page_title: "jumpcloud_app Resource - terraform-provider-jumpcloud"
subcategory: ""
description: |-
---

# snjumpcloud_app (Resource)
# jumpcloud_app (Resource)



## Example Usage

```terraform
resource "snjumpcloud_app" "example" {
resource "jumpcloud_app" "example" {
associated_groups = [
"6515a2000000d60001bc43cb",
"640000000000000001728dec",
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "snjumpcloud_usergroup Resource - sec-terraform-provider-snjumpcloud"
page_title: "jumpcloud_usergroup Resource - terraform-provider-jumpcloud"
subcategory: ""
description: |-
---

# snjumpcloud_usergroup (Resource)
# jumpcloud_usergroup (Resource)



## Example Usage

```terraform
resource "snjumpcloud_usergroup" "example" {
resource "jumpcloud_usergroup" "example" {
name = "example-name"
description = "example description"
}
1 change: 1 addition & 0 deletions examples/data-sources/jumpcloud_apps/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data "jumpcloud_apps" "all_apps" {}
1 change: 1 addition & 0 deletions examples/data-sources/jumpcloud_usergroups/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data "jumpcloud_usergroups" "all_usergroups" {}
1 change: 0 additions & 1 deletion examples/data-sources/snjumpcloud_apps/data-source.tf

This file was deleted.

This file was deleted.

22 changes: 11 additions & 11 deletions examples/snjumpcloud/app/main.tf → examples/jumpcloud/app/main.tf
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
terraform {
required_providers {
snjumpcloud = {
source = "github.com/Spotnana-Tech/snjumpcloud"
jumpcloud = {
source = "Spotnana-Tech/jumpcloud"
}
}
}
variable "api_key" {
type = string
sensitive = true
}
provider "snjumpcloud" {
provider "jumpcloud" {
api_key = var.api_key
}

# Create a few user groups
resource "snjumpcloud_usergroup" "group1" {
resource "jumpcloud_usergroup" "group1" {
name = "Test-Terraform-Group1"
description = "This group was created by Spotnana Terraform Provider!"
}
resource "snjumpcloud_usergroup" "group2" {
resource "jumpcloud_usergroup" "group2" {
name = "Test-Terraform-Group2"
description = "This group was also created by Spotnana Terraform Provider!"
}
resource "snjumpcloud_usergroup" "group3" {
resource "jumpcloud_usergroup" "group3" {
name = "Test-Terraform-Group3"
description = "This group was the 3rd created by Spotnana Terraform Provider!"
}

# Importing the app association via applicationID
import {
to = snjumpcloud_app.test_app
to = jumpcloud_app.test_app
id = "65bc1fdaf6fc2af5f541a4c3"
}

# Associate the user groups with the app
resource "snjumpcloud_app" "test_app" {
resource "jumpcloud_app" "test_app" {
associated_groups = [
snjumpcloud_usergroup.group1.id,
snjumpcloud_usergroup.group2.id,
snjumpcloud_usergroup.group3.id
jumpcloud_usergroup.group1.id,
jumpcloud_usergroup.group2.id,
jumpcloud_usergroup.group3.id
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
snjumpcloud = {
source = "github.com/Spotnana-Tech/snjumpcloud"
jumpcloud = {
source = "Spotnana-Tech/jumpcloud"
}
}
}
@@ -10,12 +10,12 @@ variable "api_key" {
type = string
sensitive = true
}
provider "snjumpcloud" {
provider "jumpcloud" {
api_key = var.api_key
}
data "snjumpcloud_usergroups" "all_usergroups" {}
data "jumpcloud_usergroups" "all_usergroups" {}

output "number_of_usergroups" {
value = length(data.snjumpcloud_usergroups.all_usergroups.usergroups)
value = length(data.jumpcloud_usergroups.all_usergroups.usergroups)
description = "The number of usergroups available in the JumpCloud API"
}
50 changes: 50 additions & 0 deletions examples/jumpcloud/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# This example covers all use cases for the jumpcloud provider
#
terraform {
required_providers {
jumpcloud = {
source = "Spotnana-Tech/jumpcloud"
}
}
}
variable "api_key" {
type = string
sensitive = true
}
provider "jumpcloud" {
api_key = var.api_key
}

# Pulls all usergroups from the JumpCloud API
data "jumpcloud_usergroups" "all_usergroups" {}

# Pulls all apps from the JumpCloud API
data "jumpcloud_apps" "all_apps" {}

# Create a new usergroup
resource "jumpcloud_usergroup" "new_usergroup" {
name = "tf-provider-test-new_usergroup"
description = "This is a new usergroup from the Terraform provider"
}

# Importing the app association via applicationID
import {
to = jumpcloud_app.test_app
id = "65bc1fdaf6fc2af5f541a4c3"
}

# Associate the user groups with the app
resource "jumpcloud_app" "test_app" {
associated_groups = [
jumpcloud_usergroup.new_usergroup.id
]
}

output "num_usergroups" {
value = length(data.jumpcloud_usergroups.all_usergroups.usergroups)
}

output "num_apps" {
value = length(data.jumpcloud_apps.all_apps.apps)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
snjumpcloud = {
source = "github.com/Spotnana-Tech/snjumpcloud"
jumpcloud = {
source = "Spotnana-Tech/jumpcloud"
}
}
}
@@ -10,15 +10,15 @@ variable "api_key" {
type = string
sensitive = true
}
provider "snjumpcloud" {
provider "jumpcloud" {
api_key = var.api_key
}

resource "snjumpcloud_usergroup" "example_group" {
resource "jumpcloud_usergroup" "example_group" {
name = "example-terraform-group"
description = "This group was created by Spotnana Terraform Provider!"
}

output "group_details" {
value = snjumpcloud_usergroup.example_group
value = jumpcloud_usergroup.example_group
}
6 changes: 3 additions & 3 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
terraform {
required_providers {
snjumpcloud = {
source = "github.com/Spotnana-Tech/snjumpcloud"
jumpcloud = {
source = "Spotnana-Tech/jumpcloud"
}
}
}
variable "api_key" {
type = string
sensitive = true
}
provider "snjumpcloud" {
provider "jumpcloud" {
api_key = var.api_key
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "snjumpcloud_app" "example" {
resource "jumpcloud_app" "example" {
associated_groups = [
"6515a2000000d60001bc43cb",
"640000000000000001728dec",
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "snjumpcloud_usergroup" "example" {
resource "jumpcloud_usergroup" "example" {
name = "example-name"
description = "example description"
}
Loading

0 comments on commit f599e1c

Please sign in to comment.