Skip to content

upper (Function)

The upper function takes a string and returns a new string with all alphabetic characters converted to uppercase. It handles null values gracefully by returning null when the input is null, making it safe for use with optional or dynamic string values.

๐Ÿค– AI-Generated Content

This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.

Note

This provider is currently in POC (proof-of-concept) status and under active development. Features and APIs may change without notice. Not intended for production infrastructure.

Case conversion is fundamental for text normalization and comparison operations. Converting text to uppercase ensures consistent formatting for configuration values, environment variables, and case-insensitive matching scenarios.

Capabilities

This function enables you to:

  • Case normalization: Standardize text case for comparisons and consistency
  • Display formatting: Format text for headers or emphasis in outputs
  • Data consistency: Normalize user input or imported data to uppercase
  • Configuration values: Standardize environment or configuration strings
  • Search operations: Normalize text for case-insensitive matching

Example Usage

locals {
  example_result = upper(
    # Function arguments here
  )
}

output "function_result" {
  description = "Result of upper function"
  value       = local.example_result
}

Signature

upper(str)

Arguments

Return Value

Returns a new string with all alphabetic characters converted to uppercase: - Non-alphabetic characters (numbers, symbols, spaces) remain unchanged - Returns null if the input is null - Returns an empty string if the input is an empty string

Common Patterns

Environment Variables

variable "env" {
  type = string
  default = "dev"
}

locals {
  environment_upper = provider::pyvider::upper(var.env)
}

resource "pyvider_file_content" "config" {
  filename = "/tmp/app_config.env"
  content  = "ENVIRONMENT=${local.environment_upper}"
}

Header Formatting

variable "service_name" {
  default = "api gateway"
}

locals {
  service_header = provider::pyvider::upper(var.service_name)  # "API GATEWAY"
}

Documentation version: 0.0.19 | Last updated: 2025-11-09