Skip to content

Latest commit

 

History

History
139 lines (104 loc) · 5.08 KB

synciq_peer_certificate.md

File metadata and controls

139 lines (104 loc) · 5.08 KB
title linkTitle page_title subcategory description
powerscale_synciq_peer_certificate resource
powerscale_synciq_peer_certificate
powerscale_synciq_peer_certificate Resource - terraform-provider-powerscale
This resource is used to manage the SyncIQ Peer Certificate entity of PowerScale Array. We can Create, Read, Update and Delete the SyncIQ Peer Certificate using this resource. We can also import existing SyncIQ Peer Certificate from PowerScale array.

powerscale_synciq_peer_certificate (Resource)

This resource is used to manage the SyncIQ Peer Certificate entity of PowerScale Array. We can Create, Read, Update and Delete the SyncIQ Peer Certificate using this resource. We can also import existing SyncIQ Peer Certificate from PowerScale 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.
*/


# Available actions: Create, Read, Update, Delete and Import.

# Step 1: Upload a certificate to the PowerScale filesystem.
# This can be done using the file provisioner.
resource "terraform_data" "cert" {
  provisioner "file" {
    source      = "/root/certs/pscale.crt" # certificate that user has been given
    destination = "/ifs/peerCert1.crt"
  }

  connection {
    type     = "ssh"
    user     = var.username
    password = var.password
    host     = var.powerscaleIP
    port     = var.PowerscaleSSHPort
  }

  provisioner "remote-exec" {
    when   = destroy
    inline = ["rm -f /ifs/peerCert1.crt"]
  }
}

# PowerScale Sync IQ Peer Certificates can be used to establish trust to the peer/target cluster where files are to be replicated to. 
resource "powerscale_synciq_peer_certificate" "certificate" {
  depends_on = [terraform_data.cert]
  // required
  // Cannot be updated
  // If the value of this resource is changed, Terraform will destroy this resource and recreate it.
  path = "/ifs/peerCert1.crt"
  // optional
  name         = "cert1"
  descriptuion = "cert1"
}

# After the execution of above resource block, Sync IQ Certificate would have been cached in terraform state file, or
# Sync IQ Certificate would have been created on PowerScale.
# For more information, Please check the terraform state file.

Schema

Required

  • path (String) Local path (on the PowerScale filesystem) to the certificate that is to be imported. This resource will be recreated if the value of this field is changed.

Optional

  • description (String) Description field associated with a certificate provided for administrative convenience.
  • name (String) Administrator specified name identifier.

Read-Only

  • id (String) ID of the SyncIQ Peer certificate.

Unless specified otherwise, all fields of this resource can be updated.

Import

Import is supported using the following syntax:

# 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.

# A Peer Certificate can be imported by its name

# The command to import is
# terraform import powerscale_synciq_peer_certificate.certificate <certificate name>
# Example:
terraform import powerscale_synciq_peer_certificate.certificate2 "peer_certificate_01"

# after running any of these commands, populate the path field with the value "/dummy" to start managing this resource. Add other fields as required.
# Note: running "terraform show" after importing shows the current config/state of the resource. You can copy/paste that config to make it easier to manage the resource.