-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
903 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5 | | ||
| <a name="requirement_keyfactor"></a> [keyfactor](#requirement\_keyfactor) | >=2.1.5 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_keyfactor"></a> [keyfactor](#provider\_keyfactor) | 2.1.11 | | ||
|
||
## Modules | ||
|
||
No modules. | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [keyfactor_certificate_store.bosch_camera_store](https://registry.terraform.io/providers/keyfactor-pub/keyfactor/latest/docs/resources/certificate_store) | resource | | ||
| [keyfactor_agent.universal_orchestrator](https://registry.terraform.io/providers/keyfactor-pub/keyfactor/latest/docs/data-sources/agent) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_camera_map"></a> [camera\_map](#input\_camera\_map) | A map containing the serial number to IP address of the cameras to be enrolled | `map(string)` | n/a | yes | | ||
| <a name="input_inventory_schedule"></a> [inventory\_schedule](#input\_inventory\_schedule) | How often to update the inventory, valid options are number followed by 'm' for minutes, 'h' for hours, '1d' for daily, or 'immediate' for immediate inventory update. | `string` | `"12h"` | no | | ||
| <a name="input_orchestrator_name"></a> [orchestrator\_name](#input\_orchestrator\_name) | The name or GUID of the orchestrator that has been registered and approved in Keyfactor Command | `string` | n/a | yes | | ||
| <a name="input_server_password"></a> [server\_password](#input\_server\_password) | The password to authenticate to the Bosch camera | `string` | n/a | yes | | ||
| <a name="input_server_use_ssl"></a> [server\_use\_ssl](#input\_server\_use\_ssl) | Whether to use SSL when connecting to the Bosch camera | `bool` | `true` | no | | ||
| <a name="input_server_username"></a> [server\_username](#input\_server\_username) | The username to authenticate to the Bosch camera | `string` | n/a | yes | | ||
|
||
## Outputs | ||
|
||
No outputs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2024 Keyfactor | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
##@ Utility | ||
help: ## Display this help | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
deps: ## Install deps for macos | ||
@brew install pre-commit tflint terraform terraform-docs | ||
|
||
docs: ## Run terraform-docs to update module docs. | ||
@terraform-docs markdown . > MODULE.MD | ||
@terraform-docs markdown table --output-file README.md --output-mode inject . | ||
|
||
lint: ## Run tflint | ||
@tflint | ||
|
||
validate: ## Run terraform validate | ||
@terraform init --upgrade | ||
@terraform validate | ||
|
||
precommit/add: ## Install pre-commit hook | ||
@pre-commit install | ||
|
||
precommit/remove: ## Uninstall pre-commit hook | ||
@pre-commit uninstall | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Multiple BoschIPCamera Store Creation using Same Credentials Example | ||
|
||
This is an example of how to create multiple camera stores in Keyfactor Command using the Keyfactor Terraform provider. | ||
|
||
## Pre-requisites | ||
|
||
- Terraform is installed on the machine running the Terraform code | ||
- The Keyfactor Terraform provider is installed and configured to communicate to Keyfactor Command. Review | ||
the [Keyfactor provider documentation](https://registry.terraform.io/providers/keyfactor-pub/keyfactor/latest/docs) | ||
for more information. | ||
- The `BIPCamera` store type is already created in Keyfactor Command. See the [Extension specific documentation](https://github.com/Keyfactor/bosch-ipcamera-orchestrator?tab=readme-ov-file#store-type-configuration) | ||
for more information. | ||
- An orchestrator with the BoschIPCamera extension is registered and approved in Keyfactor Command. | ||
|
||
## Usage | ||
|
||
Modify the `example.tfvars` file to include the necessary information for your environment. Alternatively Terraform will | ||
prompt for each input if no value is provided. | ||
|
||
*NOTE*: This example assumes all cameras are using the same credentials, if this does not suit your use-case then modify | ||
accordingly. | ||
|
||
```bash | ||
terraform init | ||
terraform plan | ||
terraform apply | ||
``` | ||
|
||
<!-- BEGIN_TF_DOCS --> | ||
|
||
## Requirements | ||
|
||
| Name | Version | | ||
|---------------------------------------------------------------------------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5 | | ||
| <a name="requirement_keyfactor"></a> [keyfactor](#requirement\_keyfactor) | >=2.1.5 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|---------------------------------------------------------------------|---------| | ||
| <a name="provider_keyfactor"></a> [keyfactor](#provider\_keyfactor) | 2.1.11 | | ||
|
||
## Modules | ||
|
||
No modules. | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| | ||
| [keyfactor_certificate_store.bosch_camera_store](https://registry.terraform.io/providers/keyfactor-pub/keyfactor/latest/docs/resources/certificate_store) | resource | | ||
| [keyfactor_agent.universal_orchestrator](https://registry.terraform.io/providers/keyfactor-pub/keyfactor/latest/docs/data-sources/agent) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|---------|:--------:| | ||
| <a name="input_camera_map"></a> [camera\_map](#input\_camera\_map) | A map containing the serial number to IP address of the cameras to be enrolled | `map(string)` | n/a | yes | | ||
| <a name="input_inventory_schedule"></a> [inventory\_schedule](#input\_inventory\_schedule) | How often to update the inventory, valid options are number followed by 'm' for minutes, 'h' for hours, '1d' for daily, or 'immediate' for immediate inventory update. | `string` | `"12h"` | no | | ||
| <a name="input_orchestrator_name"></a> [orchestrator\_name](#input\_orchestrator\_name) | The name or GUID of the orchestrator that has been registered and approved in Keyfactor Command | `string` | n/a | yes | | ||
| <a name="input_server_password"></a> [server\_password](#input\_server\_password) | The password to authenticate to the Bosch camera | `string` | n/a | yes | | ||
| <a name="input_server_use_ssl"></a> [server\_use\_ssl](#input\_server\_use\_ssl) | Whether to use SSL when connecting to the Bosch camera | `bool` | `true` | no | | ||
| <a name="input_server_username"></a> [server\_username](#input\_server\_username) | The username to authenticate to the Bosch camera | `string` | n/a | yes | | ||
|
||
## Outputs | ||
|
||
No outputs. | ||
<!-- END_TF_DOCS --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2024 Keyfactor | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
data "keyfactor_agent" "universal_orchestrator" { | ||
agent_identifier = var.orchestrator_name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2024 Keyfactor | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# UNCOMMENT AND FILL IN THE FOLLOWING VARIABLES | ||
|
||
# orchestrator_name="my-uo-client-machine-name" | ||
# server_username="camera_username" | ||
# server_password="camera_password" | ||
# camera_map = { | ||
# "068745431065110091" = "192.168.0.1:4444", | ||
# "068745431065110092" = "192.168.0.2:4444", | ||
# "068745431065110093" = "192.168.0.3:4444", | ||
# "068745431065110094" = "192.168.0.4:4444", | ||
# "068745431065110095" = "192.168.0.5:4444", | ||
# "068745431065110096" = "192.168.0.6:4444", | ||
# "068745431065110097" = "192.168.0.7:4444", | ||
# "068745431065110098" = "192.168.0.8:4444", | ||
# "068745431065110099" = "192.168.0.8:4444", | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2024 Keyfactor | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
resource "keyfactor_certificate_store" "bosch_camera_store" { | ||
for_each = var.camera_map | ||
client_machine = each.value//this is camera IP | ||
store_path = each.key //this is camera serial number | ||
agent_identifier = data.keyfactor_agent.universal_orchestrator.agent_identifier | ||
store_type = "BIPCamera" # Must exist in KeyFactor Command | ||
server_username = var.server_username | ||
server_password = var.server_password | ||
server_use_ssl = var.server_use_ssl | ||
inventory_schedule = var.inventory_schedule | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2024 Keyfactor | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
terraform { | ||
required_version = ">= 1.5" | ||
required_providers { | ||
keyfactor = { | ||
source = "keyfactor-pub/keyfactor" | ||
version = ">=2.1.5" | ||
} | ||
} | ||
} | ||
provider "keyfactor" { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2024 Keyfactor | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
variable "orchestrator_name" { | ||
type = string | ||
description = "The name or GUID of the orchestrator that has been registered and approved in Keyfactor Command" | ||
} | ||
|
||
variable "camera_map" { | ||
type = map(string) | ||
description = "A map containing the serial number to IP address of the cameras to be enrolled" | ||
} | ||
|
||
variable "server_username" { | ||
type = string | ||
sensitive = true | ||
description = "The username to authenticate to the Bosch camera" | ||
} | ||
variable "server_password" { | ||
type = string | ||
sensitive = true | ||
description = "The password to authenticate to the Bosch camera" | ||
} | ||
variable "inventory_schedule" { | ||
type = string | ||
description = "How often to update the inventory, valid options are number followed by 'm' for minutes, 'h' for hours, '1d' for daily, or 'immediate' for immediate inventory update." | ||
default = "12h" | ||
} | ||
|
||
variable "server_use_ssl" { | ||
default = true | ||
type = bool | ||
description = "Whether to use SSL when connecting to the Bosch camera" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5 | | ||
| <a name="requirement_keyfactor"></a> [keyfactor](#requirement\_keyfactor) | >=2.1.5 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_keyfactor"></a> [keyfactor](#provider\_keyfactor) | 2.1.11 | | ||
|
||
## Modules | ||
|
||
No modules. | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [keyfactor_certificate_store.bosch_camera_store](https://registry.terraform.io/providers/keyfactor-pub/keyfactor/latest/docs/resources/certificate_store) | resource | | ||
| [keyfactor_agent.universal_orchestrator](https://registry.terraform.io/providers/keyfactor-pub/keyfactor/latest/docs/data-sources/agent) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_camera_map"></a> [camera\_map](#input\_camera\_map) | A map containing the serial number to IP address, username and password of the cameras to be enrolled | <pre>map(object({<br> ip = string<br> username = string<br> password = string<br> }))</pre> | n/a | yes | | ||
| <a name="input_inventory_schedule"></a> [inventory\_schedule](#input\_inventory\_schedule) | How often to update the inventory, valid options are number followed by 'm' for minutes, 'h' for hours, '1d' for daily, or 'immediate' for immediate inventory update. | `string` | `"12h"` | no | | ||
| <a name="input_orchestrator_name"></a> [orchestrator\_name](#input\_orchestrator\_name) | The name or GUID of the orchestrator that has been registered and approved in Keyfactor Command | `string` | n/a | yes | | ||
| <a name="input_server_password"></a> [server\_password](#input\_server\_password) | The password to authenticate to the Bosch camera | `string` | n/a | yes | | ||
| <a name="input_server_use_ssl"></a> [server\_use\_ssl](#input\_server\_use\_ssl) | Whether to use SSL when connecting to the Bosch camera | `bool` | `true` | no | | ||
| <a name="input_server_username"></a> [server\_username](#input\_server\_username) | The username to authenticate to the Bosch camera | `string` | n/a | yes | | ||
|
||
## Outputs | ||
|
||
No outputs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2024 Keyfactor | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
##@ Utility | ||
help: ## Display this help | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
deps: ## Install deps for macos | ||
@brew install pre-commit tflint terraform terraform-docs | ||
|
||
docs: ## Run terraform-docs to update module docs. | ||
@terraform-docs markdown . > MODULE.MD | ||
@terraform-docs markdown table --output-file README.md --output-mode inject . | ||
|
||
lint: ## Run tflint | ||
@tflint | ||
|
||
validate: ## Run terraform validate | ||
@terraform init --upgrade | ||
@terraform validate | ||
|
||
precommit/add: ## Install pre-commit hook | ||
@pre-commit install | ||
|
||
precommit/remove: ## Uninstall pre-commit hook | ||
@pre-commit uninstall | ||
|
Oops, something went wrong.