User
User is a data type used to reference users that exist in Port.
Common usage
Use Port User properties to reference people by email address, such as:
- The engineer currently on call.
- The lead maintainer of a service.
- The reviewer assigned to a change.
Display format
Both email and user formats accept an email address, but display it differently:
emailformat displays the raw email string.userformat displays the user's name and avatar from Port's list of known users.
The user format also indicates each user's status:
| User status | Example |
|---|---|
| Active | ![]() |
| Invited | ![]() |
| Unregistered | ![]() |
API definition
You can add user properties using the blueprint JSON editor, the API, Terraform, or Pulumi.
Selecting User in the blueprint UI form creates a relation to the _user blueprint, rather than a user property.
Single or multiple users
Use the Basic definition for a single user or the Array definition for multiple users.
You cannot switch an existing property between a single value and an array. Create a new property and migrate its data before replacing the original.
- Basic
- Array
{
"myUserProp": {
"title": "My user",
"icon": "My icon",
"description": "My user property",
"type": "string",
"format": "user",
"default": "me@example.com"
}
}
{
"myUserArray": {
"title": "My user array",
"icon": "My icon",
"description": "My user array",
"type": "array",
"items": {
"type": "string",
"format": "user"
}
}
}
Check out Port's API reference to learn more.
Terraform definition
The examples below use version 2.29.0 of the Terraform and Pulumi providers. Configure your provider first, then run one example at a time in its own project. Each example creates a blueprint; use distinct identifiers when you combine examples.
- Basic
- Array
resource "port_blueprint" "myBlueprint" {
identifier = "myBlueprint"
title = "My blueprint"
properties = {
string_props = {
myUserProp = {
title = "My user"
required = false
format = "user"
}
}
}
}
resource "port_blueprint" "myBlueprint" {
identifier = "myBlueprint"
title = "My blueprint"
properties = {
array_props = {
"myUserArray" = {
title = "My user array"
required = false
string_items = {
format = "user"
}
}
}
}
}
Pulumi definition
- Basic
- Python
- TypeScript
- JavaScript
- Go
"""A Python Pulumi program"""
import pulumi
from port_pulumi import Blueprint,BlueprintPropertiesStringPropsArgs,BlueprintPropertiesArgs
blueprint = Blueprint(
"myBlueprint",
identifier="myBlueprint",
title="My Blueprint",
properties=BlueprintPropertiesArgs(
string_props={
"myUserProp": BlueprintPropertiesStringPropsArgs(
title="My user",
required=False,
format="user",
)
}
),
relations={}
)
import * as pulumi from "@pulumi/pulumi";
import * as port from "@port-labs/port";
export const blueprint = new port.Blueprint("myBlueprint", {
identifier: "myBlueprint",
title: "My Blueprint",
properties: {
stringProps: {
myUserProp: {
title: "My user",
required: false,
format: "user",
},
},
},
});
"use strict";
const pulumi = require("@pulumi/pulumi");
const port = require("@port-labs/port");
const entity = new port.Blueprint("myBlueprint", {
title: "My Blueprint",
identifier: "myBlueprint",
properties: {
stringProps: {
myUserProp: {
title: "My user",
required: false,
format: "user",
},
},
},
relations: {},
});
exports.title = entity.title;
package main
import (
"github.com/port-labs/pulumi-port/sdk/v2/go/port"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
blueprint, err := port.NewBlueprint(ctx, "myBlueprint", &port.BlueprintArgs{
Identifier: pulumi.String("myBlueprint"),
Title: pulumi.String("My Blueprint"),
Properties: port.BlueprintPropertiesArgs{
StringProps: port.BlueprintPropertiesStringPropsMap{
"myUserProp": port.BlueprintPropertiesStringPropsArgs{
Title: pulumi.String("My user"),
Required: pulumi.Bool(false),
Format: pulumi.String("user"),
},
},
},
})
if err != nil {
return err
}
ctx.Export("blueprint", blueprint.Title)
return nil
})
}


