powerflex_service (Resource)

This resource is used to manage the Service entity of PowerFlex Array. We can Create, Update and Delete the PowerFlex Service using this resource. We can also Import an existing Service from PowerFlex array.

Example Usage

/*
Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.

Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://mozilla.org/MPL/2.0/


Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


# Commands to run this tf file : terraform init && terraform plan && terraform apply
# Create, Update, Delete is supported for this resource
# To create / update, either template_id or firmware_id must be provided
# deployment_name and deployment_description are the required parameters to create or update
# other  atrributes like : nodes, port, deployment_timeout are optional 
# To check which attributes can be updated, please refer Product Guide in the documentation


# example 1: Service Resource
resource "powerflex_service" "service" {
  deployment_name        = "Test-Create-U1"
  deployment_description = "Test Service-U1"
  template_id            = "453c41eb-d72a-4ed1-ad16-bacdffbdd766"
  firmware_id            = "8aaaee208c8c467e018cd37813250614"
  nodes                  = 0
  clone_from_host        = "pfmc-k8s-20230809-160"
  deployment_timeout     = 0
}


# example 2: Get Template ID and Firmware ID from Template Datasource

data "powerflex_template" "template_data" {
  template_names = ["Teample_Name"]
}

resource "powerflex_service" "service" {
  deployment_name        = "Test-Create-U1"
  deployment_description = "Test Service-U1"
  template_id            = tolist(data.powerflex_template.template_data.template_details)[0].id
  firmware_id            = tolist(data.powerflex_template.template_data.template_details)[0].firmware_id
  nodes                  = 3
  clone_from_host        = "pfmc-k8s-20230809-160"
  deployment_timeout     = 60
}

After the execution of above resource block, service would have been deployed on the PowerFlex Gateway. For more information, please check the terraform state file.

Schema

Required

  • deployment_description (String) Deployment Description
  • deployment_name (String) Deployment Name
  • firmware_id (String) Firmware ID
  • template_id (String) Published Template ID

Optional

  • clone_from_host (String) Resource to Duplicate From Host
  • deployment_timeout (Number) Deployment Timeout, It should be in multiples of 5
  • nodes (Number) Number of Nodes
  • servers_in_inventory (String) After Delete the Service, Servers in inventory Keep or Remove. Default value is Keep
  • servers_managed_state (String) After Delete the Service, Servers’s state Managed or Unmanaged. Default value is Unmanaged.

Read-Only

  • compliant (Boolean) Deployment Compliant Status
  • id (String) Deployment ID
  • status (String) Deployment Status
  • template_name (String) Service Template Name

Import

Import is supported using the following syntax:

# /*
# Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved.
# Licensed under the Mozilla Public License Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#     http://mozilla.org/MPL/2.0/
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# */

# import Service by it's id
terraform import powerflex_service.service_data "<id>"