Terraform Plugin Framework Plan Modifiers and Validators

website·Indexed 29 days ago

https://orange-cloudavenue.github.io/

Documentation for a set of plan modifiers and validators for the Terraform Plugin Framework. Includes tools for setting default values (via functions or environment variables), forcing string casing, and validating attributes such as UUIDs, URNs, IP addresses, MAC addresses, and HTTP status codes across various types including string, int32, and boolean.

Tokens
23.4K
Snippets
103
Records
145
Agent score
75%

What's inside Terraform Plugin Framework

  1. Overview of kube-image-updater (kimup)

    kube-image-updater (also known as kimup) is a Kubernetes operator that automates the updating of container images for Kubernetes resources including Deployments, StatefulSets, DaemonSets, and CronJobs. It uses Custom Resource Definitions (CRDs) to manage update strategies and schedules.

    The system consists of two primary components:

    1. kimup-operator: Reconciles Image, AlertConfig, and Kimup CRDs and manages the MutatingWebhook.
    2. kimup-controller: Responsible for updating the TAG of the Image resource.
  2. Overview of orange-cloudavenue Terraform Framework Validators

    The orange-cloudavenue Terraform Framework Validators library provides a collection of reusable validators designed for the Terraform Plugin Framework. It includes specialized validators for the following data types: String, Bool, Int64, List, Map, Set, and Object.
  3. Overview of Orange cloudavenue

    Orange cloudavenue is an Infrastructure as a Service (IaaS) public cloud offering. The opensource portal provides documentation and resources to get started with the Orange cloudavenue opensource project.
  4. Understand SuperSchema merging logic for resources and data sources

    The superschema.Schema type uses three fields—Common, Resource, and DataSource—to define metadata. The system merges these fields to generate the final documentation:

    • Terraform Resource: Merges Common markdown description with Resource markdown description.
    • Terraform Data Source: Merges Common markdown description with DataSource markdown description.

    Necessary spacing is automatically added during the merge process for both descriptions and deprecation messages.

  5. Define Terraform schemas with SuperSchema

    Terraform SuperSchema is a plugin for the Terraform Plugin Framework that allows developers to write the Terraform schema for both resources and datasources within a single definition.
  6. Use SuperSchema to unify Terraform resource and datasource schemas

    SuperSchema allows developers to define the Terraform schema for both resources and datasources within a single definition. It addresses the 'Don't Repeat Yourself' (DRY) principle by applying common fields to both resources and datasources, enabling the definition of shared default values. Additionally, it integrates with tfplugindocs and automates the formatting of attribute markdown descriptions, including validators, plan modifiers, default values, and deprecation notices.
  7. Validate boolean attributes using BoolValidator

    The boolvalidator package provides validators used to validate the plan of a boolean attribute. These validators are implemented within the Validators field of the schema.BoolAttribute struct in a Terraform provider schema.
    import fboolvalidator "github.com/orange-cloudavenue/terraform-plugin-framework-validators/boolvalidator"
  8. Manage Kubernetes image updates with Kube Image Updater

    Kube Image Updater is a Kubernetes operator featuring a Custom Resource Definition (CRD) that enables the definition of image update strategies and schedules.
  9. Define a basic Image resource with Kimup Operator

    The Image resource is a namespaced custom resource used to store information about a container image and define its update behavior via triggers and rules.
    apiVersion: kimup.cloudavenue.io/v1alpha1
    kind: Image
    metadata:
      name: image-sample
    spec:
      image: alpine
      baseTag: v1.0.0
      triggers:
        - <trigger>
        - <trigger>
      rules:
        - <rule>
        - <rule>