├── client └── .gitkeep ├── powerflex ├── resource-test │ ├── powerflex_packages │ │ ├── abc.txt │ │ ├── EMC-ScaleIO-lia-3.6-700.103.Ubuntu.22.04.x86_64.tar │ │ └── EMC-ScaleIO-mdm-3.6-700.103.Ubuntu.22.04.x86_64.tar │ └── gpg_compliance_management │ │ └── cm-20231005-01.gpg ├── models │ ├── package.go │ ├── user.go │ ├── system.go │ ├── compatibility_management.go │ ├── sdc_volumes_mapping.go │ ├── snapshot.go │ ├── fault_set.go │ └── mdm_cluster.go ├── helper │ ├── common.go │ ├── custom_csv_writer.go │ ├── fault_set_helper.go │ └── user_helper.go ├── provider │ └── POWERFLEX_TERRAFORM_TEST.env.sample └── constants │ └── constants.go ├── terraform-registry-manifest.json ├── .gitignore ├── .github ├── CODEOWNERS ├── SECURITY.md └── pull_request_template.md ├── examples ├── resources │ ├── powerflex_sds │ │ ├── import.sh │ │ └── import.tf │ ├── powerflex_sdc_host │ │ ├── import.sh │ │ ├── variables.tf │ │ ├── input.tfvars │ │ ├── import.tf │ │ ├── resource_windows.tf │ │ └── resource_esxi.tf │ ├── powerflex_peer_system │ │ ├── import.sh │ │ ├── input.tfvars │ │ └── import.tf │ ├── powerflex_snapshot │ │ ├── import.sh │ │ └── import.tf │ ├── powerflex_device │ │ ├── import.sh │ │ ├── resource.tf │ │ └── import.tf │ ├── powerflex_resource_group │ │ ├── import.sh │ │ ├── import.tf │ │ └── resource.tf │ ├── powerflex_replication_pair │ │ ├── import.sh │ │ ├── input.tfvars │ │ ├── import.tf │ │ └── variables.tf │ ├── powerflex_volume │ │ ├── import.sh │ │ ├── import.tf │ │ └── resource.tf │ ├── powerflex_fault_set │ │ ├── import.sh │ │ ├── import.tf │ │ └── resource.tf │ ├── powerflex_resource_credential │ │ ├── import.sh │ │ ├── import.tf │ │ └── input.tfvars │ ├── powerflex_protection_domain │ │ ├── import.sh │ │ └── resource.tf │ ├── powerflex_nvme_host │ │ ├── import.sh │ │ ├── import.tf │ │ └── resource.tf │ ├── powerflex_storage_pool │ │ ├── import.sh │ │ └── import.tf │ ├── powerflex_cluster │ │ └── import.sh │ ├── powerflex_nvme_target │ │ ├── import.sh │ │ ├── import.tf │ │ └── resource.tf │ ├── powerflex_snapshot_policy │ │ ├── import.sh │ │ ├── import.tf │ │ └── resource.tf │ ├── powerflex_replication_consistency_group │ │ ├── import.sh │ │ └── input.tfvars │ ├── powerflex_system │ │ ├── import.sh │ │ └── resource.tf │ ├── powerflex_user │ │ └── import.sh │ ├── powerflex_replication_consistency_group_action │ │ ├── input.tfvars │ │ ├── variables.tf │ │ └── resource.tf │ ├── powerflex_template_clone │ │ └── resource.tf │ ├── powerflex_firmware_repository │ │ ├── import.sh │ │ ├── resource.tf │ │ └── import.tf │ ├── powerflex_compatibility_management │ │ └── resource.tf │ ├── powerflex_package │ │ └── resource.tf │ ├── powerflex_os_repository │ │ └── resource.tf │ └── powerflex_sdc_volumes_mapping │ │ ├── import.sh │ │ └── resource.tf ├── data-sources │ ├── powerflex_compatibility_management │ │ └── data-source.tf │ ├── powerflex_fault_set │ │ └── data-source.tf │ ├── powerflex_vtree │ │ └── data-source.tf │ ├── powerflex_nvme_host │ │ └── data-source.tf │ ├── powerflex_peer_system │ │ └── data-source.tf │ ├── powerflex_resource_credentials │ │ └── data-source.tf │ └── powerflex_sdc │ │ └── data-source.tf ├── provider │ └── variables.tf ├── main.tf └── README.md ├── templates ├── data-sources │ ├── resource_credential.md.tmpl │ ├── replication_pair.md.tmpl │ ├── replication_consistency_group.md.tmpl │ ├── storage_pool.md.tmpl │ ├── peer_system.md.tmpl │ ├── sdc.md.tmpl │ ├── volume.md.tmpl │ ├── device.md.tmpl │ ├── resource_group.md.tmpl │ ├── vtree.md.tmpl │ ├── fault_set.md.tmpl │ ├── node.md.tmpl │ ├── os_repository.md.tmpl │ ├── protection_domain.md.tmpl │ ├── snapshot_policy.md.tmpl │ ├── template.md.tmpl │ ├── compliance_report_resource_group.md.tmpl │ ├── firmware_repository.md.tmpl │ ├── compatibility_management.md.tmpl │ ├── nvme_host.md.tmpl │ ├── nvme_target.md.tmpl │ └── sds.md.tmpl ├── data-sources.md.tmpl ├── index.md.tmpl ├── guides │ ├── creating_multiple_volumes_using_for_each.md │ ├── creating_multiple_volumes.md │ └── importing_existing_volumes_mapped_to_sdc.md ├── resources │ ├── os_repository.md.tmpl │ ├── template_clone.md.tmpl │ ├── compatibility_management.md.tmpl │ ├── replication_consistency_group_action.md.tmpl │ ├── resource_group.md.tmpl │ ├── package.md.tmpl │ ├── mdm_cluster.md.tmpl │ ├── user.md.tmpl │ ├── fault_set.md.tmpl │ ├── system.md.tmpl │ ├── replication_pair.md.tmpl │ ├── resource_credential.md.tmpl │ ├── snapshot_policy.md.tmpl │ └── firmware_repository.md.tmpl └── resources.md.tmpl ├── catalog-info.yaml ├── about ├── SUPPORT.md └── INSTALLATION.md ├── docs └── guides │ ├── creating_multiple_volumes_using_for_each.md │ ├── creating_multiple_volumes.md │ └── importing_existing_volumes_mapped_to_sdc.md ├── .goreleaser.yaml └── main.go /client/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /powerflex/resource-test/powerflex_packages/abc.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /powerflex/resource-test/powerflex_packages/EMC-ScaleIO-lia-3.6-700.103.Ubuntu.22.04.x86_64.tar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /powerflex/resource-test/powerflex_packages/EMC-ScaleIO-mdm-3.6-700.103.Ubuntu.22.04.x86_64.tar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /terraform-registry-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "metadata": { 4 | "protocol_versions": ["6.0"] 5 | } 6 | } -------------------------------------------------------------------------------- /powerflex/resource-test/gpg_compliance_management/cm-20231005-01.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/terraform-provider-powerflex/HEAD/powerflex/resource-test/gpg_compliance_management/cm-20231005-01.gpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | examples/config/ 2 | powerflex/*.env 3 | vendor/* 4 | gosec* 5 | .terraform* 6 | tfplan* 7 | terraform.tfvars 8 | powerflex/provider/*.env 9 | powerflex/env.sh 10 | powerflex/trace.txt 11 | examples/trace.txt 12 | cover* 13 | test* 14 | bin/* 15 | .vscode 16 | terraform.tfstate* 17 | Minimal.csv 18 | terraform-provider-powerflex 19 | -------------------------------------------------------------------------------- /.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 | # Akash Shendge (shenda1) 11 | # Anika Agiwal (AnikaAgiwal2711) 12 | # Gokula Srivathsan (gokul-srivathsan) 13 | # Krunal Thakkar (Krunal-Thakkar) 14 | # Priyanshu Krishnan (Krishnan-Priyanshu) 15 | # Rounak Adhikary (rounak-adhikary) 16 | # All Terraform Engineers in Dell (dell/TerraformDell) 17 | 18 | # for all files: 19 | * @shenda1 @AnikaAgiwal2711 @gokul-srivathsan @Krunal-Thakkar @Krishnan-Priyanshu @rounak-adhikary @dell/TerraformDell -------------------------------------------------------------------------------- /examples/resources/powerflex_sds/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import SDS by it's id 15 | terraform import powerflex_sds.sds_data "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_sdc_host/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import SDC by it's IP address 15 | terraform import powerflex_sdc_host.sdc "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_peer_system/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import Peer System by its id 15 | terraform import powerflex_peer_system.example "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_snapshot/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import Snapshot by it's id 15 | terraform import powerflex_snapshot.ss_data "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_device/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import Protection Device by it's id 15 | terraform import powerflex_device.device_data "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_resource_group/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import Resource Group by it's id 15 | terraform import powerflex_resource_group.data "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_replication_pair/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import Replication Pair by its id 15 | terraform import powerflex_replication_pair.example "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_volume/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import volume by it's id 15 | terraform import powerflex_volume.volume_import_by_id "" 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/resources/powerflex_fault_set/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import fault set by it's id 15 | terraform import powerflex_fault_set.fs_import_by_id "" 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/resources/powerflex_resource_credential/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import resource credential by its id 15 | terraform import powerflex_resource_credential.example "" -------------------------------------------------------------------------------- /examples/resources/powerflex_protection_domain/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import Protection Domain by it's id 15 | terraform import powerflex_protection_domain.pd_data "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_nvme_host/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import NVMe host by its id 15 | terraform import powerflex_nvme_host.nvme_host_import_by_id "" 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/resources/powerflex_storage_pool/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import storage pool by it's id 15 | terraform import powerflex_storage_pool.storage_pool_import_by_id "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_cluster/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import existing cluster 15 | terraform import powerflex_cluster.cluster_data ",," 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_nvme_target/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import NVMe target by its id 15 | terraform import powerflex_nvme_target.nvme_target_import_by_id "" 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/resources/powerflex_snapshot_policy/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import snapshot policy by it's id 15 | terraform import powerflex_snapshot_policy.snapshot_policy_import_by_id "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_replication_consistency_group/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import Replication Consistency Group by its id 15 | terraform import powerflex_replication_consistency_group.example "" 16 | -------------------------------------------------------------------------------- /examples/resources/powerflex_system/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import system 15 | terraform import powerflex_system.test "" 16 | 17 | # Another way to import system using system ID 18 | terraform import powerflex_system.test "system_id" -------------------------------------------------------------------------------- /templates/data-sources/resource_credential.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{.Name }} {{.Type | lower}}" 3 | linkTitle: "{{.Name}}" 4 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 5 | subcategory: "Resource Group Management" 6 | description: |- 7 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 8 | --- 9 | 10 | # {{.Name }} ({{.Type}}) 11 | 12 | {{ .Description | trimspace }} 13 | 14 | {{ if .HasExample -}} 15 | ## Example Usage 16 | 17 | {{tffile .ExampleFile }} 18 | {{- end }} 19 | 20 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_resource_credential.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 21 | 22 | {{ .SchemaMarkdown | trimspace }} -------------------------------------------------------------------------------- /templates/data-sources/replication_pair.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{.Name }} {{.Type | lower}}" 3 | linkTitle: "{{.Name}}" 4 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 5 | subcategory: "Data Protection" 6 | description: |- 7 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 8 | --- 9 | 10 | # {{.Name }} ({{.Type}}) 11 | 12 | {{ .Description | trimspace }} 13 | 14 | {{ if .HasExample -}} 15 | ## Example Usage 16 | 17 | {{tffile .ExampleFile }} 18 | {{- end }} 19 | 20 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_replication_pair.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 21 | 22 | {{ .SchemaMarkdown | trimspace }} 23 | 24 | 25 | -------------------------------------------------------------------------------- /catalog-info.yaml: -------------------------------------------------------------------------------- 1 | # nonk8s 2 | apiVersion: backstage.io/v1alpha1 3 | kind: Component 4 | metadata: 5 | name: dell-terraform-provider-powerflex 6 | description: "Terraform Provider For Dell PowerFlex" 7 | tags: 8 | - devops 9 | - automation 10 | - terraform 11 | - dell 12 | - infrastructure-as-code 13 | - terraform-provider 14 | - powerflex 15 | annotations: 16 | backstage.io/techdocs-ref: dir:. 17 | github.com/project-slug: dell/terraform-provider-powerflex 18 | links: 19 | - url: 'https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/' 20 | title: 'Dell Terraform Providers Documentation' 21 | icon: 'web' 22 | - url: 'https://github.com/dell/dell-terraform-providers/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 | -------------------------------------------------------------------------------- /templates/data-sources/replication_consistency_group.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{.Name }} {{.Type | lower}}" 3 | linkTitle: "{{.Name}}" 4 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 5 | subcategory: "Data Protection" 6 | description: |- 7 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 8 | --- 9 | 10 | # {{.Name }} ({{.Type}}) 11 | 12 | {{ .Description | trimspace }} 13 | 14 | {{ if .HasExample -}} 15 | ## Example Usage 16 | 17 | {{tffile .ExampleFile }} 18 | {{- end }} 19 | 20 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_replication_conistancy_group.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 21 | 22 | {{ .SchemaMarkdown | trimspace }} 23 | -------------------------------------------------------------------------------- /examples/resources/powerflex_sdc_host/variables.tf: -------------------------------------------------------------------------------- 1 | variable "user" { 2 | type = string 3 | description = "username of the sdc host." 4 | default = "" 5 | } 6 | 7 | variable "password" { 8 | type = string 9 | description = "password of the sdc host." 10 | default = "" 11 | } 12 | 13 | variable "port" { 14 | type = string 15 | description = "port of the sdc host." 16 | default = "" 17 | } 18 | 19 | variable "name" { 20 | type = string 21 | description = "name of the sdc host." 22 | default = "" 23 | } 24 | 25 | variable "os_family" { 26 | type = string 27 | description = "OS family of the sdc host." 28 | default = "" 29 | } 30 | variable "package_path" { 31 | type = string 32 | description = "package path of the sdc host." 33 | default = "" 34 | } 35 | 36 | variable "ip" { 37 | type = string 38 | description = "ip addresse(s) of the sdc host." 39 | default = "" 40 | } -------------------------------------------------------------------------------- /examples/resources/powerflex_sdc_host/input.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 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 | ## Required fields for all sdc_hosts 19 | user = "example-username" 20 | password = "example-password" 21 | name = "example-sdc-host-name" 22 | os_family = "linux" 23 | ip = "10.0.0.0" 24 | package_path = "/root/terraform-provider-powerflex/EMC-ScaleIO-sdc-3.6-700.103.Ubuntu.22.04.x86_64.tar" 25 | 26 | -------------------------------------------------------------------------------- /powerflex/models/package.go: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // PackageModel defines the struct for device resource 25 | type PackageModel struct { 26 | ID types.String `tfsdk:"id"` 27 | FilePath types.List `tfsdk:"file_path"` 28 | PackageDetails types.Set `tfsdk:"package_details"` 29 | } 30 | -------------------------------------------------------------------------------- /examples/resources/powerflex_user/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import user by it's id 15 | terraform import powerflex_user.user_import_by_id "" 16 | 17 | # import user by it's id - alternative approach by prefixing it with "id:" 18 | terraform import powerflex_user.user_import_by_id "" 19 | 20 | # import user by it's name 21 | terraform import powerflex_user.user_import_by_name "" 22 | -------------------------------------------------------------------------------- /about/SUPPORT.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Support 19 | 20 | For any Terraform Provider for Dell PowerFlex 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 | -------------------------------------------------------------------------------- /powerflex/helper/common.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 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package helper 18 | 19 | import ( 20 | "github.com/hashicorp/terraform-plugin-framework/attr" 21 | ) 22 | 23 | func isKnown(v attr.Value) bool { 24 | return !(v.IsUnknown() || v.IsNull()) 25 | } 26 | 27 | // Known returns true if all values are known 28 | func Known(vs ...attr.Value) bool { 29 | for _, v := range vs { 30 | if !isKnown(v) { 31 | return false 32 | } 33 | } 34 | return true 35 | } 36 | -------------------------------------------------------------------------------- /examples/resources/powerflex_replication_consistency_group_action/input.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 | username = "example_user" 19 | password = "example_password" 20 | endpoint = "example_endpoint" 21 | replication_consistency_group_name = "rcg_name" 22 | # Options are Failover, Restore, Sync, Reverse, Switchover and Snapshot (Default is Sync) 23 | action = "Sync" 24 | -------------------------------------------------------------------------------- /examples/data-sources/powerflex_compatibility_management/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 | # commands to run this tf file : terraform init && terraform apply --auto-approve 19 | # empty block of the powerflex_compatibility_management datasource will give return the compatibility management details 20 | 21 | data "powerflex_compatibility_management" "default" { 22 | } 23 | 24 | output "default" { 25 | value = data.powerflex_compatibility_management.default 26 | } -------------------------------------------------------------------------------- /examples/provider/variables.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | variable "username" { 19 | type = string 20 | description = "Stores the username of PowerFlex host." 21 | } 22 | 23 | variable "password" { 24 | type = string 25 | description = "Stores the password of PowerFlex host." 26 | } 27 | 28 | variable "endpoint" { 29 | type = string 30 | description = "Stores the endpoint of PowerFlex host. eg: https://10.1.1.1:443, here 443 is port where API requests are getting accepted" 31 | } 32 | -------------------------------------------------------------------------------- /examples/resources/powerflex_device/resource.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | # Command to run this tf file : terraform init && terraform plan && terraform apply. 19 | 20 | # Example for adding device. After successful execution, device will be added to the specified storage pool 21 | resource "powerflex_device" "test-device" { 22 | device_path = "/dev/sdc" 23 | storage_pool_name = "pool1" 24 | protection_domain_name = "domain1" 25 | sds_name = "SDS_2" 26 | media_type = "HDD" # HDD/SSD 27 | } 28 | -------------------------------------------------------------------------------- /examples/resources/powerflex_sdc_host/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | import { 15 | to = powerflex_sdc_host.import_test_sdc_linux 16 | id = var.ip 17 | } 18 | 19 | # Example for adding an Linux host as SDC. 20 | resource "powerflex_sdc_host" "import_test_sdc_linux" { 21 | ip = var.ip 22 | remote = { 23 | user = var.user 24 | password = var.password 25 | port = var.port 26 | } 27 | os_family = var.os_family 28 | name = "sdc-host-test-rename" 29 | performance_profile = "Compact" 30 | package_path = var.package_path 31 | } -------------------------------------------------------------------------------- /examples/resources/powerflex_template_clone/resource.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 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 init && terraform plan && terraform apply 19 | # Create, and read is supported for this resource 20 | 21 | //gets original template id from sample templates 22 | data "powerflex_template" "template" { 23 | filter{ 24 | category = ["Sample Templates"] 25 | } 26 | } 27 | 28 | resource "powerflex_template_clone" "example" { 29 | template_name = "Template Clone" 30 | original_template_id=data.powerflex_template.template.template_details[0].original_template_id 31 | } -------------------------------------------------------------------------------- /templates/data-sources.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 | {{ printf "{{tffile %q}}" .ExampleFile }} 33 | {{- end }} 34 | 35 | {{ .SchemaMarkdown | trimspace }} 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/main.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 | terraform { 19 | required_providers { 20 | powerflex = { 21 | source = "registry.terraform.io/dell/powerflex" 22 | } 23 | } 24 | } 25 | 26 | variable "username" { 27 | type = string 28 | } 29 | 30 | variable "password" { 31 | type = string 32 | } 33 | 34 | variable "endpoint" { 35 | type = string 36 | } 37 | 38 | provider "powerflex" { 39 | username = var.username 40 | password = var.password 41 | endpoint = var.endpoint 42 | insecure = true 43 | timeout = 120 44 | } 45 | -------------------------------------------------------------------------------- /examples/resources/powerflex_system/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 | # Command to run this tf file : terraform init && terraform plan && terraform apply 19 | # Create, Update, Delete is supported for this resource 20 | # To import, check import.sh for more info 21 | # restricted_mode is the required parameter 22 | 23 | resource "powerflex_system" "test" { 24 | restricted_mode = "Guid" 25 | sdc_approved_ips = [ 26 | { 27 | id = "sdc_id1" 28 | ips = ["sdc_ip1", "sdc_ip2"] 29 | }, 30 | { 31 | id = "sdc_id2" 32 | ips = ["sdc_ip3"] 33 | }, 34 | ] 35 | } -------------------------------------------------------------------------------- /powerflex/provider/POWERFLEX_TERRAFORM_TEST.env.sample: -------------------------------------------------------------------------------- 1 | # 0 for UT 1 for AT 2 | TF_ACC=0 3 | SDC_ID= 4 | SDC_NAME=powerflex_sdc_ 5 | POWERFLEX_ENDPOINT= 6 | POWERFLEX_VERSION= 7 | POWERFLEX_USERNAME= 8 | POWERFLEX_PASSWORD= 9 | POWERFLEX_INSECURE= 10 | POWERFLEX_SDS_IP_1 = 11 | POWERFLEX_SDS_IP_2 = 12 | POWERFLEX_SDS_IP_3 = 13 | POWERFLEX_SDS_IP_4 = 14 | POWERFLEX_SDS_IP_5 = 15 | POWERFLEX_SDS_IP_6 = 16 | POWERFLEX_SDS_IP_7 = 17 | POWERFLEX_SDS_IP_8 = 18 | POWERFLEX_SDS_IP_9 = 19 | POWERFLEX_SDS_IP_10 = 20 | POWERFLEX_SDS_IP_11 = 21 | POWERFLEX_SDC_NAME = 22 | POWERFLEX_SDC_NAME_2 = 23 | POWERFLEX_SDC_NAME_3 = 24 | POWERFLEX_SDC_IP = 25 | POWERFLEX_SDC_IP1= 26 | POWERFLEX_SDC_VOLUMES_MAPPING_NAME= 27 | POWERFLEX_SDC_VOLUMES_MAPPING_NAME2= 28 | POWERFLEX_SDC_VOLUMES_MAPPING_ID2= 29 | POWERFLEX_PROTECTION_DOMAIN_ID= 30 | POWERFLEX_PROTECTION_DOMAIN_ID_SDS= 31 | POWERFLEX_STORAGE_POOL_NAME= 32 | POWERFLEX_SERVICE_ID= 33 | POWERFLEX_SERVICE_NAME= 34 | POWERFLEX_NVME_HOST_NAME= 35 | POWERFLEX_NVME_HOST_NAME_CREATE= 36 | POWERFLEX_NVME_HOST_NAME_UPDATE= 37 | POWERFLEX_NVME_HOST_NQN= 38 | POWERFLEX_NVME_TARGET_NAME= 39 | POWERFLEX_NVME_TARGET_NAME_CREATE= 40 | POWERFLEX_NVME_TARGET_NAME_UPDATE= 41 | POWERFLEX_NVME_TARGET_IP1= 42 | POWERFLEX_NVME_TARGET_IP2= -------------------------------------------------------------------------------- /examples/resources/powerflex_firmware_repository/import.sh: -------------------------------------------------------------------------------- 1 | # /* 2 | # Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://mozilla.org/MPL/2.0/ 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # */ 13 | 14 | # import firmware respository by it's id 15 | terraform import powerflex_firmware_repository.fr_import_by_id "" 16 | 17 | # After Import, username and password is not needed for approving the unsigned file in case of CIFS share. For approving the file in case of import, please refer the below config(change the value as per your use-case): 18 | resource "powerflex_firmware_repository" "fr_import_by_id" { 19 | source_location = "https://10.10.10.1/artifactory/Denver/RCMs/SoftwareOnly/PowerFlex_Software_4.5.0.0_287_r1.zip" 20 | approve = true 21 | timeout = 45 22 | } 23 | -------------------------------------------------------------------------------- /powerflex/models/user.go: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // Version3X specifies PowerFlex version 3.5 25 | const ( 26 | Version3X = "3.5" 27 | ) 28 | 29 | // UserModel defines struct for User 30 | type UserModel struct { 31 | ID types.String `tfsdk:"id"` 32 | Name types.String `tfsdk:"name"` 33 | Role types.String `tfsdk:"role"` 34 | SystemID types.String `tfsdk:"system_id"` 35 | Password types.String `tfsdk:"password"` 36 | FirstName types.String `tfsdk:"first_name"` 37 | LastName types.String `tfsdk:"last_name"` 38 | } 39 | -------------------------------------------------------------------------------- /examples/resources/powerflex_sds/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | //Gather all existing sds 15 | data "powerflex_sds" "all" { 16 | } 17 | 18 | //Import all sds 19 | import { 20 | for_each = data.powerflex_sds.all.sds_details 21 | to = powerflex_sds.import_test_sds[each.key] 22 | id = each.value.id 23 | } 24 | 25 | //Add them to terraform state 26 | resource "powerflex_sds" "import_test_sds" { 27 | count = length(data.powerflex_sds.all.sds_details) 28 | name = data.powerflex_sds.all.sds_details[count.index].name 29 | protection_domain_id = data.powerflex_sds.all.sds_details[count.index].protection_domain_id 30 | ip_list = data.powerflex_sds.all.sds_details[count.index].ip_list 31 | } -------------------------------------------------------------------------------- /templates/index.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | listIgnoreTitle: true 18 | weight: 1 19 | title: "{{.ProviderShortName}} provider" 20 | linkTitle: "Provider" 21 | page_title: "{{.ProviderShortName}} Provider" 22 | subcategory: "" 23 | description: |- 24 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 25 | --- 26 | 27 | # {{.ProviderShortName}} Provider 28 | 29 | {{ .Description | trimspace }} 30 | 31 | {{ if .HasExample -}} 32 | ## Example Usage 33 | 34 | provider.tf 35 | {{ tffile ( printf "%s" .ExampleFile) }} 36 | 37 | variables.tf 38 | {{ tffile "examples/provider/variables.tf" }} 39 | {{- end }} 40 | 41 | {{ .SchemaMarkdown | trimspace }} 42 | -------------------------------------------------------------------------------- /examples/resources/powerflex_fault_set/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | //Gather all existing fault sets 15 | data "powerflex_fault_set" "all" { 16 | } 17 | 18 | //Import all fault sets 19 | import { 20 | for_each = data.powerflex_fault_set.all.fault_set_details 21 | to = powerflex_fault_set.import_test_fault_set[each.key] 22 | id = each.value.id 23 | } 24 | 25 | //Add them to terraform state 26 | resource "powerflex_fault_set" "import_test_fault_set" { 27 | count = length(data.powerflex_fault_set.all.fault_set_details) 28 | name = data.powerflex_fault_set.all.fault_set_details[count.index].name 29 | protection_domain_id = data.powerflex_fault_set.all.fault_set_details[count.index].protection_domain_id 30 | } -------------------------------------------------------------------------------- /examples/resources/powerflex_firmware_repository/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 | # Example for uploading compliance file. After successful execution, compliance file will be uploaded to the manager. 19 | resource "powerflex_firmware_repository" "upload-test" { 20 | source_location = "https://10.10.10.1/artifactory/Denver/RCMs/SoftwareOnly/PowerFlex_Software_4.5.0.0_287_r1.zip" 21 | username = "user" # To be provided in case of CIFS share 22 | password = "password" # To be provided in case of CIFS share 23 | approve = true # To be used to approve the unsigned file 24 | timeout = 45 #controls that till what time the upload compliance will run 25 | } 26 | -------------------------------------------------------------------------------- /examples/resources/powerflex_fault_set/resource.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | # Command to run this tf file : terraform init && terraform plan && terraform apply 19 | # Create, Update, Delete is supported for this resource 20 | # To import , check import.sh for more info 21 | # name and protection_domain_id is the required parameter to create or update 22 | # To check which attributes of the fault set can be updated, please refer Product Guide in the documentation 23 | 24 | 25 | resource "powerflex_fault_set" "avengers-fs-create" { 26 | # Name of the fault set 27 | name = "avengers-fs-create2" 28 | 29 | # To create / update, protection_domain_id is required 30 | protection_domain_id = "202a046600000000" 31 | } -------------------------------------------------------------------------------- /docs/guides/creating_multiple_volumes_using_for_each.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Creating Multiple Volumes with For Each" 3 | title: "Creating Multiple Volumes with For Each" 4 | linkTitle: "Creating Multiple Volumes with For Each" 5 | --- 6 | 7 | 23 | 24 | You can use the for_each meta-argument to create multiple volumes. 25 | 26 | ## Example 27 | 28 | To create 3 different volumes use the following configuration: 29 | 30 | ```terraform 31 | resource "powerflex_volume" "volume_example" { 32 | for_each = toset( ["Volume1", "Volume2", "Volume3"] ) 33 | name = each.key 34 | protection_domain_name = "domain1" 35 | storage_pool_name = "pool1" 36 | size = 8 37 | capacity_unit = "GB" 38 | } 39 | ``` 40 | -------------------------------------------------------------------------------- /templates/guides/creating_multiple_volumes_using_for_each.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Creating Multiple Volumes with For Each" 3 | title: "Creating Multiple Volumes with For Each" 4 | linkTitle: "Creating Multiple Volumes with For Each" 5 | --- 6 | 7 | 23 | 24 | You can use the for_each meta-argument to create multiple volumes. 25 | 26 | ## Example 27 | 28 | To create 3 different volumes use the following configuration: 29 | 30 | ```terraform 31 | resource "powerflex_volume" "volume_example" { 32 | for_each = toset( ["Volume1", "Volume2", "Volume3"] ) 33 | name = each.key 34 | protection_domain_name = "domain1" 35 | storage_pool_name = "pool1" 36 | size = 8 37 | capacity_unit = "GB" 38 | } 39 | ``` 40 | -------------------------------------------------------------------------------- /templates/resources/os_repository.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: "Firmware and OS Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | 36 | After the execution of above resource block, OS Repository would have been created. For more information, please check the terraform state file. 37 | 38 | {{ .SchemaMarkdown | trimspace }} 39 | -------------------------------------------------------------------------------- /templates/resources.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 | 30 | {{ if .HasExample -}} 31 | ## Example Usage 32 | 33 | {{ printf "{{tffile %q}}" .ExampleFile }} 34 | {{- end }} 35 | 36 | {{ .SchemaMarkdown | trimspace }} 37 | 38 | {{ if .HasImport -}} 39 | ## Import 40 | 41 | Import is supported using the following syntax: 42 | 43 | {{ printf "{{codefile \"shell\" %q}}" .ImportFile }} 44 | 45 | {{- end }} -------------------------------------------------------------------------------- /examples/resources/powerflex_peer_system/input.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 | # System 1 Vars 19 | username_system_1 = "user" 20 | password_system_1 = "Password" 21 | endpoint_system_1 = "4.4.4.4" 22 | name = "system_1-system_2-peerd-system" 23 | protection_domain_name_system_1 = "example_PD" 24 | mdm_ips_system_1 = ["1.2.3.4", "1.2.3.5", "1.2.3.6"] 25 | 26 | # System 2 Vars 27 | username_system_2 = "user" 28 | password_system_2 = "Password" 29 | endpoint_system_2 = "5.5.5.5" 30 | protection_domain_name_system_2 = "example_PD" 31 | mdm_ips_system_2 = ["1.2.3.4", "1.2.3.5", "1.2.3.6"] 32 | -------------------------------------------------------------------------------- /templates/resources/template_clone.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 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: "Resource Group Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, the Template will be cloned. 36 | For more information, please check the terraform state file. 37 | 38 | {{ .SchemaMarkdown | trimspace }} -------------------------------------------------------------------------------- /examples/resources/powerflex_snapshot/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | //Gather Snapshot existing volumes 15 | data "powerflex_volume" "Snapshot" { 16 | filter{ 17 | name = ["test-snapshot-import"] 18 | } 19 | } 20 | 21 | //Gather volume linked to existing snapshot 22 | data "powerflex_volume" "Volume" { 23 | filter{ 24 | name = ["test-vol-import"] 25 | } 26 | } 27 | 28 | //Import all snapshots from volume 29 | import { 30 | to = powerflex_snapshot.import_test_snapshot 31 | id = data.powerflex_volume.Snapshot.volumes[0].id 32 | } 33 | 34 | //Add them to terraform state 35 | resource "powerflex_snapshot" "import_test_snapshot"{ 36 | name = data.powerflex_volume.Snapshot.volumes[0].name 37 | volume_id = data.powerflex_volume.Volume.volumes[0].id 38 | } -------------------------------------------------------------------------------- /powerflex/models/system.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 models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // SystemModel maps the struct to System resource schema 25 | type SystemModel struct { 26 | ID types.String `tfsdk:"id"` 27 | RestrictedMode types.String `tfsdk:"restricted_mode"` 28 | SdcGuids types.List `tfsdk:"sdc_guids"` 29 | SdcApprovedIPs types.List `tfsdk:"sdc_approved_ips"` 30 | SdcIDs types.List `tfsdk:"sdc_ids"` 31 | SdcNames types.List `tfsdk:"sdc_names"` 32 | } 33 | 34 | // SdcApprovedIPsModel maps the struct to SdcApprovedIPs schema 35 | type SdcApprovedIPsModel struct { 36 | ID types.String `tfsdk:"id"` 37 | IPs types.Set `tfsdk:"ips"` 38 | } 39 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Security policy 19 | 20 | The Terraform Provider for Dell PowerFlex 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 Dell PowerFlex maintainers at tpfdi.team@dell.com. 30 | -------------------------------------------------------------------------------- /examples/resources/powerflex_replication_pair/input.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 | # Source Vars 19 | username_source = "example_source_user" 20 | password_source = "example_source_password" 21 | endpoint_source = "example_source_endpoint" 22 | volume_name_source = "example_source_volume_name" 23 | replication_consistency_group_name_source = "example_source_replication_consistency_group_name" 24 | 25 | # Destination Vars 26 | username_destination = "example_destination_user" 27 | password_destination = "example_destination_password" 28 | endpoint_destination = "example_destination_endpoint" 29 | volume_name_destination = "example_destination_volume_name" 30 | -------------------------------------------------------------------------------- /powerflex/models/compatibility_management.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 models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // CompatibilityManagementDatasourceModel defines the schema for the compatibility management datasource 25 | type CompatibilityManagementDatasourceModel struct { 26 | ID types.String `tfsdk:"id"` 27 | Source types.String `tfsdk:"source"` 28 | RepositoryPath types.String `tfsdk:"repository_path"` 29 | CurrentVersion types.String `tfsdk:"current_version"` 30 | AvailabieVersion types.String `tfsdk:"available_version"` 31 | CompatibilityData types.String `tfsdk:"compatibility_data"` 32 | CompatibilityDataBytes types.String `tfsdk:"compatibility_data_bytes"` 33 | } 34 | -------------------------------------------------------------------------------- /powerflex/models/sdc_volumes_mapping.go: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // SdcVolumeMappingResourceModel defines struct SDC volume mapping resource 25 | type SdcVolumeMappingResourceModel struct { 26 | ID types.String `tfsdk:"id"` 27 | Name types.String `tfsdk:"name"` 28 | VolumeList types.List `tfsdk:"volume_list"` 29 | } 30 | 31 | // SdcVolumeModel defines struct volume mapping data 32 | type SdcVolumeModel struct { 33 | VolumeID types.String `tfsdk:"volume_id"` 34 | VolumeName types.String `tfsdk:"volume_name"` 35 | IOPSLimit types.Int64 `tfsdk:"limit_iops"` 36 | BWLimit types.Int64 `tfsdk:"limit_bw_in_mbps"` 37 | AccessMode types.String `tfsdk:"access_mode"` 38 | } 39 | -------------------------------------------------------------------------------- /templates/resources/compatibility_management.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: "Firmware and OS Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, compatibility management would have been created on the PowerFlex array. For more information, please check the terraform state file. 36 | 37 | {{ .SchemaMarkdown | trimspace }} -------------------------------------------------------------------------------- /examples/resources/powerflex_replication_consistency_group/input.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 | # Source Vars 19 | username_source = "example_source_user" 20 | password_source = "example_source_password" 21 | endpoint_source = "example_source_endpoint" 22 | name = "example_replication_consistency_group_name" 23 | rpo_in_seconds = 15 24 | source_protection_domain_name = "example_source_protection_domain" 25 | 26 | # Destination Vars 27 | username_destination = "example_destination_user" 28 | password_destination = "example_destination_password" 29 | endpoint_destination = "example_destination_endpoint" 30 | destination_protection_domain_name = "example_datasource_protection_domain" 31 | -------------------------------------------------------------------------------- /docs/guides/creating_multiple_volumes.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Creating Multiple Volumes with Count" 3 | title: "Creating Multiple Volumes with Count" 4 | linkTitle: "Creating Multiple Volumes with Count" 5 | --- 6 | 7 | 23 | 24 | You can use the count meta-argument to create multiple volumes. 25 | 26 | ## Example 27 | 28 | To create 7 different volumes using the following configuration: 29 | 30 | ```terraform 31 | resource "powerflex_volume" "volumes" { 32 | count = 7 33 | name = "security-footage-${count.index}" 34 | protection_domain_name = "domain1" 35 | storage_pool_name = "pool1" 36 | size = 8 37 | use_rm_cache = true 38 | volume_type = "ThinProvisioned" 39 | access_mode = "ReadWrite" 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /templates/data-sources/storage_pool.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Storage Management" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ if .HasExample -}} 28 | ## Example Usage 29 | 30 | {{tffile .ExampleFile }} 31 | {{- end }} 32 | 33 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_storage_pool.example.attribute_name` where attribute_name is the attribute which user wants to fetch. 34 | 35 | {{ .SchemaMarkdown | trimspace }} 36 | 37 | 38 | -------------------------------------------------------------------------------- /templates/guides/creating_multiple_volumes.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Creating Multiple Volumes with Count" 3 | title: "Creating Multiple Volumes with Count" 4 | linkTitle: "Creating Multiple Volumes with Count" 5 | --- 6 | 7 | 23 | 24 | You can use the count meta-argument to create multiple volumes. 25 | 26 | ## Example 27 | 28 | To create 7 different volumes using the following configuration: 29 | 30 | ```terraform 31 | resource "powerflex_volume" "volumes" { 32 | count = 7 33 | name = "security-footage-${count.index}" 34 | protection_domain_name = "domain1" 35 | storage_pool_name = "pool1" 36 | size = 8 37 | use_rm_cache = true 38 | volume_type = "ThinProvisioned" 39 | access_mode = "ReadWrite" 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /templates/data-sources/peer_system.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: "Data Protection" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_peer_system.example1.attribute_name` where attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | -------------------------------------------------------------------------------- /examples/resources/powerflex_firmware_repository/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | //Gather all existing firmware repositories 15 | data "powerflex_firmware_repository" "all" { 16 | } 17 | 18 | //Import all firmware repositories 19 | import { 20 | for_each = data.powerflex_firmware_repository.all.firmware_repository_details 21 | id = powerflex_firmware_repository.import_test_firmware_repository[each.key] 22 | to = each.value.id 23 | } 24 | 25 | //Add them to terraform state 26 | resource "powerflex_firmware_repository" "import_test_firmware_repository" { 27 | count = length(data.powerflex_firmware_repository.all.firmware_repository_details) 28 | source_location = data.powerflex_firmware_repository.all.firmware_repository_details[count.index].source_location 29 | username = data.powerflex_firmware_repository.all.firmware_repository_details[count.index].username 30 | } -------------------------------------------------------------------------------- /powerflex/constants/constants.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 constants 19 | 20 | const ( 21 | // UpdatesNotSupportedErrorMsg is the Error message for updates not supported 22 | UpdatesNotSupportedErrorMsg = "Updates are not supported for this resource" 23 | 24 | // DeleteIsNotSupportedErrorMsg is the Error message for delete not supported 25 | DeleteIsNotSupportedErrorMsg = "Delete is not supported for this resource" 26 | 27 | // Sync is the sync constant 28 | Sync = "Sync" 29 | 30 | // Restore is the restore constant 31 | Restore = "Restore" 32 | 33 | // Failover is the failover constant 34 | Failover = "Failover" 35 | 36 | // Reverse is the reverse constant 37 | Reverse = "Reverse" 38 | 39 | // Switchover is the switchover constant 40 | Switchover = "Switchover" 41 | 42 | // Snapshot is the snapshot constant 43 | Snapshot = "Snapshot" 44 | ) 45 | -------------------------------------------------------------------------------- /templates/data-sources/sdc.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Host and Device Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_sdc.selected.attribute_name` where attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /templates/data-sources/volume.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Storage Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_volume.volume.attribute_name` where attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /templates/data-sources/device.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Host and Device Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_device.dev.attribute_name` where attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /examples/resources/powerflex_nvme_target/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | // Get all of the existing NVMe targets 15 | data "powerflex_nvme_target" "existing" { 16 | } 17 | 18 | // Import all of the NVMe targets 19 | import { 20 | for_each = data.powerflex_nvme_target.existing.nvme_target_details 21 | to = powerflex_nvme_target.this[each.key] 22 | id = each.value.id 23 | } 24 | 25 | // Add them to the terraform state 26 | resource "powerflex_nvme_target" "this" { 27 | count = length(data.powerflex_nvme_target.existing.nvme_target_details) 28 | name = data.powerflex_nvme_target.existing.nvme_target_details[count.index].name 29 | protection_domain_id = data.powerflex_nvme_target.existing.nvme_target_details[count.index].protection_domain_id 30 | ip_list = data.powerflex_nvme_target.existing.nvme_target_details[count.index].ip_list 31 | } -------------------------------------------------------------------------------- /examples/resources/powerflex_compatibility_management/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 | # Command to run this tf file : terraform init && terraform plan && terraform apply. 19 | 20 | // Resource to manage lifecycle 21 | resource "terraform_data" "always_run" { 22 | input = timestamp() 23 | } 24 | 25 | # Example for setting compatibility management. After successful execution, device will be added to the specified storage pool 26 | resource "powerflex_compatibility_management" "test" { 27 | # Required Path on your local machine to your gpg file ie(/example/path/secring.gpg) 28 | repository_path = "/example/path/example.gpg" 29 | 30 | // This will allow terraform create process to trigger each time we run terraform apply. 31 | lifecycle { 32 | replace_triggered_by = [ 33 | terraform_data.always_run 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /templates/data-sources/resource_group.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: "Resource Group Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_resource_group.example1.attribute_name` where attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /templates/resources/replication_consistency_group_action.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: "Data Protection" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, The selected Action will be preformed on the selected RCG. 36 | Each time the RCG Actions resource is run it will preform the action again. 37 | For more information, please check the terraform state file. 38 | 39 | {{ .SchemaMarkdown | trimspace }} 40 | -------------------------------------------------------------------------------- /examples/resources/powerflex_package/resource.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | # Example for uploading packages. After successful execution, packages will be uploaded to the gateway. 19 | resource "powerflex_package" "upload-test" { 20 | file_path = ["/root/powerflex_packages/PowerFlex_3.6.700.103_RHEL_OEL7/EMC-ScaleIO-lia-3.6-700.103.el7.x86_64.rpm", 21 | "/root/powerflex_packages/PowerFlex_3.6.700.103_RHEL_OEL7/EMC-ScaleIO-mdm-3.6-700.103.el7.x86_64.rpm", 22 | "/root/powerflex_packages/PowerFlex_3.6.700.103_RHEL_OEL7/EMC-ScaleIO-sds-3.6-700.103.el7.x86_64.rpm", 23 | "/root/powerflex_packages/PowerFlex_3.6.700.103_RHEL_OEL7/EMC-ScaleIO-sdc-3.6-700.103.el7.x86_64.rpm", 24 | "/root/powerflex_packages/PowerFlex_3.6.700.103_RHEL_OEL7/EMC-ScaleIO-sdr-3.6-700.103.el7.x86_64.rpm", 25 | "/root/powerflex_packages/PowerFlex_3.6.700.103_RHEL_OEL7/EMC-ScaleIO-sdt-3.6-700.103.el7.x86_64.rpm"] 26 | } 27 | -------------------------------------------------------------------------------- /examples/resources/powerflex_resource_credential/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 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 | // Get the data of a specific resource credential 19 | data "powerflex_resource_credential" "all_current_resource_credentials" { 20 | filter { 21 | label = [var.name] 22 | } 23 | } 24 | 25 | import { 26 | to = powerflex_resource_credential.imported_resource_credentials 27 | id = data.powerflex_resource_credential.all_current_resource_credentials.resource_credential_details[0].id 28 | } 29 | 30 | resource "powerflex_resource_credential" "imported_resource_credentials" { 31 | name = data.powerflex_resource_credential.all_current_resource_credentials.resource_credential_details[0].label 32 | username = data.powerflex_resource_credential.all_current_resource_credentials.resource_credential_details[0].username 33 | password = var.password 34 | type = var.type 35 | } 36 | -------------------------------------------------------------------------------- /examples/resources/powerflex_os_repository/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 | # Command to run this tf file : terraform plan && terraform apply. 19 | 20 | // Resource to manage lifecycle 21 | resource "terraform_data" "always_run" { 22 | input = timestamp() 23 | } 24 | 25 | # Example for creating OS repository. After successful execution, OS Repository will be created. 26 | resource "powerflex_os_repository" "test" { 27 | # Required Fields 28 | 29 | # Name of the OS repository 30 | name = "TestOsRepo" 31 | # Source path of the OS image 32 | source_path = "https://pathtoimage.iso" 33 | # Supported image types are redhat7, vmware_esxi, sles, windows2016, windows2019 34 | image_type = "vmware_esxi" 35 | 36 | // This will allow terraform create process to trigger each time we run terraform apply. 37 | lifecycle { 38 | replace_triggered_by = [ 39 | terraform_data.always_run 40 | ] 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/resources/powerflex_sdc_volumes_mapping/import.sh: -------------------------------------------------------------------------------- 1 | # Below are the steps to import sdc along with mapped volumes : 2 | # Step 1 - To import a sdc , we need the id of that sdc 3 | # Step 2 - To check the id of the sdc we can make use of sdc datasource . Please refer sdc_datasource.tf for more info. 4 | # Step 3 - create a tf file with empty resource block . Refer the example below. 5 | # Example : 6 | # resource "powerflex_sdc_volumes_mapping" "resource_block_name" { 7 | # } 8 | # Step 4 - execute the command: terraform import "powerflex_sdc_volumes_mapping.resource_block_name" "id_of_the_sdc" (resource_block_name must be taken from step 3 and id must be taken from step 2) 9 | # Step 5 - After successful execution of the command , check the state file. 10 | 11 | # /* 12 | # Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved. 13 | # Licensed under the Mozilla Public License Version 2.0 (the "License"); 14 | # you may not use this file except in compliance with the License. 15 | # You may obtain a copy of the License at 16 | # http://mozilla.org/MPL/2.0/ 17 | # Unless required by applicable law or agreed to in writing, software 18 | # distributed under the License is distributed on an "AS IS" BASIS, 19 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | # See the License for the specific language governing permissions and 21 | # limitations under the License. 22 | # */ 23 | 24 | # import using SDC id 25 | terraform import powerflex_sdc_volumes_mapping.sdc_mapping_import_by_id "" 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/resources/powerflex_nvme_host/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | // Get all of the existing NVMe hosts 15 | data "powerflex_nvme_host" "existing" { 16 | } 17 | 18 | // Import all of the NVMe hosts 19 | import { 20 | for_each = data.powerflex_nvme_host.existing.nvme_host_details 21 | to = powerflex_nvme_host.this[each.key] 22 | id = each.value.id 23 | } 24 | 25 | // Add them to the terraform state 26 | resource "powerflex_nvme_host" "this" { 27 | count = length(data.powerflex_nvme_host.existing.nvme_host_details) 28 | name = data.powerflex_nvme_host.existing.nvme_host_details[count.index].name 29 | nqn = data.powerflex_nvme_host.existing.nvme_host_details[count.index].nqn 30 | max_num_paths = data.powerflex_nvme_host.existing.nvme_host_details[count.index].max_num_paths 31 | max_num_sys_ports = data.powerflex_nvme_host.existing.nvme_host_details[count.index].max_num_sys_ports 32 | } -------------------------------------------------------------------------------- /templates/resources/resource_group.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: "Resource Group Management" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | 30 | {{ if .HasExample -}} 31 | ## Example Usage 32 | 33 | {{tffile .ExampleFile }} 34 | {{- end }} 35 | 36 | After the execution of above resource block, Resource Group would have been deployed on the PowerFlex Gateway. For more information, please check the terraform state file. 37 | 38 | {{ .SchemaMarkdown | trimspace }} 39 | 40 | {{ if .HasImport -}} 41 | ## Import 42 | 43 | Import is supported using the following syntax: 44 | 45 | {{codefile "shell" .ImportFile }} 46 | 47 | {{- end }} -------------------------------------------------------------------------------- /.goreleaser.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /templates/data-sources/vtree.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Storage Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_vtree.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /templates/data-sources/fault_set.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Storage Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_fault_set.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /templates/data-sources/node.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Resource Group Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_node.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /examples/resources/powerflex_replication_consistency_group_action/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 | variable "username" { 18 | type = string 19 | description = "Stores the username of PowerFlex host." 20 | } 21 | 22 | variable "password" { 23 | type = string 24 | description = "Stores the password of PowerFlex host." 25 | } 26 | 27 | variable "endpoint" { 28 | type = string 29 | description = "Stores the endpoint of PowerFlex host. eg: https://10.1.1.1:443, here 443 is port where API requests are getting accepted" 30 | } 31 | 32 | variable "replication_consistency_group_name" { 33 | type = string 34 | description = "The Replication Consistency Group name." 35 | } 36 | 37 | variable "action" { 38 | type = string 39 | description = "The Replication Consistency Group action to be preformed. Options Failover, Restore, Sync, Reverse, Switchover and Snapshot" 40 | } 41 | -------------------------------------------------------------------------------- /templates/data-sources/os_repository.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: "Firmware and OS Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_os_repository.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | -------------------------------------------------------------------------------- /templates/data-sources/protection_domain.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Storage Management" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | > **Note:** Only one of `name` and `id` can be provided at a time. 30 | 31 | {{ if .HasExample -}} 32 | ## Example Usage 33 | 34 | {{tffile .ExampleFile }} 35 | {{- end }} 36 | 37 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_protection_domain.pd.attribute_name` where attribute_name is the attribute which user wants to fetch. 38 | 39 | {{ .SchemaMarkdown | trimspace }} 40 | 41 | 42 | -------------------------------------------------------------------------------- /templates/data-sources/snapshot_policy.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Data Protection" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | > **Note:** Only one of `name` and `id` can be provided at a time. 30 | 31 | {{ if .HasExample -}} 32 | ## Example Usage 33 | 34 | {{tffile .ExampleFile }} 35 | {{- end }} 36 | 37 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_powerflex_snapshot_policy.sp.attribute_name` where attribute_name is the attribute which user wants to fetch. 38 | 39 | {{ .SchemaMarkdown | trimspace }} 40 | 41 | 42 | -------------------------------------------------------------------------------- /templates/data-sources/template.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Resource and Credential Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_template.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022-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 main 19 | 20 | import ( 21 | "context" 22 | "log" 23 | "terraform-provider-powerflex/powerflex/provider" 24 | 25 | "github.com/hashicorp/terraform-plugin-framework/providerserver" 26 | ) 27 | 28 | // Provider documentation generation. 29 | //go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@v0.19.4 generate --provider-name powerflex 30 | 31 | func main() { 32 | err := providerserver.Serve(context.Background(), provider.New, providerserver.ServeOpts{ 33 | // NOTE: This is not a typical Terraform Registry provider address, 34 | // such as registry.terraform.io/dell/powerflex. This specific 35 | // provider address is used in these tutorials in conjunction with a 36 | // specific Terraform CLI configuration for manual development testing 37 | // of this provider. 38 | Address: "registry.terraform.io/dell/powerflex", 39 | }) 40 | 41 | if err != nil { 42 | log.Fatal(err.Error()) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/resources/powerflex_nvme_host/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 | # Command to run this tf file : terraform init && terraform plan && terraform apply. 19 | # Create, Update, Read, and Delete operations are supported for this resource. 20 | # To import , check import.sh for more info 21 | # nqn is the required parameter to create 22 | # To check which attributes can be updated, please refer Product Guide in the documentation 23 | # Please note that 24 | # 1. NVMe over TCP is supported in PowerFlex 4.0 and later versions, therefore this resource is not supported in PowerFlex 3.x. 25 | # 2. Due to certain limitations, updating the NVMe host in PowerFlex versions earlier than 4.6 is not supported 26 | 27 | # Example for adding NVMe host. 28 | resource "powerflex_nvme_host" "test-nvme-host" { 29 | name = "nvme_host_name" 30 | nqn = "nqn.2014-08.org.nvmexpress:uuid:a10e4d56-a2c0-4cab-9a0a-9a7a4ebb8c0e" 31 | max_num_paths = 4 32 | max_num_sys_ports = 10 33 | } -------------------------------------------------------------------------------- /templates/data-sources/compliance_report_resource_group.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: "Resource and Credential Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_compliance_report_resource_group.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | -------------------------------------------------------------------------------- /templates/data-sources/firmware_repository.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Firmware and OS Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_firmware_repository.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | -------------------------------------------------------------------------------- /templates/data-sources/compatibility_management.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: "Firmware and OS Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the successful execution of above said block, we can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_compatibility_management.datasource_block_name.attribute_name` where datasource_block_name is the name of the data source block and attribute_name is the attribute which user wants to fetch. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /examples/resources/powerflex_device/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | //Gather all existing devices 15 | data "powerflex_device" "all" { 16 | } 17 | 18 | //Import all devices 19 | import { 20 | for_each = data.powerflex_device.all.device_model 21 | to = powerflex_device.import_test_device[each.key] 22 | id = each.value.id 23 | } 24 | 25 | //Add them to terraform state 26 | resource "powerflex_device" "import_test_device" { 27 | count = length(data.powerflex_device.all.device_model) 28 | name = data.powerflex_device.all.device_model[count.index].name 29 | sds_id = data.powerflex_device.all.device_model[count.index].sds_id 30 | storage_pool_id = data.powerflex_device.all.device_model[count.index].storage_pool_id 31 | device_path = data.powerflex_device.all.device_model[count.index].device_current_path_name 32 | media_type = data.powerflex_device.all.device_model[count.index].media_type 33 | external_acceleration_type = data.powerflex_device.all.device_model[count.index].external_acceleration_type 34 | } -------------------------------------------------------------------------------- /templates/data-sources/nvme_host.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: "Host and Device Management" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | > **Note:** 30 | NVMe over TCP is supported in PowerFlex 4.0 and later versions, therefore this datasource is not supported in PowerFlex 3.x. 31 | 32 | {{ if .HasExample -}} 33 | ## Example Usage 34 | 35 | {{tffile .ExampleFile }} 36 | {{- end }} 37 | 38 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_nvme_host.example1.datasource_block_name.attribute_name` where attribute_name is the attribute which user wants to fetch. 39 | 40 | {{ .SchemaMarkdown | trimspace }} 41 | 42 | 43 | -------------------------------------------------------------------------------- /templates/data-sources/nvme_target.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: "Host and Device Management" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | > **Note:** 30 | NVMe over TCP is supported in PowerFlex 4.0 and later versions, therefore this datasource is not supported in PowerFlex 3.x. 31 | 32 | {{ if .HasExample -}} 33 | ## Example Usage 34 | 35 | {{tffile .ExampleFile }} 36 | {{- end }} 37 | 38 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_nvme_target.example1.datasource_block_name.attribute_name` where attribute_name is the attribute which user wants to fetch. 39 | 40 | {{ .SchemaMarkdown | trimspace }} 41 | 42 | 43 | -------------------------------------------------------------------------------- /templates/data-sources/sds.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name}}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Host and Device Management" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | > **Note:** Exactly one of `protection_domain_name` and `protection_domain_id` is required. 30 | 31 | > **Note:** Only one of `sds_names` and `sds_ids` can be provided at a time. 32 | 33 | {{ if .HasExample -}} 34 | ## Example Usage 35 | 36 | {{tffile .ExampleFile }} 37 | {{- end }} 38 | 39 | After the successful execution of above said block, We can see the output by executing `terraform output` command. Also, we can fetch information via the variable: `data.powerflex_sds.example2.attribute_name` where attribute_name is the attribute which user wants to fetch. 40 | 41 | {{ .SchemaMarkdown | trimspace }} 42 | 43 | 44 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Description 19 | A few sentences describing the overall goals of the pull request's commits. 20 | 21 | # GitHub Issues 22 | List the GitHub issues impacted by this PR: 23 | 24 | | GitHub Issue # | 25 | | -------------- | 26 | | | 27 | 28 | # Checklist: 29 | 30 | - [ ] I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues 31 | - [ ] I have verified that new and existing unit tests pass locally with my changes 32 | - [ ] I have not allowed coverage numbers to degenerate 33 | - [ ] I have maintained at least 80% code coverage 34 | - [ ] I have commented my code, particularly in hard-to-understand areas 35 | - [ ] I have made corresponding changes to the documentation 36 | - [ ] I have added tests that prove my fix is effective or that my feature works 37 | - [ ] Backward compatibility is not broken 38 | 39 | # How Has This Been Tested? 40 | Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration 41 | 42 | - [ ] Test A 43 | - [ ] Test B -------------------------------------------------------------------------------- /templates/resources/package.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Firmware and OS Management" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | >**Note:** This resource can be used to upload packages to a PowerFlex Manager (4.x) or Gateway Server (3.x). We can add or remove packages from PowerFlex Manager or Gateway. Import functionality is not supported. 30 | 31 | {{ if .HasExample -}} 32 | ## Example Usage 33 | 34 | {{tffile .ExampleFile }} 35 | {{- end }} 36 | 37 | After the execution of above resource block, package would have been uploaded on the PowerFlex Gateway. For more information, please check the terraform state file. 38 | 39 | {{ .SchemaMarkdown | trimspace }} 40 | 41 | {{ if .HasImport -}} 42 | ## Import 43 | 44 | Import is supported using the following syntax: 45 | 46 | {{codefile "shell" .ImportFile }} 47 | 48 | {{- end }} -------------------------------------------------------------------------------- /docs/guides/importing_existing_volumes_mapped_to_sdc.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Import existing volume mappings of SDC" 3 | title: "Import existing volume mappings of SDC" 4 | linkTitle: "Import existing volume mappings of SDC" 5 | --- 6 | 7 | 23 | 24 | # Importing existing volume mappings of SDC using sdc_volumes_mapping resource 25 | 26 | This guide explains how to import volumes mapped to SDC using sdc_volumes_mapping_resource. Below steps are taken from [this article](https://developer.hashicorp.com/terraform/language/import/generating-configuration). 27 | 28 | ### Step 1: Add the import block 29 | ```terraform 30 | import { 31 | to = powerflex_sdc_volumes_mapping.test 32 | id = "sdc_id" 33 | } 34 | ``` 35 | 36 | ### Step 2: Plan and generate configuration 37 | ``` 38 | terraform plan -generate-config-out=test.tf 39 | ``` 40 | 41 | ### Step 3: Review generated configuration in test.tf 42 | 43 | ### Step 4: Run terraform apply to import the volumes mapped to SDC. Choose only one argument from mutually exclusive arguments.
44 | For example, choose either volume_id or volume_name from sdc_volumes_mapping resource. -------------------------------------------------------------------------------- /examples/resources/powerflex_resource_group/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | //Gather all exsisting resource groups 15 | data "powerflex_resource_group" "all" { 16 | } 17 | 18 | //Gather all exsisting templates 19 | data "powerflex_template" "all" { 20 | } 21 | 22 | //Import all resource groups 23 | import { 24 | for_each = data.powerflex_resource_group.all.resource_group_details 25 | to = powerflex_resource_group.import_test_resource_group[each.key] 26 | id = each.value.id 27 | } 28 | 29 | //Add them to terraform state 30 | resource "powerflex_resource_group" "import_test_resource_group" { 31 | count = length(data.powerflex_resource_group.all.resource_group_details) 32 | deployment_name = data.powerflex_resource_group.all.resource_group_details[count.index].deployment_name 33 | deployment_description = data.powerflex_resource_group.all.resource_group_details[count.index].deployment_description 34 | template_id = data.powerflex_template.all.template_details[count.index].id // Not gathered in Resource group datasource 35 | firmware_id = data.powerflex_resource_group.all.resource_group_details[count.index].firmware_repository_id 36 | } -------------------------------------------------------------------------------- /examples/resources/powerflex_snapshot_policy/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | //Gather all existing snapshot policies 15 | data "powerflex_snapshot_policy" "all" { 16 | } 17 | 18 | //Import all snapshot policies 19 | import{ 20 | for_each = data.powerflex_snapshot_policy.all.snapshot_policy 21 | to = powerflex_snapshot_policy.import_test_snapshot_policy[each.key] 22 | id = each.value.id 23 | } 24 | 25 | //Add them to terraform state 26 | resource "powerflex_snapshot_policy" "import_test_snapshot_policy" { 27 | name = data.powerflex_snapshot_policy.all.snapshot_policy[count.index].name 28 | num_of_retained_snapshots_per_level = data.powerflex_snapshot_policy.all.snapshot_policy[count.index].num_of_retained_snapshots_per_level 29 | auto_snapshot_creation_cadence_in_min = data.powerflex_snapshot_policy.all.snapshot_policy[count.index].auto_snapshot_creation_cadence_in_min 30 | snapshot_access_mode = data.powerflex_snapshot_policy.all.snapshot_policy[count.index].snapshot_access_mode 31 | secure_snapshots = data.powerflex_snapshot_policy.all.snapshot_policy[count.index].secure_snapshots 32 | } -------------------------------------------------------------------------------- /templates/guides/importing_existing_volumes_mapped_to_sdc.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Import existing volume mappings of SDC" 3 | title: "Import existing volume mappings of SDC" 4 | linkTitle: "Import existing volume mappings of SDC" 5 | --- 6 | 7 | 23 | 24 | # Importing existing volume mappings of SDC using sdc_volumes_mapping resource 25 | 26 | This guide explains how to import volumes mapped to SDC using sdc_volumes_mapping_resource. Below steps are taken from [this article](https://developer.hashicorp.com/terraform/language/import/generating-configuration). 27 | 28 | ### Step 1: Add the import block 29 | ```terraform 30 | import { 31 | to = powerflex_sdc_volumes_mapping.test 32 | id = "sdc_id" 33 | } 34 | ``` 35 | 36 | ### Step 2: Plan and generate configuration 37 | ``` 38 | terraform plan -generate-config-out=test.tf 39 | ``` 40 | 41 | ### Step 3: Review generated configuration in test.tf 42 | 43 | ### Step 4: Run terraform apply to import the volumes mapped to SDC. Choose only one argument from mutually exclusive arguments.
44 | For example, choose either volume_id or volume_name from sdc_volumes_mapping resource. -------------------------------------------------------------------------------- /examples/resources/powerflex_volume/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | //Gather all existing volumes 15 | data "powerflex_volume" "all"{ 16 | } 17 | 18 | //Gather all existing protection domains 19 | data "powerflex_protection_domain" "all" { 20 | } 21 | 22 | //Import all volumes 23 | import { 24 | for_each = data.powerflex_volume.all.volumes 25 | to = powerflex_volume.import_test_volume[each.key] 26 | id = each.value.id 27 | } 28 | 29 | //Add them to terraform state 30 | resource "powerflex_volume" "import_test_volume" { 31 | count = length(data.powerflex_volume.all.volumes) 32 | name = data.powerflex_volume.all.volumes[count.index].name 33 | protection_domain_name = data.powerflex_protection_domain.all.protection_domains[count.index].name # Value is not gathered from volume datasource 34 | storage_pool_id = data.powerflex_volume.all.volumes[count.index].storage_pool_id 35 | size = floor(data.powerflex_volume.all.volumes[count.index].size_in_kb / 1000000) 36 | capacity_unit = "GB" # GB/TB 37 | use_rm_cache = data.powerflex_volume.all.volumes[count.index].use_rm_cache 38 | volume_type = data.powerflex_volume.all.volumes[count.index].volume_type 39 | } -------------------------------------------------------------------------------- /examples/resources/powerflex_snapshot_policy/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 | # Command to run this tf file : terraform init && terraform plan && terraform apply 19 | # Create, Update, Delete is supported for this resource 20 | # To import , check import.sh for more info 21 | # name, num_of_retained_snapshots_per_level, auto_snapshot_creation_cadence_in_min is the required parameter to create or update 22 | 23 | 24 | resource "powerflex_snapshot_policy" "sp" { 25 | name = "snap-create" 26 | num_of_retained_snapshots_per_level = [2, 6, 7] 27 | auto_snapshot_creation_cadence_in_min = 6 28 | volume_ids = ["edd2fb3100000007", "edd322270000000a"] # assigning or unassigning volumes to snapshot policy 29 | snapshot_access_mode = "ReadWrite" # Cannot be updated after creation. It only supports two values : ReadOnly / ReadWrite 30 | secure_snapshots = false # Cannot be updated after creation 31 | #remove_mode = "Remove" #remove_mode is applicable while unassingning the volumes from the snapshot policy. It only supports two values : Remove / Detach 32 | } -------------------------------------------------------------------------------- /examples/resources/powerflex_nvme_target/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 | # Command to run this tf file : terraform init && terraform plan && terraform apply. 19 | # Create, Update, Read, and Delete operations are supported for this resource. 20 | # To import , check import.sh for more info. 21 | # name and ip_list attributes are required, and either protection_domain_name or protection_domain_id must be specified. 22 | # To check which attributes can be updated, please refer Product Guide in the documentation 23 | # Please note that NVMe over TCP is supported in PowerFlex 4.0 and later versions, therefore this resource is not supported in PowerFlex 3.x. 24 | # To avoid potential issues, it is recommended to operate NVMe targets using the default ports. 25 | 26 | # Example for adding NVMe target. 27 | resource "powerflex_nvme_target" "test-nvme-target" { 28 | name = "nvme_target_name" 29 | protection_domain_name = "demo-pd" 30 | ip_list = [ 31 | { 32 | ip = "10.10.10.13" 33 | role = "StorageAndHost" #StorageAndHost, StorageOnly, HostOnly 34 | }, 35 | { 36 | ip = "10.10.10.14" 37 | role = "StorageAndHost" #StorageAndHost, StorageOnly, HostOnly 38 | } 39 | ] 40 | } -------------------------------------------------------------------------------- /examples/resources/powerflex_protection_domain/resource.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | # Example for creating protection domain. After successful execution, protection domain will be created on the cluster. 19 | resource "powerflex_protection_domain" "pd" { 20 | # required paramaters ====== 21 | 22 | name = "domain_1" 23 | 24 | # optional parameters ====== 25 | 26 | active = true 27 | 28 | # SDS IOPS throttling 29 | # overall_io_network_throttling_in_kbps must be greater than the rest of the parameters 30 | # 0 indicates unlimited IOPS 31 | protected_maintenance_mode_network_throttling_in_kbps = 10 * 1024 32 | rebuild_network_throttling_in_kbps = 10 * 1024 33 | rebalance_network_throttling_in_kbps = 10 * 1024 34 | vtree_migration_network_throttling_in_kbps = 10 * 1024 35 | overall_io_network_throttling_in_kbps = 20 * 1024 36 | 37 | # Fine granularity metadata caching 38 | fgl_metadata_cache_enabled = true 39 | fgl_default_metadata_cache_size = 1024 40 | 41 | # Read Flash cache 42 | rf_cache_enabled = true 43 | rf_cache_operational_mode = "ReadAndWrite" # Read/Write/ReadAndWrite/WriteMiss 44 | rf_cache_page_size_kb = 16 45 | rf_cache_max_io_size_kb = 32 46 | } 47 | -------------------------------------------------------------------------------- /powerflex/models/snapshot.go: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // SnapshotResourceModel maps the resource schema data. 25 | type SnapshotResourceModel struct { 26 | Name types.String `tfsdk:"name"` 27 | VolumeID types.String `tfsdk:"volume_id"` 28 | VolumeName types.String `tfsdk:"volume_name"` 29 | AccessMode types.String `tfsdk:"access_mode"` 30 | ID types.String `tfsdk:"id"` 31 | Size types.Int64 `tfsdk:"size"` 32 | CapacityUnit types.String `tfsdk:"capacity_unit"` 33 | SizeInKb types.Int64 `tfsdk:"size_in_kb"` 34 | LockAutoSnapshot types.Bool `tfsdk:"lock_auto_snapshot"` 35 | RemoveMode types.String `tfsdk:"remove_mode"` 36 | DesiredRetention types.Int64 `tfsdk:"desired_retention"` 37 | RetentionUnit types.String `tfsdk:"retention_unit"` 38 | RetentionInMin types.String `tfsdk:"retention_in_min"` 39 | } 40 | 41 | // SdcList struct for sdc info response mapping to terrafrom 42 | type SdcList struct { 43 | SdcID types.String `tfsdk:"sdc_id"` 44 | LimitIops types.Int64 `tfsdk:"limit_iops"` 45 | LimitBwInMbps types.Int64 `tfsdk:"limit_bw_in_mbps"` 46 | SdcName types.String `tfsdk:"sdc_name"` 47 | AccessMode types.String `tfsdk:"access_mode"` 48 | } 49 | -------------------------------------------------------------------------------- /powerflex/helper/custom_csv_writer.go: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | package helper 19 | 20 | import ( 21 | "bufio" 22 | "io" 23 | "strings" 24 | ) 25 | 26 | // CustomCSVWriter desfines the srtuct for the CSV Writer 27 | type CustomCSVWriter struct { 28 | writer io.Writer 29 | buf *bufio.Writer 30 | } 31 | 32 | // NewCustomCSVWriter function for the Custom CSV Writer 33 | func NewCustomCSVWriter(w io.Writer) *CustomCSVWriter { 34 | return &CustomCSVWriter{ 35 | writer: w, 36 | buf: bufio.NewWriter(w), 37 | } 38 | } 39 | 40 | // Write function allows the CustomCSVWriter to write CSV records to a specified writer (e.g., file, buffer) one row at a time. 41 | // The function takes care of concatenating the record's values and adding new lines between rows while handling any potential errors that might occur during the write process 42 | func (cw *CustomCSVWriter) Write(record []string) error { 43 | // Adding Checkmarx ignore, because this is working as intended and it is reporting a false postive low sev issue 44 | // Checkmarx: ignore 45 | _, err := cw.writer.Write([]byte(strings.Join(record, ","))) 46 | if err != nil { 47 | return err 48 | } 49 | _, err = cw.writer.Write([]byte("\n")) 50 | return err 51 | } 52 | 53 | // Flush flushes any buffered data to the underlying writer 54 | func (cw *CustomCSVWriter) Flush() error { 55 | return cw.buf.Flush() 56 | } 57 | -------------------------------------------------------------------------------- /examples/resources/powerflex_resource_credential/input.tfvars: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 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 | ## Required fields for all credential type 19 | username = "example-username" 20 | password = "example-password" 21 | name = "example-resource-credential-name" 22 | type = "Node" // Options: Node, Switch, vCenter, ElementManager, PowerflexGateway, PresentationServer, OSAdmin, OSUser 23 | 24 | ## Required value for vCenter, ElementManager, OSUser 25 | #domain = "1.1.1.1" 26 | 27 | ## Required value for PowerflexGateway 28 | #os_username = "example_os_username" 29 | #os_password = "example_os_password" 30 | 31 | ## Optional for Node, Switch, ElementManager 32 | #snmpv2_community_string = "public-test" 33 | 34 | ## Optional for Node 35 | #snmpv3_security_name = "example-security_name" 36 | #snmpv3_security_level = "Moderate" // Options "Minimal", "Moderate", or "Maximal" 37 | #snmpv3_md5_auth_password = "example_md5_auth" // required for level "Moderate" and "Maximal" 38 | #snmpv3_des_private_password = "example_des_private_password" // required for level "Maximal" 39 | 40 | ## Optional for Node, Switch, OSAdmin, OSUser 41 | #ssh_private_key_path = "../../../../terraform-demos/resource-cred-test.pem" // Note: if either of these values are set they both need to be set 42 | #key_pair_name = "example_key_pair_name" // Note: if either of these values are set they both need to be set 43 | -------------------------------------------------------------------------------- /powerflex/models/fault_set.go: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // FaultSetResourceModel defines struct fault set resource 25 | type FaultSetResourceModel struct { 26 | ID types.String `tfsdk:"id"` 27 | ProtectionDomainID types.String `tfsdk:"protection_domain_id"` 28 | Name types.String `tfsdk:"name"` 29 | } 30 | 31 | // FaultSetDataSourceModel maps the struct to FaultSet data source schema 32 | type FaultSetDataSourceModel struct { 33 | FaultSetFilter *FaultSetFilter `tfsdk:"filter"` 34 | FaultSetDetails []FaultSet `tfsdk:"fault_set_details"` 35 | ID types.String `tfsdk:"id"` 36 | } 37 | 38 | // FaultSetFilter defines the filter for fault set 39 | type FaultSetFilter struct { 40 | ProtectionDomainID []types.String `tfsdk:"protection_domain_id"` 41 | Name []types.String `tfsdk:"name"` 42 | ID []types.String `tfsdk:"id"` 43 | } 44 | 45 | // FaultSet maps the struct to FaultSet schema 46 | type FaultSet struct { 47 | ProtectionDomainID string `tfsdk:"protection_domain_id"` 48 | Name string `tfsdk:"name"` 49 | ID string `tfsdk:"id"` 50 | Links []*LinkModel `tfsdk:"links"` 51 | SdsDetails []SdsDataModel `tfsdk:"sds_details"` 52 | } 53 | -------------------------------------------------------------------------------- /examples/resources/powerflex_replication_consistency_group_action/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 | terraform { 19 | required_providers { 20 | powerflex = { 21 | source = "registry.terraform.io/dell/powerflex" 22 | } 23 | } 24 | } 25 | 26 | provider "powerflex" { 27 | username = var.username 28 | password = var.password 29 | endpoint = var.endpoint 30 | insecure = true 31 | timeout = 120 32 | } 33 | 34 | // Resource to manage lifecycle 35 | resource "terraform_data" "always_run" { 36 | input = timestamp() 37 | } 38 | 39 | data "powerflex_replication_consistency_group" "rcg_filter" { 40 | filter { 41 | name = [var.replication_consistency_group_name] 42 | } 43 | } 44 | 45 | resource "powerflex_replication_consistency_group_action" "example" { 46 | # Required 47 | 48 | # Id of the replication consistency group 49 | id = data.powerflex_replication_consistency_group.rcg_filter.replication_consistency_group_details[0].id 50 | 51 | # Action to be performed on the replication consistency group. 52 | # Options are Failover, Restore, Sync, Reverse, Switchover and Snapshot (Default is Sync) 53 | action = var.action 54 | 55 | // This will allow terraform create process to trigger each time we run terraform apply. 56 | lifecycle { 57 | replace_triggered_by = [ 58 | terraform_data.always_run 59 | ] 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /examples/data-sources/powerflex_fault_set/data-source.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | # commands to run this tf file : terraform init && terraform apply --auto-approve 19 | 20 | # Get all fault set details present on the cluster 21 | data "powerflex_fault_set" "all" { 22 | } 23 | 24 | output "fault_set_result_all" { 25 | value = data.powerflex_fault_set.all.fault_set_details 26 | } 27 | 28 | # if a filter is of type string it has the ability to allow regular expressions 29 | # data "powerflex_fault_set" "fault_set_filter_regex" { 30 | # filter{ 31 | # name = ["^System_.*$"] 32 | # id = ["^.*0f$"] 33 | # } 34 | # } 35 | 36 | # output "faultSetFilterRegexResult"{ 37 | # value = data.powerflex_fault_set.fault_set_filter_regex.fault_set_details 38 | # } 39 | 40 | // If multiple filter fields are provided then it will show the intersection of all of those fields. 41 | // If there is no intersection between the filters then an empty datasource will be returned 42 | // For more information about how we do our datasource filtering check out our guides: https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/product_guide/examples/ 43 | data "powerflex_fault_set" "filtered" { 44 | filter { 45 | # protection_domain_id = ["protection_domain_id", "protection_domain_id2"] 46 | # name = ["name", "name2"] 47 | # id = ["id", "id2"] 48 | } 49 | } 50 | 51 | output "fault_set_result_filtered" { 52 | value = data.powerflex_fault_set.filtered.fault_set_details 53 | } 54 | -------------------------------------------------------------------------------- /templates/resources/mdm_cluster.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Cluster and System" 21 | description: |- 22 | {{ .Description | plainmarkdown | trimspace | prefixlines " " }} 23 | --- 24 | 25 | # {{.Name }} ({{.Type}}) 26 | 27 | {{ .Description | trimspace }} 28 | 29 | > **Caution:** MDM cluster creation or update is not atomic. In case of partially completed create operations, terraform can mark the resource as tainted. 30 | One can manually remove the taint and try applying the configuration (after making necessary adjustments). 31 | If the taint is not removed, terraform will destroy and recreate the resource. 32 | 33 | > **Note:** Use of MDM cluster resource requires the presence of the MDM cluster. The purpose of this resource is to update MDM cluster, not create or delete. Import operation is not supported for MDM cluster. 34 | 35 | {{ if .HasExample -}} 36 | ## Example Usage 37 | 38 | {{tffile .ExampleFile }} 39 | {{- end }} 40 | 41 | After the execution of the above resource block, the MDM cluster would become a 3-node cluster. For more information, please check the state file. 42 | 43 | {{ .SchemaMarkdown | trimspace }} 44 | 45 | {{ if .HasImport -}} 46 | ## Import 47 | 48 | Import is supported using the following syntax: 49 | 50 | {{codefile "shell" .ImportFile }} 51 | 52 | {{- end }} -------------------------------------------------------------------------------- /examples/resources/powerflex_volume/resource.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | # Command to run this tf file : terraform init && terraform plan && terraform apply 19 | # Create, Update, Delete is supported for this resource 20 | # To import , check import.sh for more info 21 | # name, size is the required parameter to create or update 22 | # other atrributes like : capacity_unit, volume_type, use_rm_cache, compression_method, access_mode, remove_mode are optional 23 | # To check which attributes of the volume can be updated, please refer Product Guide in the documentation 24 | 25 | # Example for creating volume. After successful execution, volume will be created with 8 GB size. 26 | resource "powerflex_volume" "avengers-volume-create" { 27 | name = "avengers-volume-create" 28 | 29 | # To create / update, either protection_domain_id or protection_domain_name must be provided 30 | protection_domain_name = "domain1" 31 | 32 | # To create / update, either storage_pool_id or storage_pool_name must be provided 33 | storage_pool_name = "pool1" 34 | 35 | # The unit of size of the volume is defined by capacity_unit whose default value is "GB". 36 | size = 8 37 | capacity_unit = "GB" # GB/TB 38 | 39 | use_rm_cache = true 40 | volume_type = "ThickProvisioned" # ThickProvisioned/ThinProvisioned volume type 41 | access_mode = "ReadWrite" # ReadWrite/ReadOnly volume access mode 42 | remove_mode = "INCLUDING_DESCENDANTS" # INCLUDING_DESCENDANTS/ONLY_ME remove mode 43 | } -------------------------------------------------------------------------------- /powerflex/models/mdm_cluster.go: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | package models 19 | 20 | import ( 21 | "github.com/hashicorp/terraform-plugin-framework/types" 22 | ) 23 | 24 | // MdmResourceModel defines the struct for MDM resource 25 | type MdmResourceModel struct { 26 | ID types.String `tfsdk:"id"` 27 | PerformanceProfile types.String `tfsdk:"performance_profile"` 28 | ClusterMode types.String `tfsdk:"cluster_mode"` 29 | PrimaryMdm Mdm `tfsdk:"primary_mdm"` 30 | SecondaryMdm []Mdm `tfsdk:"secondary_mdm"` 31 | TieBreakerMdm []Mdm `tfsdk:"tiebreaker_mdm"` 32 | StandByMdm types.List `tfsdk:"standby_mdm"` 33 | } 34 | 35 | // Mdm defines the struct for Primary, Secondary and TB MDM 36 | type Mdm struct { 37 | ID types.String `tfsdk:"id"` 38 | Name types.String `tfsdk:"name"` 39 | Port types.Int64 `tfsdk:"port"` 40 | Ips types.Set `tfsdk:"ips"` 41 | ManagementIps types.Set `tfsdk:"management_ips"` 42 | } 43 | 44 | // StandByMdm defines the struct for StandBy MDM 45 | type StandByMdm struct { 46 | ID types.String `tfsdk:"id"` 47 | Name types.String `tfsdk:"name"` 48 | Port types.Int64 `tfsdk:"port"` 49 | Ips types.Set `tfsdk:"ips"` 50 | ManagementIps types.Set `tfsdk:"management_ips"` 51 | Role types.String `tfsdk:"role"` 52 | AllowAsymmetricIps types.Bool `tfsdk:"allow_asymmetric_ips"` 53 | } 54 | -------------------------------------------------------------------------------- /examples/data-sources/powerflex_vtree/data-source.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | # commands to run this tf file : terraform init && terraform apply --auto-approve 19 | 20 | # Get all VTrees details present on the cluster 21 | data "powerflex_vtree" "all" { 22 | } 23 | 24 | output "powerflex_vtree_all_result" { 25 | value = data.powerflex_vtree.all.vtree_details 26 | } 27 | 28 | # if a filter is of type string it has the ability to allow regular expressions 29 | # data "powerflex_vtree" "vtree_filter_regex" { 30 | # filter{ 31 | # name = ["^System_.*$"] 32 | # data_layout = ["^.*Granularity$"] 33 | # } 34 | # } 35 | 36 | # output "vtreeFilterRegexResult"{ 37 | # value = data.powerflex_vtree.vtree_filter_regex.vtree_details 38 | # } 39 | 40 | 41 | # Get Peer System details using filter with all values 42 | # If there is no intersection between the filters then an empty datasource will be returned 43 | # For more information about how we do our datasource filtering check out our guides: https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/product_guide/examples 44 | data "powerflex_vtree" "filtered" { 45 | filter { 46 | # storage_pool_id = ["storage_pool_id", "storage_pool_id2"] 47 | # data_layout = ["data_layout", "data_layout2"] 48 | # compression_method = ["compression_method", "compression_method2"] 49 | # in_deletion = false 50 | # name = ["name", "name2"] 51 | # id = ["id", "id2"] 52 | } 53 | } 54 | 55 | output "powerflex_vtree_filtered_result" { 56 | value = data.powerflex_vtree.filtered.vtree_details 57 | } -------------------------------------------------------------------------------- /powerflex/helper/fault_set_helper.go: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | package helper 19 | 20 | import ( 21 | "terraform-provider-powerflex/powerflex/models" 22 | 23 | "github.com/dell/goscaleio" 24 | scaleiotypes "github.com/dell/goscaleio/types/v1" 25 | "github.com/hashicorp/terraform-plugin-framework/types" 26 | ) 27 | 28 | // UpdateFaultSetState updates the State for Fault set Resource 29 | func UpdateFaultSetState(faultset *scaleiotypes.FaultSet, plan models.FaultSetResourceModel) models.FaultSetResourceModel { 30 | state := plan 31 | state.ProtectionDomainID = types.StringValue(faultset.ProtectionDomainID) 32 | state.ID = types.StringValue(faultset.ID) 33 | state.Name = types.StringValue(faultset.Name) 34 | return state 35 | } 36 | 37 | // GetAllFaultSets returns all the fault sets 38 | func GetAllFaultSets(system *goscaleio.System) ([]scaleiotypes.FaultSet, error) { 39 | return system.GetAllFaultSets() 40 | } 41 | 42 | // GetAllFaultSetState returns the state for fault set data source 43 | func GetAllFaultSetState(faultSet scaleiotypes.FaultSet, sdsDetails []models.SdsDataModel) (response models.FaultSet) { 44 | response = models.FaultSet{ 45 | ID: faultSet.ID, 46 | Name: faultSet.Name, 47 | ProtectionDomainID: faultSet.ProtectionDomainID, 48 | } 49 | 50 | for _, link := range faultSet.Links { 51 | response.Links = append(response.Links, &models.LinkModel{ 52 | Rel: types.StringValue(link.Rel), 53 | HREF: types.StringValue(link.HREF), 54 | }) 55 | } 56 | response.SdsDetails = sdsDetails 57 | return 58 | } 59 | -------------------------------------------------------------------------------- /templates/resources/user.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "User Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, new user would have been created on the PowerFlex array. For more information, please check the terraform state file. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | {{ if .HasImport -}} 40 | ## Import 41 | 42 | Import is supported using the following syntax: 43 | 44 | {{codefile "shell" .ImportFile }} 45 | 46 | 1. This will import the User instance with specified ID into your Terraform state. 47 | 2. After successful import, you can run terraform state list to ensure the resource has been imported successfully. 48 | 3. Now, you can fill in the resource block with the appropriate arguments and settings that match the imported resource's real-world configuration. 49 | 4. Execute terraform plan to see if your configuration and the imported resource are in sync. Make adjustments if needed. 50 | 5. Finally, execute terraform apply to bring the resource fully under Terraform's management. 51 | 6. Now, the resource which was not part of terraform became part of Terraform managed infrastructure. 52 | {{- end }} -------------------------------------------------------------------------------- /templates/resources/fault_set.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Storage Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, fault set would have been created on the PowerFlex array. For more information, please check the terraform state file. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | {{ if .HasImport -}} 40 | ## Import 41 | 42 | Import is supported using the following syntax: 43 | 44 | {{codefile "shell" .ImportFile }} 45 | 46 | 1. This will import the fault set instance with specified ID into your Terraform state. 47 | 2. After successful import, you can run terraform state list to ensure the resource has been imported successfully. 48 | 3. Now, you can fill in the resource block with the appropriate arguments and settings that match the imported resource's real-world configuration. 49 | 4. Execute terraform plan to see if your configuration and the imported resource are in sync. Make adjustments if needed. 50 | 5. Finally, execute terraform apply to bring the resource fully under Terraform's management. 51 | 6. Now, the resource which was not part of terraform became part of Terraform managed infrastructure. 52 | 53 | {{- end }} -------------------------------------------------------------------------------- /examples/resources/powerflex_replication_pair/import.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 | provider "powerflex" { 19 | username = var.username_destination 20 | password = var.password_destination 21 | endpoint = var.endpoint_destination 22 | insecure = true 23 | timeout = 120 24 | } 25 | 26 | // Get all of the existing replication pairs 27 | data "powerflex_replication_pair" "all_current_replication_pairs" { 28 | } 29 | 30 | // Import all of the replication pairs 31 | import { 32 | for_each = data.powerflex_replication_pair.all_current_replication_pairs.replication_pair_details 33 | to = powerflex_replication_pair.imported_replication_pairs[each.key] 34 | id = each.value.id 35 | } 36 | 37 | // Add them to the terraform state 38 | resource "powerflex_replication_pair" "imported_replication_pairs" { 39 | count = length(data.powerflex_replication_pair.all_current_replication_pairs.replication_pair_details) 40 | name = data.powerflex_replication_pair.all_current_replication_pairs.replication_pair_details[count.index].name 41 | source_volume_id = data.powerflex_replication_pair.all_current_replication_pairs.replication_pair_details[count.index].local_volume_id 42 | destination_volume_id = data.powerflex_replication_pair.all_current_replication_pairs.replication_pair_details[count.index].remote_volume_id 43 | replication_consistency_group_id = data.powerflex_replication_pair.all_current_replication_pairs.replication_pair_details[count.index].replication_consistency_group_id 44 | } -------------------------------------------------------------------------------- /examples/data-sources/powerflex_nvme_host/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 | # commands to run this tf file : terraform init && terraform apply --auto-approve 19 | 20 | # Get all NVMe host details present on the cluster 21 | data "powerflex_nvme_host" "example1" { 22 | } 23 | 24 | 25 | # if a filter is of type string it has the ability to allow regular expressions 26 | # data "powerflex_nvme_host" "nvme_host_filter_regex" { 27 | # filter{ 28 | # name = ["^System_.*$"] 29 | # system_id = ["^.*0f$"] 30 | # } 31 | # } 32 | 33 | # output "nvmeHostFilterRegexResult"{ 34 | # value = data.powerflex_nvme_host.nvme_host_filter_regex.nvme_host_details 35 | # } 36 | 37 | // If multiple filter fields are provided then it will show the intersection of all of those fields. 38 | // If there is no intersection between the filters then an empty datasource will be returned 39 | // For more information about how we do our datasource filtering check out our guides: https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/product_guide/examples/ 40 | // Please note that NVMe over TCP is supported in PowerFlex 4.0 and later versions, therefore this datasource is not supported in PowerFlex 3.x. 41 | 42 | data "powerflex_nvme_host" "example2" { 43 | filter { 44 | name = ["name1", "name2"] 45 | # id = ["ID1", "ID2"] 46 | # nqn = ["NQN1", "NQN2"] 47 | # max_num_paths = [2] 48 | # max_num_sys_ports = [10] 49 | # system_id = ["systemID"] 50 | } 51 | } 52 | 53 | output "nvme_host_result" { 54 | value = data.powerflex_nvme_host.example1.nvme_host_details 55 | } 56 | -------------------------------------------------------------------------------- /examples/resources/powerflex_sdc_host/resource_windows.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 | # Command to run this tf file : terraform init && terraform plan && terraform apply. 19 | # Create, Update, Read, Delete and Import operations are supported for this resource. 20 | # sdc_details is the required parameter for the SDC resource. 21 | 22 | # Example for adding an Windows host as SDC. 23 | # In this example, we are using passwordless ssh authentication using private key and host key. 24 | 25 | 26 | # Example for adding an Windows host as SDC. 27 | resource "powerflex_sdc_host" "sdc_windows" { 28 | ip = "10.10.10.10" 29 | remote = { 30 | user = "username" 31 | password = "password" 32 | port = 5985 33 | } 34 | os_family = "windows" 35 | name = "sdc-windows" 36 | package_path = "/root/terraform-provider-powerflex/EMC-ScaleIO-sdc-3.6-200.105.msi" 37 | # Optional all the mdms(either primary,secondary or virtual ips) in a comma separated list by cluster if unset will use the mdms of the cluster set in the provider block 38 | # Removal of mdms is not supported for windows, if you wish to remove a cluster from the sdc please follow steps here: https://www.dell.com/support/kbdoc/en-us/000167031/how-do-i-remove-the-mdm-entry-from-the-sdc-as-displayed-in-the-output-of-drv-cfg-binary-in-query-mdms-on-the-sdc-on-windows-or-linux-os#:~:text=Resolution%201%20For%20Linux%20SDC%20host%2C%20open%20%2Fbin%2Femc%2Fscaleio%2Fdrv_cfg.txt,4%20Reboot%20Linux%20SDC%20host%20to%20apply%20changes.?msockid=0ee30a4c8e9f67f610c21ecc8f89664a 39 | # clusters_mdm_ips = ["10.10.10.5,10.10.10.6", "10.10.10.7,10.10.10.8"] 40 | } 41 | -------------------------------------------------------------------------------- /templates/resources/system.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Cluster and System" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, system would have been created on the PowerFlex array. For more information, please check the terraform state file. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | {{ if .HasImport -}} 40 | ## Import 41 | 42 | Import is supported using the following syntax: 43 | 44 | {{codefile "shell" .ImportFile }} 45 | 46 | 1. This will import the system instance with specified ID into your Terraform state. 47 | 2. After successful import, you can run terraform state list to ensure the resource has been imported successfully. 48 | 3. Now, you can fill in the resource block with the appropriate arguments and settings that match the imported resource's real-world configuration. 49 | 4. Execute terraform plan to see if your configuration and the imported resource are in sync. Make adjustments if needed. 50 | 5. Finally, execute terraform apply to bring the resource fully under Terraform's management. 51 | 6. Now, the resource which was not part of terraform became part of Terraform managed infrastructure. 52 | 53 | {{- end }} -------------------------------------------------------------------------------- /templates/resources/replication_pair.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: "Data Protection" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, resource would have been created on the PowerFlex array. For more information, please check the terraform state file. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | {{ if .HasImport -}} 40 | ## Import 41 | 42 | Import is supported using the following syntax: 43 | 44 | {{codefile "shell" .ImportFile }} 45 | 46 | 1. This will import the resource instance with specified ID into your Terraform state. 47 | 2. After successful import, you can run terraform state list to ensure the resource has been imported successfully. 48 | 3. Now, you can fill in the resource block with the appropriate arguments and settings that match the imported resource's real-world configuration. 49 | 4. Execute terraform plan to see if your configuration and the imported resource are in sync. Make adjustments if needed. 50 | 5. Finally, execute terraform apply to bring the resource fully under Terraform's management. 51 | 6. Now, the resource which was not part of terraform became part of Terraform managed infrastructure. 52 | {{- end }} 53 | -------------------------------------------------------------------------------- /examples/resources/powerflex_peer_system/import.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 | terraform { 19 | required_providers { 20 | powerflex = { 21 | source = "registry.terraform.io/dell/powerflex" 22 | } 23 | } 24 | } 25 | 26 | provider "powerflex" { 27 | username = var.username_destination 28 | password = var.password_destination 29 | endpoint = var.endpoint_destination 30 | insecure = true 31 | timeout = 120 32 | } 33 | 34 | // Get all of the existing peer systems 35 | data "powerflex_peer_system" "all_current_peer_systems" { 36 | } 37 | 38 | // Import all of the peers 39 | import { 40 | for_each = data.powerflex_peer_system.all_current_peer_systems.peer_system_details 41 | to = powerflex_peer_system.imported_peer_systems[each.key] 42 | id = each.value.id 43 | } 44 | 45 | // Add them to the terraform state 46 | resource "powerflex_peer_system" "imported_peer_systems" { 47 | count = length(data.powerflex_peer_system.all_current_peer_systems.peer_system_details) 48 | name = data.powerflex_peer_system.all_current_peer_systems.peer_system_details[count.index].name 49 | peer_system_id = data.powerflex_peer_system.all_current_peer_systems.peer_system_details[count.index].peer_system_id 50 | ip_list = [ 51 | data.powerflex_peer_system.all_current_peer_systems.peer_system_details[count.index].ip_list[0].ip, 52 | data.powerflex_peer_system.all_current_peer_systems.peer_system_details[count.index].ip_list[1].ip, 53 | data.powerflex_peer_system.all_current_peer_systems.peer_system_details[count.index].ip_list[2].ip, 54 | ] 55 | } 56 | 57 | -------------------------------------------------------------------------------- /examples/resources/powerflex_replication_pair/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 | # Source Vars 19 | variable "username_source" { 20 | type = string 21 | description = "Stores the source username of PowerFlex host." 22 | } 23 | 24 | variable "password_source" { 25 | type = string 26 | description = "Stores source the password of PowerFlex host." 27 | } 28 | 29 | variable "endpoint_source" { 30 | type = string 31 | description = "Stores source the endpoint of PowerFlex host. eg: https://10.1.1.1:443, here 443 is port where API requests are getting accepted" 32 | } 33 | 34 | variable "volume_name_source" { 35 | type = string 36 | description = "Stores the source volume name." 37 | } 38 | 39 | variable "replication_consistency_group_name_source" { 40 | type = string 41 | description = "Stores the source replication consistency group name." 42 | } 43 | 44 | # Destination Vars 45 | variable "username_destination" { 46 | type = string 47 | description = "Stores the destination username of PowerFlex host." 48 | } 49 | 50 | variable "password_destination" { 51 | type = string 52 | description = "Stores destination the password of PowerFlex host." 53 | } 54 | 55 | variable "endpoint_destination" { 56 | type = string 57 | description = "Stores destination the endpoint of PowerFlex host. eg: https://10.1.1.1:443, here 443 is port where API requests are getting accepted" 58 | } 59 | 60 | variable "volume_name_destination" { 61 | type = string 62 | description = "Stores the destination volume name." 63 | } 64 | -------------------------------------------------------------------------------- /templates/resources/resource_credential.md.tmpl: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright (c) 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: "Resource Group Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, resource would have been created on the PowerFlex array. For more information, please check the terraform state file. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | {{ if .HasImport -}} 40 | ## Import 41 | 42 | Import is supported using the following syntax: 43 | 44 | {{codefile "shell" .ImportFile }} 45 | 46 | 1. This will import the resource instance with specified ID into your Terraform state. 47 | 2. After successful import, you can run terraform state list to ensure the resource has been imported successfully. 48 | 3. Now, you can fill in the resource block with the appropriate arguments and settings that match the imported resource's real-world configuration. 49 | 4. Execute terraform plan to see if your configuration and the imported resource are in sync. Make adjustments if needed. 50 | 5. Finally, execute terraform apply to bring the resource fully under Terraform's management. 51 | 6. Now, the resource which was not part of terraform became part of Terraform managed infrastructure. 52 | {{- end }} 53 | -------------------------------------------------------------------------------- /templates/resources/snapshot_policy.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Data Protection" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, snapshot_policy would have been created on the PowerFlex array. For more information, please check the terraform state file. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | {{ if .HasImport -}} 40 | ## Import 41 | 42 | Import is supported using the following syntax: 43 | 44 | {{codefile "shell" .ImportFile }} 45 | 46 | 1. This will import the snapshot_policy instance with specified ID into your Terraform state. 47 | 2. After successful import, you can run terraform state list to ensure the resource has been imported successfully. 48 | 3. Now, you can fill in the resource block with the appropriate arguments and settings that match the imported resource's real-world configuration. 49 | 4. Execute terraform plan to see if your configuration and the imported resource are in sync. Make adjustments if needed. 50 | 5. Finally, execute terraform apply to bring the resource fully under Terraform's management. 51 | 6. Now, the resource which was not part of terraform became part of Terraform managed infrastructure. 52 | 53 | {{- end }} -------------------------------------------------------------------------------- /examples/resources/powerflex_sdc_volumes_mapping/resource.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | # Command to run this tf file : terraform init && terraform plan && terraform apply. 19 | # Create, Update, Delete is supported for this resource. 20 | # To import, check import.sh for more info. 21 | # To create/update, either SDC ID or SDC name must be provided. 22 | # volume_list attribute is optional. 23 | # To check which attributes of the sdc_volumes_mappping resource can be updated, please refer Product Guide in the documentation 24 | data "powerflex_sdc" "filtered" { 25 | filter { 26 | name = ["sdc-esxi-sdc-name"] 27 | } 28 | } 29 | 30 | resource "powerflex_sdc_volumes_mapping" "mapping-test" { 31 | # SDC id 32 | id = data.powerflex_sdc.filtered.sdcs[0].id 33 | volume_list = [ 34 | { 35 | # id of the volume which needs to be mapped. 36 | # either volume_id or volume_name can be used. 37 | volume_id = "edb2059700000002" 38 | 39 | # Valid values are 0 or integers greater than 10 40 | limit_iops = 140 41 | 42 | # Default value is 0 43 | limit_bw_in_mbps = 19 44 | 45 | access_mode = "ReadOnly" # ReadOnly/ReadWrite/NoAccess 46 | }, 47 | { 48 | volume_name = "terraform-vol" 49 | access_mode = "ReadWrite" 50 | limit_iops = 120 51 | limit_bw_in_mbps = 25 52 | } 53 | ] 54 | } 55 | 56 | # To unmap all the volumes mapped to SDC, below config can be used. After successful execution, all the volumes mapped to SDC will be unmapped. 57 | 58 | resource "powerflex_sdc_volumes_mapping" "mapping-test" { 59 | id = "e3ce1fb600000001" 60 | volume_list = [] 61 | } 62 | -------------------------------------------------------------------------------- /examples/data-sources/powerflex_peer_system/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 | # commands to run this tf file : terraform init && terraform apply --auto-approve 19 | # This feature is only supported for PowerFlex 4.5 and above. 20 | 21 | # Get all Peer System details present on the cluster 22 | data "powerflex_peer_system" "example1" { 23 | } 24 | 25 | # if a filter is of type string it has the ability to allow regular expressions 26 | # data "powerflex_peer_system" "peer_system_filter_regex" { 27 | # filter{ 28 | # name = ["^System_.*$"] 29 | # perf_profile = ["^.*Performance$"] 30 | # } 31 | # } 32 | 33 | # output "peerSystemFilterRegexResult"{ 34 | # value = data.powerflex_peer_system.peer_system_filter_regex.peer_system_details 35 | # } 36 | 37 | # Get Peer System details using filter with all values 38 | # If there is no intersection between the filters then an empty datasource will be returned 39 | # For more information about how we do our datasource filtering check out our guides: https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/product_guide/examples 40 | # data "powerflex_peer_system" "example2" { 41 | # filter { 42 | # id = ["b27112300000000"] 43 | # coupling_rc = ["SUCCESS"] 44 | # membership_state = ["Joined"] 45 | # name = ["10654"] 46 | # peer_system_id = ["89980fe50ff2243f"] 47 | # perf_profile = ["HighPerformance"] 48 | # network_type = ["External"] 49 | # port = [9091] 50 | # software_version_info = ["R4_6.2134.0"] 51 | # system_id = ["7d2f6023117d93f0"] 52 | # } 53 | # } 54 | 55 | output "peer_system_result" { 56 | value = data.powerflex_peer_system.example1.peer_system_details 57 | } -------------------------------------------------------------------------------- /examples/resources/powerflex_sdc_host/resource_esxi.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 | # Command to run this tf file : terraform init && terraform plan && terraform apply. 19 | # Create, Update, Read, Delete and Import operations are supported for this resource. 20 | # sdc_details is the required parameter for the SDC resource. 21 | 22 | # Example for adding an ESXi host as SDC. 23 | # In this example, we are using passwordless ssh authentication using private key and host key. 24 | 25 | # load the private key 26 | data "local_sensitive_file" "ssh_key" { 27 | filename = "/root/.ssh/esxi_rsa" 28 | } 29 | 30 | # load the host key 31 | data "local_sensitive_file" "host_key" { 32 | filename = "esxi_host_ecdsa_key.pub" 33 | } 34 | 35 | # generate a random guid. This is required only for ESXi hosts. 36 | resource "random_uuid" "sdc_guid" { 37 | } 38 | 39 | resource "powerflex_sdc_host" "sdc" { 40 | ip = "10.10.10.10" 41 | remote = { 42 | user = "root" 43 | # we are not using password auth here, but it can be used as well 44 | # password = "W0uldntUWannaKn0w!" 45 | private_key = data.local_sensitive_file.ssh_key.content_base64 46 | host_key = data.local_sensitive_file.host_key.content_base64 47 | } 48 | os_family = "esxi" 49 | esxi = { 50 | guid = random_uuid.sdc_guid.result 51 | } 52 | name = "sdc-esxi" 53 | package_path = "/root/terraform-provider-powerflex/sdc-3.6.500.106-esx7.x.zip" 54 | # Optional all the mdms(either primary,secondary or virtual ips) in a comma separated list by cluster if unset will use the mdms of the cluster set in the provider block 55 | # clusters_mdm_ips = ["10.10.10.5,10.10.10.6", "10.10.10.7,10.10.10.8"] 56 | } 57 | 58 | -------------------------------------------------------------------------------- /templates/resources/firmware_repository.md.tmpl: -------------------------------------------------------------------------------- 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 | 17 | title: "{{.Name }} {{.Type | lower}}" 18 | linkTitle: "{{.Name }}" 19 | page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" 20 | subcategory: "Firmware and OS Management" 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 | {{tffile .ExampleFile }} 33 | {{- end }} 34 | 35 | After the execution of above resource block, firmware_repository would have been created on the PowerFlex array. For more information, please check the terraform state file. 36 | 37 | {{ .SchemaMarkdown | trimspace }} 38 | 39 | {{ if .HasImport -}} 40 | ## Import 41 | 42 | Import is supported using the following syntax: 43 | 44 | {{codefile "shell" .ImportFile }} 45 | 46 | 1. This will import the firmware_repository instance with specified ID into your Terraform state. 47 | 2. After successful import, you can run terraform state list to ensure the resource has been imported successfully. 48 | 3. Now, you can fill in the resource block with the appropriate arguments and settings that match the imported resource's real-world configuration. 49 | 4. Execute terraform plan to see if your configuration and the imported resource are in sync. Make adjustments if needed. 50 | 5. Finally, execute terraform apply to bring the resource fully under Terraform's management. 51 | 6. Now, the resource which was not part of terraform became part of Terraform managed infrastructure. 52 | 53 | {{- end }} -------------------------------------------------------------------------------- /examples/data-sources/powerflex_resource_credentials/data-source.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 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 | # commands to run this tf file : terraform init && terraform apply 19 | # This feature is only supported for PowerFlex 4.5 and above. 20 | 21 | // Empty filter block will return all the replication pairs 22 | data "powerflex_resource_credential" "rc" {} 23 | output "rpResult" { 24 | value = data.powerflex_resource_credential.rc 25 | } 26 | 27 | // If multiple filter fields are provided then it will show the intersection of all of those fields. 28 | // If there is no intersection between the filters then an empty datasource will be returned 29 | // For more information about how we do our datasource filtering check out our guides: https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/product_guide/examples/ 30 | data "powerflex_resource_credential" "rc_filter" { 31 | filter { 32 | # id = ["id", "id2"] 33 | # label = ["label-1", "label-2"] 34 | # created_by = ["created_by-1", "created_by-2"] 35 | # domain = ["domain-1", "domain-2"] 36 | # type = ["type-1", "type-2"] 37 | # updated_by = ["updated_by-1", "updated_by-2"] 38 | # updated_date = ["updated_date-1", "updated_date-2"] 39 | # username = ["username-1", "username-2"] 40 | } 41 | } 42 | output "rcResultFiltered" { 43 | value = data.powerflex_resource_credential.rc_filter 44 | } 45 | 46 | # if a filter is of type string it has the ability to allow regular expressions 47 | # data "powerflex_resource_credential" "resource_credentialp_filter_regex" { 48 | # filter{ 49 | # label = ["^System_.*$"] 50 | # id = ["^Powerflex.*$"] 51 | # } 52 | # } -------------------------------------------------------------------------------- /examples/data-sources/powerflex_sdc/data-source.tf: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | # commands to run this tf file : terraform init && terraform apply --auto-approve 19 | 20 | data "powerflex_sdc" "all" { 21 | 22 | } 23 | 24 | # Returns all sdcs 25 | output "allsdcresult" { 26 | value = data.powerflex_sdc.all 27 | } 28 | 29 | # if a filter is of type string it has the ability to allow regular expressions 30 | # data "powerflex_sdc" "sdc_filter_regex" { 31 | # filter{ 32 | # name = ["^System_.*$"] 33 | # system_id = ["^.*0f$"] 34 | # } 35 | # } 36 | 37 | # output "sdcFilterRegexResult"{ 38 | # value = data.powerflex_sdc.sdc_filter_regex.sdcs 39 | # } 40 | 41 | // If multiple filter fields are provided then it will show the intersection of all of those fields. 42 | // If there is no intersection between the filters then an empty datasource will be returned 43 | // For more information about how we do our datasource filtering check out our guides: https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/product_guide/examples/ 44 | data "powerflex_sdc" "filtered" { 45 | filter { 46 | # id = ["ID1", "ID2"] 47 | # system_id = ["systemID", "systemID2"] 48 | # sdc_ip = ["SCDIP1", "SCDIP2"] 49 | # sdc_approved = false 50 | # on_vmware = false 51 | # sdc_guid = ["SdcGUID1", "SdcGUID2"] 52 | # mdm_connection_state = ["MdmConnectionState1", "MdmConnectionState2"] 53 | # name = ["Name1", "Name2"] 54 | } 55 | } 56 | 57 | # Returns filtered sdcs matching criteria 58 | output "filteredsdcresult" { 59 | value = data.powerflex_sdc.filtered.sdcs 60 | } 61 | # ----------------------------------------------------------------------------------- 62 | 63 | -------------------------------------------------------------------------------- /examples/resources/powerflex_resource_group/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 | 19 | # Commands to run this tf file : terraform init && terraform plan && terraform apply 20 | # Create, Update, Delete is supported for this resource 21 | # To create / update, either template_id or firmware_id must be provided 22 | # deployment_name and deployment_description are the required parameters to create or update 23 | # other atrributes like : nodes, port, deployment_timeout are optional 24 | # To check which attributes can be updated, please refer Product Guide in the documentation 25 | 26 | 27 | # example 1: Resource Group Resource 28 | resource "powerflex_resource_group" "Data" { 29 | deployment_name = "Test-Create-U1" 30 | deployment_description = "Test Service-U1" 31 | template_id = "453c41eb-d72a-4ed1-ad16-bacdffbdd766" 32 | firmware_id = "8aaaee208c8c467e018cd37813250614" 33 | nodes = 0 34 | clone_from_host = "pfmc-k8s-20230809-160" 35 | deployment_timeout = 0 36 | } 37 | 38 | 39 | # example 2: Get Template ID and Firmware ID from Template Datasource 40 | 41 | data "powerflex_template" "template_data" { 42 | template_names = ["Teample_Name"] 43 | } 44 | 45 | resource "powerflex_resource_group" "Data" { 46 | deployment_name = "Test-Create-U1" 47 | deployment_description = "Test Service-U1" 48 | template_id = tolist(data.powerflex_template.template_data.template_details)[0].id 49 | firmware_id = tolist(data.powerflex_template.template_data.template_details)[0].firmware_id 50 | nodes = 3 51 | clone_from_host = "pfmc-k8s-20230809-160" 52 | deployment_timeout = 60 53 | } 54 | -------------------------------------------------------------------------------- /examples/resources/powerflex_storage_pool/import.tf: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. 3 | Licensed under the Mozilla Public License Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://mozilla.org/MPL/2.0/ 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | //Gather all existing storage pools 15 | data "powerflex_storage_pool" "all" { 16 | } 17 | 18 | //Gather all existing protection domains 19 | data "powerflex_protection_domain" "all"{ 20 | } 21 | 22 | //Import all storage pools 23 | import{ 24 | for_each = data.powerflex_storage_pool.all.storage_pools 25 | to = powerflex_storage_pool.import_test_storage_pool[each.key] 26 | id = each.value.id 27 | } 28 | 29 | //Add them to terraform state 30 | resource "powerflex_storage_pool" "import_test_storage_pool" { 31 | count = length(data.powerflex_storage_pool.all.storage_pools) 32 | name = data.powerflex_storage_pool.all.storage_pools[count.index].name 33 | protection_domain_name = data.powerflex_protection_domain.all.protection_domains[count.index].name 34 | media_type = data.powerflex_storage_pool.all.storage_pools[count.index].media_type 35 | use_rmcache = data.powerflex_storage_pool.all.storage_pools[count.index].use_rm_cache 36 | use_rfcache = data.powerflex_storage_pool.all.storage_pools[count.index].use_rf_cache 37 | zero_padding_enabled = data.powerflex_storage_pool.all.storage_pools[count.index].zero_padding_enabled 38 | rebalance_enabled = data.powerflex_storage_pool.all.storage_pools[count.index].rebalance_enabled 39 | spare_percentage = data.powerflex_storage_pool.all.storage_pools[count.index].spare_percentage 40 | rebuild_enabled = data.powerflex_storage_pool.all.storage_pools[count.index].rebuild_enabled 41 | fragmentation = data.powerflex_storage_pool.all.storage_pools[count.index].fragmentation_enabled 42 | } -------------------------------------------------------------------------------- /about/INSTALLATION.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Installation of Terraform Provider for Dell PowerFlex 19 | 20 | ## Installation from public repository 21 | 22 | The provider will be fetched from the public repository and installed by Terraform automatically. 23 | Create a file called `main.tf` in your workspace with the following contents 24 | 25 | ```tf 26 | terraform { 27 | required_providers { 28 | powerflex = { 29 | version = "1.8.0" 30 | source = "registry.terraform.io/dell/powerflex" 31 | } 32 | } 33 | } 34 | 35 | provider "powerflex" { 36 | username = var.username 37 | password = var.password 38 | endpoint = var.endpoint 39 | insecure = true 40 | timeout = 120 41 | 42 | ## The provider can also be set using environment variables 43 | ## If environment variables are set it will override this configuration 44 | ## Example environment variables 45 | # POWERFLEX_USERNAME="username" 46 | # POWERFLEX_PASSWORD="password" 47 | # POWERFLEX_ENDPOINT="https://yourhost.host.com" 48 | # POWERFLEX_INSECURE="true" 49 | # POWERFLEX_TIMEOUT="120" 50 | } 51 | ``` 52 | Then, in that workspace, run 53 | ``` 54 | terraform init 55 | ``` 56 | 57 | ## Installation from source code 58 | 59 | 1. Clone this repo 60 | 2. In the root of this repo run 61 | ``` 62 | make install 63 | ``` 64 | Then follow [installation from public repo](#installation-from-public-repository) 65 | 66 | ## SSL Certificate Verification 67 | 68 | For SSL verifcation on RHEL, below steps can be performed: 69 | * Copy the CA certificate to the `/etc/pki/ca-trust/source/anchors` path of the host by any external means. 70 | * Import the SSL certificate to host by running 71 | ``` 72 | update-ca-trust extract 73 | ``` 74 | -------------------------------------------------------------------------------- /powerflex/helper/user_helper.go: -------------------------------------------------------------------------------- 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 | */ 17 | 18 | package helper 19 | 20 | import ( 21 | "terraform-provider-powerflex/powerflex/models" 22 | 23 | "github.com/dell/goscaleio" 24 | scaleiotypes "github.com/dell/goscaleio/types/v1" 25 | "github.com/hashicorp/terraform-plugin-framework/types" 26 | ) 27 | 28 | // UpdateUserState is the helper function that marshals API response to UserModel 29 | func UpdateUserState(user *scaleiotypes.User, plan models.UserModel, ssoUser *scaleiotypes.SSOUserDetails) models.UserModel { 30 | state := plan 31 | if user != nil { 32 | state.Name = types.StringValue(user.Name) 33 | state.Role = types.StringValue(user.UserRole) 34 | state.Password = plan.Password 35 | state.ID = types.StringValue(user.ID) 36 | state.SystemID = types.StringValue(user.SystemID) 37 | state.FirstName = types.StringNull() 38 | state.LastName = types.StringNull() 39 | } else { 40 | state.Name = types.StringValue(ssoUser.Username) 41 | state.Role = types.StringValue(ssoUser.Permission.Role) 42 | state.Password = plan.Password 43 | state.ID = types.StringValue(ssoUser.ID) 44 | if ssoUser.FirstName != "" { 45 | state.FirstName = types.StringValue(ssoUser.FirstName) 46 | } else { 47 | state.FirstName = types.StringNull() 48 | } 49 | if ssoUser.LastName != "" { 50 | state.LastName = types.StringValue(ssoUser.LastName) 51 | } else { 52 | state.LastName = types.StringNull() 53 | } 54 | state.SystemID = types.StringNull() 55 | } 56 | 57 | return state 58 | } 59 | 60 | // CreateSsoUser an Sso User 61 | func CreateSsoUser(client *goscaleio.Client, payload *scaleiotypes.SSOUserCreateParam) (*scaleiotypes.SSOUserDetails, error) { 62 | return client.CreateSSOUser(payload) 63 | } 64 | --------------------------------------------------------------------------------