Skip to content

Latest commit

 

History

History
139 lines (106 loc) · 6.05 KB

synciq_peer_certificate.md

File metadata and controls

139 lines (106 loc) · 6.05 KB
title linkTitle page_title subcategory description
powerscale_synciq_peer_certificate data source
powerscale_synciq_peer_certificate
powerscale_synciq_peer_certificate Data Source - terraform-provider-powerscale
This datasource is used to query the existing SyncIQ Peer Certificates from PowerScale array. The information fetched from this datasource can be used for getting the details or for further processing in resource block.

powerscale_synciq_peer_certificate (Data Source)

This datasource is used to query the existing SyncIQ Peer Certificates from PowerScale array. The information fetched from this datasource can be used for getting the details or for further processing in resource block.

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.
*/

# PowerScale SyncIQ Certificate allows you to get a list of SyncIQ Peer Certificates or a peer certificate by its ID.

# Returns a list of PowerScale SyncIQ Certificates
data "powerscale_synciq_peer_certificate" "all_certificates" {
}

# Returns a the PowerScale SyncIQ Certificate with given ID
data "powerscale_synciq_peer_certificate" "one_certificate" {
  id = "g23j9a1f83h12n5j4"
}

# Returns the PowerScale SyncIQ Certificate with given name
data "powerscale_synciq_peer_certificate" "one_certificate_by_name" {
  filter {
    name = "tfaccTest"
  }
}

# Output value of above block by executing 'terraform output' command.
# The user can use the fetched information by the variable data.powerscale_synciq_peer_certificate.all_certificates.certificates
output "powerscale_synciq_all_certificates" {
  value = data.powerscale_synciq_peer_certificate.all_certificates.certificates
}

# The user can use the fetched certificate by ID by the variable data.powerscale_synciq_peer_certificate.one_certificate.certificates[0]
output "certificateByID" {
  value = data.powerscale_synciq_peer_certificate.one_certificate.certificates[0]
}

# The user can use the fetched certificate by name by the variable data.powerscale_synciq_peer_certificate.one_certificate_by_name.certificates[0]
output "certificateByName" {
  value = data.powerscale_synciq_peer_certificate.one_certificate_by_name.certificates[0]
}

# Get syncIQ certificate by status
# Step 1: We shall use the datasource to get all the certificates as shown above
# Step 2: We index them by status
output "certificatesByStatus" {
  value = {
    "valid"    = [for certificate in data.powerscale_synciq_peer_certificate.all_certificates.certificates : certificate if certificate.status == "valid"]
    "invalid"  = [for certificate in data.powerscale_synciq_peer_certificate.all_certificates.certificates : certificate if certificate.status == "invalid"]
    "expired"  = [for certificate in data.powerscale_synciq_peer_certificate.all_certificates.certificates : certificate if certificate.status == "expired"]
    "expiring" = [for certificate in data.powerscale_synciq_peer_certificate.all_certificates.certificates : certificate if certificate.status == "expiring"]
  }
}

# After the successful execution of above said block, We can see the output value by executing 'terraform output' command.

Schema

Optional

  • filter (Block, Optional) Filters for fetching SyncIQ Peer Certificate. (see below for nested schema)
  • id (String) ID of the SyncIQ Peer Certificate to be fetched. If not provided, all the certificates will be fetched.

Read-Only

Nested Schema for filter

Optional:

  • name (String) Name of the SyncIQ Peer Certificate to be fetched.

Nested Schema for certificates

Read-Only:

  • description (String) Description field associated with a certificate provided for administrative convenience.
  • fingerprints (Attributes List) A list of zero or more certificate fingerprints which can be used for certificate identification. (see below for nested schema)
  • id (String) Unique server certificate identifier.
  • issuer (String) Certificate issuer field extracted from the certificate.
  • name (String) Administrator specified name identifier.
  • not_after (Number) Certificate notAfter field extracted from the certificate encoded as a UNIX epoch timestamp. The certificate is not valid after this timestamp.
  • not_before (Number) Certificate notBefore field extracted from the certificate encoded as a UNIX epoch timestamp. The certificate is not valid before this timestamp.
  • status (String) Certificate validity status
  • subject (String) Certificate subject field extracted from the certificate.

Nested Schema for certificates.fingerprints

Read-Only:

  • type (String) Fingerprint hash algorithm
  • value (String) Fingerprint value