├── errcheckexcludes.txt ├── .github ├── images │ ├── debug_tab.png │ ├── add_configuration.png │ └── terraform_placement.png ├── CODEOWNERS ├── contributing │ ├── contribution-checklist.md │ ├── issue-reporting-and-lifecycle.md │ └── pullrequest-submission-and-lifecycle.md └── SECURITY.md ├── terraform-registry-manifest.json ├── test-data ├── kerberos_file.txt ├── invalid-cert.txt ├── valid-ds-cert.txt └── invalid-ds-cert.txt ├── examples ├── provider │ ├── variables.tf │ └── provider.tf ├── resources │ ├── redfish_bios │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── import.sh │ │ ├── provider.tf │ │ └── resource.tf │ ├── redfish_user_account_password │ │ ├── provider.tf │ │ └── resource.tf │ ├── redfish_power │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ └── provider.tf │ ├── redfish_boot_order │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── import.sh │ ├── redfish_certificate │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── resource.tf │ ├── redfish_manager_reset │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── resource.tf │ ├── redfish_simple_update │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ └── provider.tf │ ├── redfish_storage_controller │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── import.sh │ ├── redfish_storage_volume │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── import.sh │ ├── redfish_user_account │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── import.sh │ │ ├── provider.tf │ │ └── resource.tf │ ├── redfish_virtual_media │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── import.sh │ ├── redfish_dell_lc_attributes │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ ├── import.sh │ │ └── resource.tf │ ├── redfish_network_adapter │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── import.sh │ ├── redfish_boot_source_override │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ └── provider.tf │ ├── redfish_dell_idrac_attributes │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── import.sh │ ├── redfish_dell_system_attributes │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ ├── import.sh │ │ └── resource.tf │ ├── redfish_idrac_firmware_update │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ └── provider.tf │ ├── redfish_directory_service_auth_provider │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── import.sh │ │ └── provider.tf │ ├── redfish_directory_service_auth_provider_certificate │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── resource.tf │ ├── redfish_idrac_server_configuration_profile_export │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ └── provider.tf │ └── redfish_idrac_server_configuration_profile_import │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ └── provider.tf ├── data-sources │ ├── redfish_bios │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── data-source.tf │ ├── redfish_network │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ └── provider.tf │ ├── redfish_storage │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── data-source.tf │ ├── redfish_system_boot │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── data-source.tf │ ├── redfish_virtual_media │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── data-source.tf │ ├── redfish_dell_idrac_attributes │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── data-source.tf │ ├── redfish_firmware_inventory │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── data-source.tf │ ├── redfish_storage_controller │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── data-source.tf │ ├── redfish_directory_service_auth_provider │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── data-source.tf │ └── redfish_directory_service_auth_provider_certificate │ │ ├── variables.tf │ │ ├── terraform.tfvars │ │ ├── provider.tf │ │ └── data-source.tf └── README.md ├── catalog-info.yaml ├── scripts ├── errcheck.sh └── gofmtcheck.sh ├── gofish └── dell │ └── common.go ├── about └── SUPPORT.md ├── redfish ├── models │ ├── manager_reset.go │ ├── dell_idrac_attributes.go │ ├── dell_system_attributes.go │ ├── dell_lifecycle_controller_attributes.go │ ├── UserAccount.go │ ├── UserAccountPassword.go │ ├── power.go │ ├── firmware_inventory.go │ ├── simpleUpdate.go │ ├── system_boot.go │ ├── certificate.go │ └── provider.go └── provider │ ├── redfish_sweeper_test.go │ ├── data_source_redfish_dell_idrac_attributes_test.go │ ├── data_source_redfish_virtual_media_test.go │ ├── data_source_redfish_firmware_inventory_test.go │ └── constants.go ├── .gitignore ├── templates ├── data-sources │ ├── system_boot.md.tmpl │ ├── bios.md.tmpl │ ├── storage.md.tmpl │ ├── network.md.tmpl │ ├── virtual_media.md.tmpl │ ├── storage_controller.md.tmpl │ ├── dell_idrac_attributes.md.tmpl │ ├── firmware_inventory.md.tmpl │ ├── directory_service_auth_provider.md.tmpl │ └── directory_service_auth_provider_certificate.md.tmpl ├── guides │ └── using_ipv6.md └── resources │ ├── idrac_server_configuration_profile_export.md.tmpl │ ├── idrac_server_configuration_profile_import.md.tmpl │ ├── dell_idrac_attributes.md.tmpl │ └── dell_lc_attributes.md.tmpl ├── .goreleaser.yml └── docs └── guides └── using_ipv6.md /errcheckexcludes.txt: -------------------------------------------------------------------------------- 1 | (io.Closer).Close 2 | (*os.File).Close 3 | -------------------------------------------------------------------------------- /.github/images/debug_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/terraform-provider-redfish/HEAD/.github/images/debug_tab.png -------------------------------------------------------------------------------- /.github/images/add_configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/terraform-provider-redfish/HEAD/.github/images/add_configuration.png -------------------------------------------------------------------------------- /.github/images/terraform_placement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/terraform-provider-redfish/HEAD/.github/images/terraform_placement.png -------------------------------------------------------------------------------- /terraform-registry-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "metadata": { 4 | "protocol_versions": ["5.0"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test-data/kerberos_file.txt: -------------------------------------------------------------------------------- 1 | BQIAAABlAAIAD3BpZS5sYWIuZW1jLmNvbQAESFRUUAAdaURSQUMtRDlZSEs5My5waWUubGFiLmVtYy5jb20AAAABAAAAAAMAEgAgqpFvmU0WhaZIFTmHuOYqAbmlEspnZFfIWRxYMlKby3U= -------------------------------------------------------------------------------- /test-data/invalid-cert.txt: -------------------------------------------------------------------------------- 1 | INVALIDBQAwczELMAkGA1UEBhMCSU4xCzAJBgNVBAgMAktBMQswCQYDVQQHDAJNUDENMAsGA1UECgwEREVMTDEMMAoGA1UECwwDSVNHMQ4wDAYDVQQDDAVnb2t1bDEdMBsGCSqG 2 | SIb3DQEJARYOZ29rdWxAZGVsbC5jb20wHhcNMjMxMTE2MTA0ODA5WhcNMjQxMTE1MTA0ODA5WjBzMQswCQYDVQQGEwJJTjELMAkGA1UECAwCS0ExCzAJBgNVBAcMAk1Q -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # CODEOWNERS 2 | # 3 | # documentation for this file can be found at: 4 | # https://help.github.com/en/articles/about-code-owners 5 | 6 | # These are the default owners for the code and will 7 | # be requested for review when someone opens a pull request. 8 | # Order is alphabetical for easier maintenance. 9 | # 10 | # All Terraform Engineers in Dell (dell/TerraformDell) 11 | 12 | # for all files: 13 | * @MangirishK @sapana05 @Krunal-Thakkar @taohe1012 @baoy1 @vangork @RayLiu7 @P-Cao @Sakshi-dell @shenda1 @Krishnan-Priyanshu @dell/ 14 | IaCDevelopers -------------------------------------------------------------------------------- /.github/contributing/contribution-checklist.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Contribution Checklist 19 | -------------------------------------------------------------------------------- /.github/contributing/issue-reporting-and-lifecycle.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Issue Reporting and Lifecycle 19 | -------------------------------------------------------------------------------- /examples/provider/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | 19 | variable "rack1" { 20 | type = map(object({ 21 | user = string 22 | password = string 23 | endpoint = string 24 | ssl_insecure = bool 25 | })) 26 | } 27 | -------------------------------------------------------------------------------- /examples/resources/redfish_bios/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_user_account_password/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /.github/contributing/pullrequest-submission-and-lifecycle.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Pull Request Submission and Lifecycle 19 | 20 | All contributions must include acceptance of the [Developer Certification of Origin (DCO)](CONTRIBUTOR_AGREEMENT.md). 21 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_bios/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_power/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_network/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_storage/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_system_boot/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_boot_order/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_certificate/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_manager_reset/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_simple_update/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_storage_controller/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_storage_volume/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_user_account/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_virtual_media/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_virtual_media/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_lc_attributes/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_network_adapter/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_dell_idrac_attributes/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_firmware_inventory/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_storage_controller/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_boot_source_override/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_idrac_attributes/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_system_attributes/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_idrac_firmware_update/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_directory_service_auth_provider/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_directory_service_auth_provider/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_directory_service_auth_provider_certificate/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_directory_service_auth_provider_certificate/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | -------------------------------------------------------------------------------- /catalog-info.yaml: -------------------------------------------------------------------------------- 1 | # nonk8s 2 | apiVersion: backstage.io/v1alpha1 3 | kind: Component 4 | metadata: 5 | name: dell-terraform-provider-redfish 6 | description: "Terraform provider for Redfish REST APIs" 7 | tags: 8 | - devops 9 | - automation 10 | - terraform 11 | - dell 12 | - infrastructure-as-code 13 | - terraform-provider 14 | - redfish 15 | annotations: 16 | backstage.io/techdocs-ref: dir:. 17 | github.com/project-slug: dell/terraform-provider-redfish 18 | links: 19 | - url: 'https://dell.github.io/terraform-docs/docs/storage/platforms/redfish/' 20 | title: 'Dell Terraform Providers Documentation' 21 | icon: 'web' 22 | - url: 'https://github.com/dell/terraform-provider-redfish/issues' 23 | title: 'Contact Technical Support' 24 | icon: 'help' 25 | spec: 26 | type: service 27 | lifecycle: production 28 | owner: user:default/varun.chinta 29 | visibility: all 30 | -------------------------------------------------------------------------------- /examples/resources/redfish_user_account_password/resource.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | resource "redfish_user_account_password" "root" { 19 | username = "root" 20 | endpoint = "https://my-server-1.myawesomecompany.org" 21 | ssl_insecure = false 22 | old_password = "Test@1234" 23 | new_password = "Root@1234" 24 | } -------------------------------------------------------------------------------- /scripts/errcheck.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | #!/usr/bin/env bash 19 | 20 | # Check gofmt 21 | echo "==> Checking for unchecked errors..." 22 | 23 | if ! which errcheck > /dev/null; then 24 | echo "==> Installing errcheck..." 25 | go install github.com/kisielk/errcheck@latest 26 | fi 27 | 28 | errcheck -ignoretests -exclude errcheckexcludes.txt $(go list ./...| grep -v /vendor/) 29 | -------------------------------------------------------------------------------- /gofish/dell/common.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package dell 19 | 20 | // Entity provides the common basis for dell and gofish objects 21 | type Entity struct { 22 | ODataContext string `json:"@odata.context"` 23 | ODataID string `json:"@odata.id"` 24 | ODataType string `json:"@odata.type"` 25 | ID string `json:"Id"` 26 | Name string 27 | Description string 28 | } 29 | -------------------------------------------------------------------------------- /about/SUPPORT.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Support 19 | 20 | For any Terraform Provider for RedFish issues, questions or feedback, please follow our [support process](https://github.com/dell/dell-terraform-providers/blob/main/docs/SUPPORT.md) 21 | 22 | You can also interact with us on [GitHub](https://github.com/dell/dell-terraform-providers) by creating a [GitHub Issue](https://github.com/dell/dell-terraform-providers/issues). 23 | -------------------------------------------------------------------------------- /redfish/models/manager_reset.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // RedfishManagerReset to construct terraform schema for manager reset resource. 25 | type RedfishManagerReset struct { 26 | Id types.String `tfsdk:"id"` 27 | ResetType types.String `tfsdk:"reset_type"` 28 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 29 | } 30 | -------------------------------------------------------------------------------- /redfish/models/dell_idrac_attributes.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // DellIdracAttributes to construct terraform schema for the idrac attributes resource. 25 | type DellIdracAttributes struct { 26 | ID types.String `tfsdk:"id"` 27 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 28 | Attributes types.Map `tfsdk:"attributes"` 29 | } 30 | -------------------------------------------------------------------------------- /scripts/gofmtcheck.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | #!/usr/bin/env bash 19 | 20 | # Check gofmt 21 | echo "==> Checking that code complies with gofmt requirements..." 22 | gofmt_files=$(gofmt -s -l `find . -name '*.go' | grep -v vendor`) 23 | if [[ -n ${gofmt_files} ]]; then 24 | echo 'gofmt needs running on the following files:' 25 | echo "${gofmt_files}" 26 | echo "You can use the command: \`make fmt\` to reformat code." 27 | exit 1 28 | fi 29 | 30 | exit 0 31 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_bios/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_bios/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_boot_order/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } -------------------------------------------------------------------------------- /examples/resources/redfish_power/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /redfish/models/dell_system_attributes.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // DellSystemAttributes to construct terraform schema for the system attributes resource. 25 | type DellSystemAttributes struct { 26 | ID types.String `tfsdk:"id"` 27 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 28 | Attributes types.Map `tfsdk:"attributes"` 29 | } 30 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_network/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_storage/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_certificate/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_manager_reset/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-2" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_simple_update/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_user_account/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_virtual_media/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_system_boot/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_virtual_media/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_lc_attributes/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_idrac_server_configuration_profile_export/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | 27 | variable "cifs_username" { 28 | type = string 29 | default = "awesomeadmin" 30 | } 31 | 32 | variable "cifs_password" { 33 | type = string 34 | default = "C00lP@ssw0rd" 35 | 36 | } -------------------------------------------------------------------------------- /examples/resources/redfish_idrac_server_configuration_profile_import/variables.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | variable "rack1" { 19 | type = map(object({ 20 | user = string 21 | password = string 22 | endpoint = string 23 | ssl_insecure = bool 24 | })) 25 | } 26 | 27 | variable "cifs_username" { 28 | type = string 29 | default = "awesomeadmin" 30 | } 31 | 32 | variable "cifs_password" { 33 | type = string 34 | default = "C00lP@ssw0rd" 35 | 36 | } -------------------------------------------------------------------------------- /examples/resources/redfish_network_adapter/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_storage_controller/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_storage_volume/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_firmware_inventory/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_storage_controller/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_bios/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform import redfish_bios.bios "{\"username\":\"\",\"password\":\"\",\"endpoint\":\"\",\"ssl_insecure\":}" 19 | 20 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 21 | # redfish_alias is used to align with enhancements to password management. 22 | terraform import redfish_bios.bios "{\"redfish_alias\":\"\"}" 23 | -------------------------------------------------------------------------------- /examples/resources/redfish_boot_source_override/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_system_attributes/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_idrac_firmware_update/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_dell_idrac_attributes/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_idrac_attributes/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /redfish/models/dell_lifecycle_controller_attributes.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // DellLCAttributes to construct terraform schema for the lifecycle controller attributes resource. 25 | type DellLCAttributes struct { 26 | ID types.String `tfsdk:"id"` 27 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 28 | Attributes types.Map `tfsdk:"attributes"` 29 | } 30 | -------------------------------------------------------------------------------- /examples/resources/redfish_directory_service_auth_provider/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_directory_service_auth_provider/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_directory_service_auth_provider_certificate/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } -------------------------------------------------------------------------------- /examples/resources/redfish_idrac_server_configuration_profile_export/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_idrac_server_configuration_profile_import/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_directory_service_auth_provider_certificate/terraform.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | rack1 = { 19 | "my-server-1" = { 20 | user = "admin" 21 | password = "passw0rd" 22 | endpoint = "https://my-server-1.myawesomecompany.org" 23 | ssl_insecure = true 24 | }, 25 | "my-server-2" = { 26 | user = "admin" 27 | password = "passw0rd" 28 | endpoint = "https://my-server-2.myawesomecompany.org" 29 | ssl_insecure = true 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/redfish_user_account/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform import redfish_user_account.rr "{\"id\":\"\",\"username\":\"\",\"password\":\"\",\"endpoint\":\"\",\"ssl_insecure\":}" 19 | 20 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 21 | # redfish_alias is used to align with enhancements to password management. 22 | terraform import redfish_user_account.rr "{\"id\":\"\",\"redfish_alias\":\"\"}" -------------------------------------------------------------------------------- /examples/provider/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # # `redfish_servers` is used to align with enhancements to password management. 29 | # # Map of server BMCs with their alias keys and respective user credentials. 30 | # # This is required when resource/datasource's `redfish_alias` is not null 31 | # redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_directory_service_auth_provider/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform import redfish_directory_service_auth_provider.ds_auth '{"username":"","password":"","endpoint":"","ssl_insecure":}' 19 | 20 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 21 | # redfish_alias is used to align with enhancements to password management. 22 | terraform import redfish_directory_service_auth_provider.ds_auth '{"redfish_alias":""}' -------------------------------------------------------------------------------- /examples/data-sources/redfish_bios/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_bios/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_power/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/data-sources/redfish_network/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/data-sources/redfish_storage/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_boot_order/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_certificate/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_manager_reset/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_simple_update/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_user_account/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_virtual_media/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/data-sources/redfish_system_boot/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/data-sources/redfish_virtual_media/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_network_adapter/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_storage_controller/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/data-sources/redfish_firmware_inventory/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/data-sources/redfish_storage_controller/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_boot_source_override/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_dell_idrac_attributes/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_idrac_firmware_update/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_storage_volume/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } 33 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_dell_idrac_attributes/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.5.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_dell_lc_attributes/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } 33 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_system_attributes/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } 33 | -------------------------------------------------------------------------------- /examples/resources/redfish_directory_service_auth_provider/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/data-sources/redfish_directory_service_auth_provider/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_directory_service_auth_provider_certificate/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_idrac_server_configuration_profile_export/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_idrac_server_configuration_profile_import/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /examples/resources/redfish_storage_volume/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform import redfish_storage_volume.volume "{\"id\":\"\",\"username\":\"\",\"password\":\"\",\"endpoint\":\"\",\"ssl_insecure\":}" 19 | 20 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 21 | # redfish_alias is used to align with enhancements to password management. 22 | terraform import redfish_storage_volume.volume "{\"id\":\"\",\"redfish_alias\":\"\"}" -------------------------------------------------------------------------------- /examples/data-sources/redfish_directory_service_auth_provider_certificate/provider.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | terraform { 19 | required_providers { 20 | redfish = { 21 | version = "1.6.0" 22 | source = "registry.terraform.io/dell/redfish" 23 | } 24 | } 25 | } 26 | 27 | provider "redfish" { 28 | # `redfish_servers` is used to align with enhancements to password management. 29 | # Map of server BMCs with their alias keys and respective user credentials. 30 | # This is required when resource/datasource's `redfish_alias` is not null 31 | redfish_servers = var.rack1 32 | } -------------------------------------------------------------------------------- /redfish/models/UserAccount.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // UserAccount struct 25 | type UserAccount struct { 26 | ID types.String `tfsdk:"id"` 27 | Enabled types.Bool `tfsdk:"enabled"` 28 | Password types.String `tfsdk:"password"` 29 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 30 | RoleID types.String `tfsdk:"role_id"` 31 | UserID types.String `tfsdk:"user_id"` 32 | Username types.String `tfsdk:"username"` 33 | } 34 | -------------------------------------------------------------------------------- /redfish/models/UserAccountPassword.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // UserAccountPassword struct to update password for user account with administrator privilige 25 | type UserAccountPassword struct { 26 | ID types.String `tfsdk:"id"` 27 | Endpoint types.String `tfsdk:"endpoint"` 28 | SslInsecure types.Bool `tfsdk:"ssl_insecure"` 29 | Username types.String `tfsdk:"username"` 30 | OldPassword types.String `tfsdk:"old_password"` 31 | NewPassword types.String `tfsdk:"new_password"` 32 | } 33 | -------------------------------------------------------------------------------- /redfish/models/power.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // Power to construct terraform schema for power resource. 25 | type Power struct { 26 | PowerId types.String `tfsdk:"id"` 27 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 28 | DesiredPowerAction types.String `tfsdk:"desired_power_action"` 29 | MaximumWaitTime types.Int64 `tfsdk:"maximum_wait_time"` 30 | CheckInterval types.Int64 `tfsdk:"check_interval"` 31 | PowerState types.String `tfsdk:"power_state"` 32 | SystemID types.String `tfsdk:"system_id"` 33 | } 34 | -------------------------------------------------------------------------------- /examples/resources/redfish_boot_order/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | # The synatx is: 19 | # terraform import redfish_boot_order.boot "{\"username\":\"\",\"password\":\"\",\"endpoint\":\"\",\"ssl_insecure\":}" 20 | 21 | terraform import redfish_boot_order.boot '{"username":"admin","password":"passw0rd","endpoint":"https://my-server-1.myawesomecompany.org","ssl_insecure":true}' 22 | 23 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 24 | # redfish_alias is used to align with enhancements to password management. 25 | terraform import redfish_boot_order.boot '{"redfish_alias":""}' 26 | -------------------------------------------------------------------------------- /examples/resources/redfish_manager_reset/resource.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | resource "redfish_manager_reset" "manager_reset" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | 33 | id = "iDRAC.Embedded.1" 34 | reset_type = "GracefulRestart" 35 | } -------------------------------------------------------------------------------- /redfish/models/firmware_inventory.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // FirmwareInventory struct is created using this 25 | type FirmwareInventory struct { 26 | ID types.String `tfsdk:"id"` 27 | OdataID types.String `tfsdk:"odata_id"` 28 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 29 | Inventory []Inventory `tfsdk:"inventory"` 30 | } 31 | 32 | // Inventory struct is created which is used in firmware inventory 33 | type Inventory struct { 34 | EntityName types.String `tfsdk:"entity_name"` 35 | EntityId types.String `tfsdk:"entity_id"` 36 | Version types.String `tfsdk:"version"` 37 | } 38 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Security policy 19 | 20 | The Terraform Provider for Redfish repository is inspected for security vulnerabilities via blackduck scans and static code analysis. 21 | 22 | In addition to this, there are various security checks that get executed against a branch when a pull request is created/updated. Please refer to [pull request](../about/CONTRIBUTING.md#Pull-requests) for more information. 23 | 24 | ## Reporting a vulnerability 25 | 26 | Have you discovered a security vulnerability in this project? 27 | We ask you to alert the maintainers by sending an email, describing the issue, impact, and fix - if applicable. 28 | 29 | You can reach the Terraform providers for Redfish maintainers at tpfdi.team@dell.com. 30 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_virtual_media/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "redfish_virtual_media" "vm" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | } 33 | 34 | output "virtual_media" { 35 | value = data.redfish_virtual_media.vm 36 | sensitive = true 37 | } 38 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_lc_attributes/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | # import all LC attributes 19 | terraform import redfish_dell_lc_attributes.lc '{"username":"","password":"","endpoint":"","ssl_insecure":}' 20 | 21 | # import list of LC attributes 22 | terraform import redfish_dell_lc_attributes.lc '{"username":"","password":"","endpoint":"","ssl_insecure":, "attributes":["LCAttributes.1.IgnoreCertWarning"]}' 23 | 24 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 25 | # redfish_alias is used to align with enhancements to password management. 26 | terraform import redfish_dell_lc_attributes.lc '{"redfish_alias":""}' -------------------------------------------------------------------------------- /examples/resources/redfish_dell_idrac_attributes/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | # import all idrac attributes 19 | terraform import redfish_dell_idrac_attributes.idrac '{"username":"","password":"","endpoint":"","ssl_insecure":}' 20 | 21 | # import list of idrac attributes 22 | terraform import redfish_dell_idrac_attributes.idrac '{"username":"","password":"","endpoint":"","ssl_insecure":, "attributes":["Users.2.UserName"]}' 23 | 24 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 25 | # redfish_alias is used to align with enhancements to password management. 26 | terraform import redfish_dell_idrac_attributes.idrac '{"redfish_alias":""}' 27 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_dell_idrac_attributes/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "redfish_dell_idrac_attributes" "idrac" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | } 33 | 34 | output "idrac_attributes" { 35 | value = data.redfish_dell_idrac_attributes.idrac 36 | sensitive = true 37 | } 38 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_firmware_inventory/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "redfish_firmware_inventory" "inventory" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | } 33 | 34 | output "firmware_inventory" { 35 | value = data.redfish_firmware_inventory.inventory 36 | sensitive = true 37 | } 38 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_system_attributes/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | # import all System attributes 19 | terraform import redfish_dell_system_attributes.system '{"username":"","password":"","endpoint":"","ssl_insecure":}' 20 | 21 | # import list of System attributes 22 | terraform import redfish_dell_system_attributes.system '{"username":"","password":"","endpoint":"","ssl_insecure":, "attributes":["ServerPwr.1.PSPFCEnabled"]}' 23 | 24 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 25 | # redfish_alias is used to align with enhancements to password management. 26 | terraform import redfish_dell_system_attributes.system '{"redfish_alias":""}' -------------------------------------------------------------------------------- /redfish/provider/redfish_sweeper_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package provider 19 | 20 | import ( 21 | "fmt" 22 | "testing" 23 | 24 | "github.com/hashicorp/terraform-plugin-testing/helper/resource" 25 | "github.com/stmcginnis/gofish" 26 | ) 27 | 28 | func TestMain(m *testing.M) { 29 | resource.TestMain(m) 30 | } 31 | 32 | func getSweeperClient(region string) (*gofish.Service, error) { 33 | endpoint := creds.Endpoint 34 | clientConfig := gofish.ClientConfig{ 35 | Endpoint: endpoint, 36 | Username: creds.Username, 37 | Password: creds.Password, 38 | BasicAuth: true, 39 | Insecure: true, 40 | } 41 | api, err := gofish.Connect(clientConfig) 42 | if err != nil { 43 | return nil, fmt.Errorf("Unable to create sweeper client %v", err) 44 | } 45 | 46 | return api.Service, nil 47 | } 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | terraform-provider-redfish 3 | bin/ 4 | dist/ 5 | 6 | *.backup 7 | example.tf 8 | terraform.tfplan 9 | 10 | # Local .terraform directories 11 | **/.terraform/* 12 | 13 | # .tfstate files 14 | *.tfstate 15 | *.tfstate.* 16 | 17 | # Crash log files 18 | crash.log 19 | 20 | # Ignore any .tfvars files that are generated automatically for each Terraform run. Most 21 | # .tfvars files are managed as part of configuration and so should be included in 22 | # version control. 23 | # 24 | # example.tfvars 25 | 26 | # Ignore override files as they are usually used to override resources locally and so 27 | # are not checked in 28 | override.tf 29 | override.tf.json 30 | *_override.tf 31 | *_override.tf.json 32 | 33 | # Include override files you do wish to add to version control using negated pattern 34 | # 35 | # !example_override.tf 36 | 37 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan 38 | *tfplan* 39 | 40 | # Ignore CLI configuration files 41 | .terraformrc 42 | terraform.rc 43 | *.terraform.lock.hcl 44 | 45 | .idea/ 46 | *.exe 47 | *.EXE 48 | *.zip 49 | .vscode/ 50 | *.log 51 | *.bak 52 | *~ 53 | .*.swp 54 | .*.swm 55 | .*.swn 56 | .*.swo 57 | 58 | # Go workspace 59 | go.work 60 | 61 | # website 62 | website/.vagrant 63 | website/.bundle 64 | website/build 65 | website/node_modules 66 | website/vendor 67 | 68 | redfish/provider/redfish_test.env 69 | test 70 | 71 | **/*debug* 72 | **/coverage* -------------------------------------------------------------------------------- /examples/data-sources/redfish_directory_service_auth_provider/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "redfish_directory_service_auth_provider" "ds_auth" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | } 33 | 34 | output "directory_service_auth_provider" { 35 | value = data.redfish_directory_service_auth_provider.ds_auth 36 | sensitive = true 37 | } 38 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_bios/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "redfish_bios" "bios" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | 33 | // by default, the data source uses the first system 34 | # system_id = "System.Embedded.1" 35 | } 36 | 37 | output "bios_attributes" { 38 | value = data.redfish_bios.bios 39 | sensitive = true 40 | } 41 | -------------------------------------------------------------------------------- /examples/resources/redfish_user_account/resource.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | resource "redfish_user_account" "rr" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | user = each.value.user 27 | password = each.value.password 28 | endpoint = each.value.endpoint 29 | ssl_insecure = true 30 | } 31 | 32 | // user details for creating/modifying a user 33 | user_id = "4" 34 | username = "test" 35 | password = "Test@123" 36 | role_id = "Operator" 37 | // to set user as active or inactive 38 | enabled = true 39 | } 40 | -------------------------------------------------------------------------------- /test-data/valid-ds-cert.txt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIID2DCCAsCgAwIBAgIQfILfOcYpmrlCSVHA6daU7TANBgkqhkiG9w0BAQUFADBq 3 | MRMwEQYKCZImiZPyLGQBGRYDY29tMRMwEQYKCZImiZPyLGQBGRYDZW1jMRMwEQYK 4 | CZImiZPyLGQBGRYDbGFiMRMwEQYKCZImiZPyLGQBGRYDcGllMRQwEgYDVQQDEwtW 5 | UEk0NDE2OS1DQTAgFw0xOTAxMjAxNDQyNTBaGA8yMTE4MDEyMDE0NTI0OVowajET 6 | MBEGCgmSJomT8ixkARkWA2NvbTETMBEGCgmSJomT8ixkARkWA2VtYzETMBEGCgmS 7 | JomT8ixkARkWA2xhYjETMBEGCgmSJomT8ixkARkWA3BpZTEUMBIGA1UEAxMLVlBJ 8 | NDQxNjktQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCcQd4c7ukW 9 | jeazFuU8UpfarXDPf1suc4QRGzE7etzeHkV8qAK2P1Tb+/Y0e44FWygefYl5FXvq 10 | rma3x+kAW0acPgr3Io5O6ObpYQtA/mpw5NtvBq9tfIJdZ7+65xUg8F/TxqGhBDwN 11 | EzNdZ9tA1x8MR5S6xdeEBDe6ChQvw4vWaWhtuVXNpM2PX99xyE7E7ZZd0Ugi4nBH 12 | NwDk6ALSNOlxe/mrz+JtTjmt2bjz164AStClkSIcEaMBlEjnr3394PptFtblt5C+ 13 | tjN1PTd9AqhGwIGWsmvtMHjwyDnME9sCbV7LsVzSdwmEbL7/ZYLf6w7S2JyKfnTw 14 | UXSnWHTjzKUFAgMBAAGjeDB2MAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/ 15 | MB0GA1UdDgQWBBRZFD2EuQFi4aa399Fjb1Vq1YFl2zASBgkrBgEEAYI3FQEEBQID 16 | AQABMCMGCSsGAQQBgjcVAgQWBBSqajklbDzxGP38yx+Ur0q+ThJFljANBgkqhkiG 17 | 9w0BAQUFAAOCAQEAAEECImcO/ggR12CAM49SGtfN9UvoD0wiEvHqEfFmFTlWqWIP 18 | IHPYnCa7kV7tQjq0Lqxee52Mb+B8gH0RgnPcF2tskueHDUwEJKDSf/SEC5zpI/Gy 19 | yBVF8Lxa9I5EEy7MxMG0evDuhDgN/KJJG1THiwMgYgoL5ZameNA74pxuo4aUJV8M 20 | M+LN5h6W0+/Zw3DZemVMu+Fk5ERxF1wi7Qo1PHhVpvOvrZFRKl9GDEGbZ5sQ/paE 21 | Osjm7pTmDv+oeIVXpGkfkTsBx5S27kV9ASnlRxoUdRN0tpjyiKkCKqADA3fGo6Ii 22 | ap8my2sYq4HFHKQYAVIbpR5ZinnX/FpHyomOgw== 23 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /redfish/models/simpleUpdate.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // SimpleUpdateRes is struct for simple update resource 25 | type SimpleUpdateRes struct { 26 | Id types.String `tfsdk:"id"` 27 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 28 | Protocol types.String `tfsdk:"transfer_protocol"` 29 | Image types.String `tfsdk:"target_firmware_image"` 30 | ResetType types.String `tfsdk:"reset_type"` 31 | ResetTimeout types.Int64 `tfsdk:"reset_timeout"` 32 | JobTimeout types.Int64 `tfsdk:"simple_update_job_timeout"` 33 | SoftwareId types.String `tfsdk:"software_id"` 34 | Version types.String `tfsdk:"version"` 35 | SystemID types.String `tfsdk:"system_id"` 36 | } 37 | -------------------------------------------------------------------------------- /test-data/invalid-ds-cert.txt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | INVALIDMIID2DCCAsCgAwIBAgIQfILfOcYpmrlCSVHA6daU7TANBgkqhkiG9w0BAQUFADBq 3 | MRMwEQYKCZImiZPyLGQBGRYDY29tMRMwEQYKCZImiZPyLGQBGRYDZW1jMRMwEQYK 4 | CZImiZPyLGQBGRYDbGFiMRMwEQYKCZImiZPyLGQBGRYDcGllMRQwEgYDVQQDEwtW 5 | UEk0NDE2OS1DQTAgFw0xOTAxMjAxNDQyNTBaGA8yMTE4MDEyMDE0NTI0OVowajET 6 | MBEGCgmSJomT8ixkARkWA2NvbTETMBEGCgmSJomT8ixkARkWA2VtYzETMBEGCgmS 7 | JomT8ixkARkWA2xhYjETMBEGCgmSJomT8ixkARkWA3BpZTEUMBIGA1UEAxMLVlBJ 8 | NDQxNjktQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCcQd4c7ukW 9 | jeazFuU8UpfarXDPf1suc4QRGzE7etzeHkV8qAK2P1Tb+/Y0e44FWygefYl5FXvq 10 | rma3x+kAW0acPgr3Io5O6ObpYQtA/mpw5NtvBq9tfIJdZ7+65xUg8F/TxqGhBDwN 11 | EzNdZ9tA1x8MR5S6xdeEBDe6ChQvw4vWaWhtuVXNpM2PX99xyE7E7ZZd0Ugi4nBH 12 | NwDk6ALSNOlxe/mrz+JtTjmt2bjz164AStClkSIcEaMBlEjnr3394PptFtblt5C+ 13 | tjN1PTd9AqhGwIGWsmvtMHjwyDnME9sCbV7LsVzSdwmEbL7/ZYLf6w7S2JyKfnTw 14 | UXSnWHTjzKUFAgMBAAGjeDB2MAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/ 15 | MB0GA1UdDgQWBBRZFD2EuQFi4aa399Fjb1Vq1YFl2zASBgkrBgEEAYI3FQEEBQID 16 | AQABMCMGCSsGAQQBgjcVAgQWBBSqajklbDzxGP38yx+Ur0q+ThJFljANBgkqhkiG 17 | 9w0BAQUFAAOCAQEAAEECImcO/ggR12CAM49SGtfN9UvoD0wiEvHqEfFmFTlWqWIP 18 | IHPYnCa7kV7tQjq0Lqxee52Mb+B8gH0RgnPcF2tskueHDUwEJKDSf/SEC5zpI/Gy 19 | yBVF8Lxa9I5EEy7MxMG0evDuhDgN/KJJG1THiwMgYgoL5ZameNA74pxuo4aUJV8M 20 | M+LN5h6W0+/Zw3DZemVMu+Fk5ERxF1wi7Qo1PHhVpvOvrZFRKl9GDEGbZ5sQ/paE 21 | Osjm7pTmDv+oeIVXpGkfkTsBx5S27kV9ASnlRxoUdRN0tpjyiKkCKqADA3fGo6Ii 22 | ap8my2sYq4HFHKQYAVIbpR5ZinnX/FpHyomOgw== 23 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /examples/data-sources/redfish_storage/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "redfish_storage" "storage" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | 33 | // by default, the data source uses the first system 34 | # system_id = "System.Embedded.1" 35 | } 36 | 37 | output "storage_volume" { 38 | value = data.redfish_storage.storage 39 | sensitive = true 40 | } 41 | 42 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_lc_attributes/resource.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | resource "redfish_dell_lc_attributes" "lc" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | 33 | // LC attributes to be modified 34 | attributes = { 35 | "LCAttributes.1.IgnoreCertWarning" = "On" 36 | "LCAttributes.1.CollectSystemInventoryOnRestart" = "Disabled" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /templates/data-sources/system_boot.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | {{- end }} 45 | 46 | {{ .SchemaMarkdown | trimspace }} 47 | -------------------------------------------------------------------------------- /examples/resources/redfish_virtual_media/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | # The synatx is: 19 | # terraform import redfish_virtual_media.media "{\"id\":\"\",\"username\":\"\",\"password\":\"\",\"endpoint\":\"\",\"ssl_insecure\":}" 20 | 21 | terraform import redfish_virtual_media.media '{"id":"/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD","username":"admin","password":"passw0rd","endpoint":"https://my-server-1.myawesomecompany.org","ssl_insecure":true}' 22 | 23 | 24 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 25 | # redfish_alias is used to align with enhancements to password management. 26 | terraform import redfish_virtual_media.media '{"id":"/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD","redfish_alias":""}' -------------------------------------------------------------------------------- /redfish/models/system_boot.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // SystemBootDataSource struct for datasource 25 | type SystemBootDataSource struct { 26 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 27 | ID types.String `tfsdk:"id"` 28 | SystemID types.String `tfsdk:"system_id"` 29 | BootOrder types.List `tfsdk:"boot_order"` 30 | BootSourceOverrideEnabled types.String `tfsdk:"boot_source_override_enabled"` 31 | BootSourceOverrideMode types.String `tfsdk:"boot_source_override_mode"` 32 | BootSourceOverrideTarget types.String `tfsdk:"boot_source_override_target"` 33 | UefiTargetBootSourceOverride types.String `tfsdk:"uefi_target_boot_source_override"` 34 | } 35 | -------------------------------------------------------------------------------- /redfish/models/certificate.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // SSLCertificate struct for payload construct for create certificate api 25 | type SSLCertificate struct { 26 | CertificateType string `json:"CertificateType"` 27 | Passphrase string `json:"Passphrase"` 28 | SSLCertificateFile string `json:"SSLCertificateFile"` 29 | } 30 | 31 | // RedfishSSLCertificate for terraform schema of certificate resource 32 | type RedfishSSLCertificate struct { 33 | ID types.String `tfsdk:"id"` 34 | RedfishServer []RedfishServer `tfsdk:"redfish_server"` 35 | CertificateType types.String `tfsdk:"certificate_type"` 36 | Passphrase types.String `tfsdk:"passphrase"` 37 | SSLCertificateFile types.String `tfsdk:"ssl_certificate_content"` 38 | } 39 | -------------------------------------------------------------------------------- /.goreleaser.yml: -------------------------------------------------------------------------------- 1 | # Visit https://goreleaser.com for documentation on how to customize this 2 | # behavior. 3 | before: 4 | hooks: 5 | # this is just an example and not a requirement for provider building/publishing 6 | - go mod tidy 7 | builds: 8 | - env: 9 | # goreleaser does not work with CGO, it could also complicate 10 | # usage by users in CI/CD systems like Terraform Cloud where 11 | # they are unable to install libraries. 12 | - CGO_ENABLED=0 13 | mod_timestamp: '{{ .CommitTimestamp }}' 14 | flags: 15 | - -trimpath 16 | ldflags: 17 | - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' 18 | goos: 19 | - freebsd 20 | - windows 21 | - linux 22 | - darwin 23 | goarch: 24 | - amd64 25 | - '386' 26 | - arm 27 | - arm64 28 | ignore: 29 | - goos: darwin 30 | goarch: '386' 31 | binary: '{{ .ProjectName }}_v{{ .Version }}' 32 | archives: 33 | - format: zip 34 | name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' 35 | checksum: 36 | extra_files: 37 | - glob: 'terraform-registry-manifest.json' 38 | name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' 39 | name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' 40 | algorithm: sha256 41 | release: 42 | extra_files: 43 | - glob: 'terraform-registry-manifest.json' 44 | name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' 45 | # If you want to manually examine the release before its live, uncomment this line: 46 | # draft: true 47 | changelog: 48 | skip: true -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Full documentation 19 | 20 | This directory contains only examples and may not showcase all available features. 21 | For full documentation, please refer the follwoing links: 22 | * [provider](../docs/index.md) 23 | * [resources](../docs/resources/) 24 | * [data-sources](../docs/data-sources/) 25 | 26 | # Examples 27 | 28 | This directory contains examples that are mostly used for documentation, but can also be run/tested manually via the Terraform CLI. 29 | 30 | For developers who wish to extend this provider: 31 | The tool [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) is used as our documentation generator and it reads examples from this folder. 32 | Please refer [conventional paths](https://github.com/hashicorp/terraform-plugin-docs?tab=readme-ov-file#conventional-paths) to understand which files in this folder are read into the documentation and which are ignored. 33 | -------------------------------------------------------------------------------- /examples/resources/redfish_dell_system_attributes/resource.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | resource "redfish_dell_system_attributes" "system" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | 33 | // System attributes to be modified 34 | attributes = { 35 | # If `PlatformCapability.1.PSPFCCapable` is Enabled then only will be able to modify `ServerPwr.1.PSPFCEnabled` 36 | "ServerPwr.1.PSPFCEnabled" = "Disabled" 37 | "SupportInfo.1.Outsourced" = "Yes" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /templates/data-sources/bios.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above data block, we can see the output in the state file. 45 | 46 | {{- end }} 47 | 48 | {{ .SchemaMarkdown | trimspace }} 49 | 50 | -------------------------------------------------------------------------------- /templates/data-sources/storage.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above data block, we can see the output in the state file. 45 | 46 | {{- end }} 47 | 48 | {{ .SchemaMarkdown | trimspace }} 49 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_system_boot/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "redfish_system_boot" "system_boot" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | 33 | // system_id is an optional argument. By default, the data source uses 34 | // the first ComputerSystem resource present in the ComputerSystem collection 35 | system_id = "System.Embedded.1" 36 | } 37 | 38 | output "system_boot" { 39 | value = data.redfish_system_boot.system_boot 40 | sensitive = true 41 | } 42 | -------------------------------------------------------------------------------- /templates/data-sources/network.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above data block, we can see the output in the state file. 45 | 46 | {{- end }} 47 | 48 | {{ .SchemaMarkdown | trimspace }} 49 | 50 | -------------------------------------------------------------------------------- /templates/data-sources/virtual_media.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above data block, we can see the output in the state file. 45 | 46 | {{- end }} 47 | 48 | {{ .SchemaMarkdown | trimspace }} 49 | -------------------------------------------------------------------------------- /templates/data-sources/storage_controller.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above data block, we can see the output in the state file. 45 | 46 | {{- end }} 47 | 48 | {{ .SchemaMarkdown | trimspace }} 49 | 50 | -------------------------------------------------------------------------------- /templates/data-sources/dell_idrac_attributes.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above data block, we can see the output in the state file. 45 | 46 | {{- end }} 47 | 48 | {{ .SchemaMarkdown | trimspace }} 49 | -------------------------------------------------------------------------------- /templates/data-sources/firmware_inventory.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above data block, we can see the output in the state file. 45 | 46 | {{- end }} 47 | 48 | {{ .SchemaMarkdown | trimspace }} 49 | 50 | -------------------------------------------------------------------------------- /templates/data-sources/directory_service_auth_provider.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above data block, we can see the output in the state file. 45 | 46 | {{- end }} 47 | 48 | {{ .SchemaMarkdown | trimspace }} 49 | 50 | -------------------------------------------------------------------------------- /templates/data-sources/directory_service_auth_provider_certificate.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/data-sources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/data-sources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/data-sources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above data block, we can see the output in the state file. 45 | 46 | {{- end }} 47 | 48 | {{ .SchemaMarkdown | trimspace }} 49 | 50 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_directory_service_auth_provider_certificate/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "redfish_directory_service_auth_provider_certificate" "ds_auth_certificate" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | 33 | certificate_filter { 34 | certificate_provider_type = "LDAP" 35 | # certificate_id = "SecurityCertificate.5" 36 | } 37 | } 38 | 39 | output "directory_service_auth_provider_certificate" { 40 | value = data.redfish_directory_service_auth_provider_certificate.ds_auth_certificate 41 | sensitive = true 42 | } 43 | -------------------------------------------------------------------------------- /redfish/provider/data_source_redfish_dell_idrac_attributes_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package provider 19 | 20 | import ( 21 | "fmt" 22 | "testing" 23 | 24 | "github.com/hashicorp/terraform-plugin-testing/helper/resource" 25 | ) 26 | 27 | func TestAccRedfishiDRACDataSource_fetch(t *testing.T) { 28 | resource.Test(t, resource.TestCase{ 29 | PreCheck: func() { testAccPreCheck(t) }, 30 | ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, 31 | Steps: []resource.TestStep{ 32 | { 33 | Config: testAccRedfishDataSourceiDRACConfig(creds), 34 | }, 35 | }, 36 | }) 37 | } 38 | 39 | func testAccRedfishDataSourceiDRACConfig(testingInfo TestingServerCredentials) string { 40 | return fmt.Sprintf(` 41 | data "redfish_dell_idrac_attributes" "idrac" { 42 | redfish_server { 43 | user = "%s" 44 | password = "%s" 45 | endpoint = "%s" 46 | ssl_insecure = true 47 | } 48 | } 49 | `, 50 | testingInfo.Username, 51 | testingInfo.Password, 52 | testingInfo.Endpoint, 53 | ) 54 | } 55 | -------------------------------------------------------------------------------- /redfish/provider/data_source_redfish_virtual_media_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package provider 19 | 20 | import ( 21 | "fmt" 22 | "testing" 23 | 24 | "github.com/hashicorp/terraform-plugin-testing/helper/resource" 25 | ) 26 | 27 | func TestAccRedfishVirtualMedia_fetch(t *testing.T) { 28 | resource.Test(t, resource.TestCase{ 29 | PreCheck: func() { testAccPreCheck(t) }, 30 | ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, 31 | Steps: []resource.TestStep{ 32 | { 33 | Config: testAccRedfishDatasourceVirtualMediaConfig(creds), 34 | }, 35 | }, 36 | }) 37 | } 38 | 39 | func testAccRedfishDatasourceVirtualMediaConfig(testingInfo TestingServerCredentials) string { 40 | return fmt.Sprintf(` 41 | data "redfish_virtual_media" "vm" { 42 | 43 | redfish_server { 44 | user = "%s" 45 | password = "%s" 46 | endpoint = "%s" 47 | ssl_insecure = true 48 | } 49 | } 50 | `, 51 | testingInfo.Username, 52 | testingInfo.Password, 53 | testingInfo.Endpoint, 54 | ) 55 | } 56 | -------------------------------------------------------------------------------- /examples/resources/redfish_directory_service_auth_provider_certificate/resource.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "local_file" "ds_certificate" { 19 | # this is the path to the certificate that we want to upload. 20 | filename = "/root/certificate/new/terraform-provider-redfish/test-data/valid-ds-cert.txt" 21 | } 22 | 23 | resource "redfish_directory_service_auth_provider_certificate" "ds_auth_certificate" { 24 | for_each = var.rack1 25 | 26 | redfish_server { 27 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 28 | # `redfish_alias` is used to align with enhancements to password management. 29 | # When using redfish_alias, provider's `redfish_servers` is required. 30 | redfish_alias = each.key 31 | 32 | user = each.value.user 33 | password = each.value.password 34 | endpoint = each.value.endpoint 35 | ssl_insecure = each.value.ssl_insecure 36 | } 37 | 38 | # certificate type can be PEM 39 | certificate_type = "PEM" 40 | certificate_string = data.local_file.ds_certificate.content 41 | } -------------------------------------------------------------------------------- /redfish/provider/data_source_redfish_firmware_inventory_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package provider 19 | 20 | import ( 21 | "fmt" 22 | "testing" 23 | 24 | "github.com/hashicorp/terraform-plugin-testing/helper/resource" 25 | ) 26 | 27 | // Test case for Firmware DataSource 28 | func TestAccRedfishFirmwareDataSource_basic(t *testing.T) { 29 | resource.Test(t, resource.TestCase{ 30 | PreCheck: func() { testAccPreCheck(t) }, 31 | ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, 32 | Steps: []resource.TestStep{ 33 | { 34 | Config: testAccRedfishDataSourceFirmwareConfig(creds), 35 | }, 36 | }, 37 | }) 38 | } 39 | 40 | func testAccRedfishDataSourceFirmwareConfig(testingInfo TestingServerCredentials) string { 41 | return fmt.Sprintf(` 42 | 43 | data "redfish_firmware_inventory" "inventory" { 44 | 45 | redfish_server { 46 | user = "%s" 47 | password = "%s" 48 | endpoint = "%s" 49 | ssl_insecure = true 50 | } 51 | } 52 | `, 53 | testingInfo.Username, 54 | testingInfo.Password, 55 | testingInfo.Endpoint, 56 | ) 57 | } 58 | -------------------------------------------------------------------------------- /redfish/models/provider.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // ProviderConfig can be used to store data from the Terraform configuration. 25 | type ProviderConfig struct { 26 | Username types.String `tfsdk:"user"` 27 | Password types.String `tfsdk:"password"` 28 | Servers types.Map `tfsdk:"redfish_servers"` 29 | } 30 | 31 | // RedfishServer to configure server config for resource/datasource. 32 | type RedfishServer struct { 33 | RedfishAlias types.String `tfsdk:"redfish_alias"` 34 | User types.String `tfsdk:"user"` 35 | Password types.String `tfsdk:"password"` 36 | Endpoint types.String `tfsdk:"endpoint"` 37 | SslInsecure types.Bool `tfsdk:"ssl_insecure"` 38 | } 39 | 40 | // RedfishServerPure defines server config without RedfishAlias. 41 | type RedfishServerPure struct { 42 | User types.String `tfsdk:"user"` 43 | Password types.String `tfsdk:"password"` 44 | Endpoint types.String `tfsdk:"endpoint"` 45 | SslInsecure types.Bool `tfsdk:"ssl_insecure"` 46 | } 47 | -------------------------------------------------------------------------------- /examples/resources/redfish_storage_controller/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | # system_id is optional. If system_id is not provided, the resource picks the first one from system resources returned by the iDRAC. 19 | terraform import redfish_storage_controller.storage_controller_example '{"storage_id":"","controller_id":"","username":"","password":"","endpoint":"","ssl_insecure":}' 20 | 21 | # terraform import with system_id 22 | terraform import redfish_storage_controller.storage_controller_example '{"system_id":"","storage_id":"","controller_id":"","username":"","password":"","endpoint":"","ssl_insecure":}' 23 | 24 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 25 | # redfish_alias is used to align with enhancements to password management. 26 | terraform import redfish_storage_controller.storage_controller_example '{"storage_id":"","controller_id":"","redfish_alias":""}' -------------------------------------------------------------------------------- /redfish/provider/constants.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | package provider 19 | 20 | const ( 21 | 22 | // ServiceErrorMsg specifies error details occured while creating server connection 23 | ServiceErrorMsg = "service error" 24 | 25 | // RedfishAPIErrorMsg specifies error details occured while calling a redfish API 26 | RedfishAPIErrorMsg = "Error when contacting the redfish API" 27 | 28 | // RedfishFetchErrorMsg specifies error details occured while fetching details 29 | RedfishFetchErrorMsg = "Unable to fetch updated details" 30 | 31 | // RedfishVirtualMediaMountError specifies error when there are issues while mounting virtual media 32 | RedfishVirtualMediaMountError = "Couldn't mount Virtual Media" 33 | 34 | // RedfishJobErrorMsg specifies error details occured while tracking job details 35 | RedfishJobErrorMsg = "Error, job wasn't able to complete" 36 | 37 | // RedfishPasswordErrorMsg specifies if password validation fails in user resource 38 | RedfishPasswordErrorMsg = "Password validation failed" 39 | 40 | // Seventeen specifies the server generation for comparison 41 | Seventeen = 17 42 | ) 43 | -------------------------------------------------------------------------------- /examples/resources/redfish_certificate/resource.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "local_file" "cert" { 19 | # this is the path to the certificate that we want to upload. 20 | filename = "/root/certificate/new/terraform-provider-redfish/test-data/valid-cert.txt" 21 | } 22 | 23 | resource "redfish_certificate" "cert" { 24 | for_each = var.rack1 25 | 26 | redfish_server { 27 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 28 | # `redfish_alias` is used to align with enhancements to password management. 29 | # When using redfish_alias, provider's `redfish_servers` is required. 30 | redfish_alias = each.key 31 | 32 | user = each.value.user 33 | password = each.value.password 34 | endpoint = each.value.endpoint 35 | ssl_insecure = each.value.ssl_insecure 36 | } 37 | 38 | /* Type of the certificate to be imported 39 | List of possible values: [CustomCertificate, Server] 40 | */ 41 | certificate_type = "CustomCertificate" 42 | passphrase = "12345" 43 | ssl_certificate_content = data.local_file.cert.content 44 | } 45 | -------------------------------------------------------------------------------- /examples/resources/redfish_network_adapter/import.sh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | # system_id is optional. If system_id is not provided, the resource picks the first one from system resources returned by the iDRAC. 19 | terraform import redfish_network_adapter.nic '{"network_adapter_id":"","network_device_function_id":"","username":"","password":"","endpoint":"","ssl_insecure":}' 20 | 21 | # terraform import with system_id. 22 | terraform import redfish_network_adapter.nic '{"system_id":"","network_adapter_id":"","network_device_function_id":"","username":"","password":"","endpoint":"","ssl_insecure":}' 23 | 24 | # terraform import with redfish_alias. When using redfish_alias, provider's `redfish_servers` is required. 25 | # redfish_alias is used to align with enhancements to password management. 26 | terraform import redfish_network_adapter.nic '{"network_adapter_id":"","network_device_function_id":"","redfish_alias":""}' -------------------------------------------------------------------------------- /docs/guides/using_ipv6.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | 8 | # http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | page_title: "Using IPv6" 17 | title: "Using IPv6" 18 | linkTitle: "Using IPv6" 19 | --- 20 | 21 | The Redfish API works over REST, and hence it works the same over IPv4 or IPv6. 22 | In order to run this provider on an iDRAC over IPv6, all one needs to do is provide the IPv6 address in the endpoint. 23 | 24 | ## Example 25 | 26 | ```terraform 27 | resource "redfish_simple_update" "update" { 28 | for_each = var.rack1 29 | 30 | redfish_server { 31 | user = "root" 32 | password = "passw0rd" 33 | endpoint = "https:://[2001:db8:a::123]" 34 | } 35 | 36 | // The network protocols and image for firmware update 37 | transfer_protocol = "HTTP" 38 | target_firmware_image = "/home/mikeletux/Downloads/BIOS_FXC54_WN64_1.15.0.EXE" 39 | // Reset parameters to be applied when upgrade is completed 40 | reset_type = "ForceRestart" 41 | reset_timeout = 120 // If not set, by default will be 120s 42 | // The maximum amount of time to wait for the simple update job to be completed 43 | simple_update_job_timeout = 1200 // If not set, by default will be 1200s 44 | } 45 | ``` 46 | -------------------------------------------------------------------------------- /examples/data-sources/redfish_storage_controller/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | data "redfish_storage_controller" "storage_controller_example" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | 33 | storage_controller_filter { 34 | systems = [ 35 | { 36 | system_id = "System.Embedded.1" 37 | storages = [ 38 | { 39 | storage_id = "RAID.Integrated.1-1" 40 | controller_ids = ["RAID.Integrated.1-1"] 41 | } 42 | ] 43 | } 44 | ] 45 | } 46 | 47 | } 48 | 49 | output "storage_controller_example" { 50 | value = data.redfish_storage_controller.storage_controller_example 51 | sensitive = true 52 | } 53 | -------------------------------------------------------------------------------- /templates/guides/using_ipv6.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | 8 | # http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | page_title: "Using IPv6" 17 | title: "Using IPv6" 18 | linkTitle: "Using IPv6" 19 | --- 20 | 21 | The Redfish API works over REST, and hence it works the same over IPv4 or IPv6. 22 | In order to run this provider on an iDRAC over IPv6, all one needs to do is provide the IPv6 address in the endpoint. 23 | 24 | ## Example 25 | 26 | ```terraform 27 | resource "redfish_simple_update" "update" { 28 | for_each = var.rack1 29 | 30 | redfish_server { 31 | user = "root" 32 | password = "passw0rd" 33 | endpoint = "https:://[2001:db8:a::123]" 34 | } 35 | 36 | // The network protocols and image for firmware update 37 | transfer_protocol = "HTTP" 38 | target_firmware_image = "/home/mikeletux/Downloads/BIOS_FXC54_WN64_1.15.0.EXE" 39 | // Reset parameters to be applied when upgrade is completed 40 | reset_type = "ForceRestart" 41 | reset_timeout = 120 // If not set, by default will be 120s 42 | // The maximum amount of time to wait for the simple update job to be completed 43 | simple_update_job_timeout = 1200 // If not set, by default will be 1200s 44 | } 45 | ``` 46 | -------------------------------------------------------------------------------- /examples/resources/redfish_bios/resource.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | 4 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://mozilla.org/MPL/2.0/ 9 | 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | resource "redfish_bios" "bios" { 19 | for_each = var.rack1 20 | 21 | redfish_server { 22 | # Alias name for server BMCs. The key in provider's `redfish_servers` map 23 | # `redfish_alias` is used to align with enhancements to password management. 24 | # When using redfish_alias, provider's `redfish_servers` is required. 25 | redfish_alias = each.key 26 | 27 | user = each.value.user 28 | password = each.value.password 29 | endpoint = each.value.endpoint 30 | ssl_insecure = each.value.ssl_insecure 31 | } 32 | 33 | // Bios attributes to be altered 34 | attributes = { 35 | "NumLock" = "On" 36 | } 37 | 38 | /* Reset parameters to be applied after bios settings are applied 39 | list of possible value: 40 | [ ForceRestart, GracefulRestart, PowerCycle] 41 | */ 42 | reset_type = "ForceRestart" 43 | reset_timeout = "120" 44 | // The maximum amount of time to wait for the bios job to be completed 45 | bios_job_timeout = "1200" 46 | 47 | // by default, the resource uses the first system 48 | # system_id = "System.Embedded.1" 49 | } 50 | -------------------------------------------------------------------------------- /templates/resources/idrac_server_configuration_profile_export.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/resources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/resources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/resources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above resource block, Server Configuration Profile will be exported to share type. 45 | {{- end }} 46 | 47 | {{ .SchemaMarkdown | trimspace }} 48 | 49 | {{ if .HasImport -}} 50 | ## Import 51 | 52 | Import is supported using the following syntax: 53 | 54 | {{codefile "shell" .ImportFile }} 55 | 56 | {{- end }} 57 | -------------------------------------------------------------------------------- /templates/resources/idrac_server_configuration_profile_import.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/resources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/resources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/resources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above resource block, Server Configuration Profile will be imported from share type. 45 | {{- end }} 46 | 47 | {{ .SchemaMarkdown | trimspace }} 48 | 49 | {{ if .HasImport -}} 50 | ## Import 51 | 52 | Import is supported using the following syntax: 53 | 54 | {{codefile "shell" .ImportFile }} 55 | 56 | {{- end }} 57 | -------------------------------------------------------------------------------- /templates/resources/dell_idrac_attributes.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/resources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/resources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/resources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above resource block, iDRAC attributes configuration would have been altered. It can be verified through state file. 45 | {{- end }} 46 | 47 | {{ .SchemaMarkdown | trimspace }} 48 | 49 | {{ if .HasImport -}} 50 | ## Import 51 | 52 | Import is supported using the following syntax: 53 | 54 | {{codefile "shell" .ImportFile }} 55 | 56 | {{- end }} 57 | -------------------------------------------------------------------------------- /templates/resources/dell_lc_attributes.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 2023-2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # 4 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://mozilla.org/MPL/2.0/ 9 | # 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | {{ if .HasExample -}} 30 | ## Example Usage 31 | 32 | variables.tf 33 | {{ tffile ( printf "examples/resources/%s/variables.tf" .Name ) }} 34 | 35 | terraform.tfvars 36 | {{ tffile ( printf "examples/resources/%s/terraform.tfvars" .Name ) }} 37 | 38 | provider.tf 39 | {{ tffile ( printf "examples/resources/%s/provider.tf" .Name ) }} 40 | 41 | main.tf 42 | {{tffile .ExampleFile }} 43 | 44 | After the successful execution of the above resource block, iDRAC attributes configuration would have been altered. It can be verified through state file. 45 | {{- end }} 46 | 47 | {{ .SchemaMarkdown | trimspace }} 48 | 49 | {{ if .HasImport -}} 50 | ## Import 51 | 52 | Import is supported using the following syntax: 53 | 54 | {{codefile "shell" .ImportFile }} 55 | 56 | {{- end }} 57 | --------------------------------------------------------------------------------