terraform-provider-hpcr

command module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

Terraform Provider HPCR

Implementation of a terraform provider to support working with IBM Cloud Hyper Protect Virtual Server for IBM Cloud VPC.

Prerequisite

  • Installation of terraform for your platform
  • OpenSSL binary (not LibreSSL), the path to the binary can be configured via the OPENSSL_BIN environment variable

Usage

The terraform provider exposes a set of resources that help assemble the user_data section for a contract:

hpcr_tgz

Use this resource to create a tgz archive of your docker-compose folder. You can access the base64 encoded content via the rendered property.

resource "hpcr_tgz" "compose" {
  folder = var.FOLDER
}
hpcr_text_encrypted

Use this resource to encrypt a string, per default the implementation uses encryption key of the latest HPCR image.

resource "hpcr_text_encrypted" "workload" {
  text = yamlencode({
    "compose" : {
      "archive" : resource.hpcr_tgz.compose.rendered
    }
  })
}

The typical usecase is to encrypt the workload and the env section separately and to pass in the yml encoded contract as an input.

hpcr_image

Use this datasource to find the matching HPCR stock image.

data "ibm_is_images" "hyper_protect_images" {
  visibility = "public"
  status     = "available"

}

data "hpcr_image" "selected_image" {
  images= jsonencode(data.ibm_is_images.hyper_protect_images.images)
}

This data source accepts a list of available VPC image (e.g. from the VPC is_images datasource). The list needs to be serialized to JSON.

Optionally the datasource takes a spec parameter that can be used as a version constraint.

The result of the lookup can be accessed via the following attributes:

  • image: ID of the selected image
  • version: semantic version string of the selected image (e.g. 1.0.8)

License

Apache 2.0

How to Contribute

The repository uses semantic-release. Please author the commit messages accordingly.

References

Documentation

Overview

Copyright 2022 IBM Corp.

Licensed under the Apache 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://www.apache.org/licenses/LICENSE-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.

Directories

Path Synopsis
fp
samples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL