Email is a data type used to save Email addresses.
๐ก Common email usageโ
The Email property type can be used to store any legal email address.
API definitionโ
- Basic
- Enum
- Array
{
"myEmailProp": {
"title": "My email",
"icon": "My icon",
"description": "My email property",
"type": "string",
"format": "email",
"default": "me@example.com"
}
}
{
"myEmailEnum": {
"title": "My email enum",
"icon": "My icon",
"description": "My email enum",
"type": "string",
"format": "email",
"enum": ["me@example.com", "example@example.com"],
"enumColors": {
"me@example.com": "red",
"example@example.com": "green"
}
}
}
{
"myEmailArray": {
"title": "My email array",
"icon": "My icon",
"description": "My email array",
"type": "array",
"items": {
"type": "string",
"format": "email"
}
}
}
Check out Port's API reference to learn more.
Terraform definitionโ
- Basic
- Enum
- Array
resource "port_blueprint" "myBlueprint" {
# ...blueprint properties
properties = {
string_props = {
"myEmailProp" = {
title = "My email"
icon = "My icon"
description = "My email property"
format = "email"
}
}
}
}
resource "port_blueprint" "myBlueprint" {
# ...blueprint properties
properties = {
identifier = "myEmailProp"
title = "My email"
required = false
type = "string"
format = "email"
enum = ["me@example.com", "example@example.com"]
enum_colors = {
"me@example.com" = "red",
"example@example.com" = "green"
}
}
}
resource "port_blueprint" "myBlueprint" {
# ...blueprint properties
properties = {
array_props = {
myEmailArray = {
title = "My email array"
identifier = "myEmailArray"
type = "array"
string_items = {
format = "email"
}
}
}
}
}
Pulumi definitionโ
- Basic
- Enum
- Array - coming soon
- Python
- TypeScript
- JavaScript
- GO
"""A Python Pulumi program"""
import pulumi
from port_pulumi import Blueprint,BlueprintPropertiesArgs,BlueprintPropertiesStringPropsArgs
blueprint = Blueprint(
"myBlueprint",
identifier="myBlueprint",
title="My Blueprint",
properties=BlueprintPropertiesArgs(
string_props={
"myEmailProp": BlueprintPropertiesStringPropsArgs(
title="My email",
format="email",
)
}
),
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: {
string_props: {
myEmailProp: {
title: "My email",
format: "email",
required: true,
},
},
},
});
"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: {
string_props: {
myEmailProp: {
title: "My email",
format: "email",
required: true,
},
},
},
relations: {},
});
exports.title = entity.title;
package main
import (
"github.com/port-labs/pulumi-port/sdk/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{
"myEmailProp": &port.BlueprintPropertiesStringPropsArgs{
Title: pulumi.String("My email"),
Format: pulumi.String("email"),
Required: pulumi.Bool(true),
},
},
},
})
ctx.Export("blueprint", blueprint.Title)
if err != nil {
return err
}
return nil
})
}
- Python
- TypeScript
- JavaScript
- GO
"""A Python Pulumi program"""
import pulumi
from port_pulumi import Blueprint,BlueprintPropertiesArgs,BlueprintPropertiesStringPropsArgs
blueprint = Blueprint(
"myBlueprint",
identifier="myBlueprint",
title="My Blueprint",
properties=BlueprintPropertiesArgs(
string_props={
"myEmailProp": BlueprintPropertiesStringPropsArgs(
title="My email",
required=True,
format="email",
enums=["me@example.com", "other@example.com"],
enum_colors={
"me@example.com": "red",
"other@example.com": "green",
},
)
}
),
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: {
myEmailProp: {
title: "My email",
required: true,
format: "email",
enums: ["me@example.com", "other@example.com"],
enumColors: {
"me@example.com": "red",
"other@example.com": "green",
},
}
},
});
"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: {
myEmailProp: {
title: "My email",
required: true,
format: "email",
enums: ["me@example.com", "other@example.com"],
enumColors: {
"me@example.com": "red",
"other@example.com": "green",
},
}
},
relations: {},
});
exports.title = entity.title;
package main
import (
"github.com/port-labs/pulumi-port/sdk/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{
"myEmailProp": &port.BlueprintPropertiesStringPropsArgs{
Title: pulumi.String("My email"),
Required: pulumi.Bool(false),
Format: pulumi.String("email"),
Enums: pulumi.StringArray{
pulumi.String("me@example.com"),
pulumi.String("other@example.com"),
},
EnumColors: pulumi.StringMap{
"me@example.com": pulumi.String("red"),
"other@example.com": pulumi.String("green"),
},
Format: pulumi.String("email"),
},
},
},
})
ctx.Export("blueprint", blueprint.Title)
if err != nil {
return err
}
return nil
})
}