Skip to main content

Check out Port for yourself 

Pulumi-Managed Blueprint Example

This example includes a complete blueprint resource definition in Pulumi, which includes:

Here is the example definition in all the supported languages:

from pulumi import ResourceOptions
import port_pulumi as port

other = port.Blueprint(
"other",
identifier="test-docs-relation",
icon="Microservice",
title="Test Docs Relation",
properties=port.BlueprintPropertiesArgs(
string_props={
"myStringProp": port.BlueprintPropertiesStringPropsArgs(
title="My string", required=False
)
}
),
)

blueprint = port.Blueprint(
"myBlueprint",
identifier="test-docs",
icon="Microservice",
title="Test Docs",
properties=port.BlueprintPropertiesArgs(
string_props={
"myStringProp": port.BlueprintPropertiesStringPropsArgs(
title="My string", required=False
),
"myUrlProp": port.BlueprintPropertiesStringPropsArgs(
title="My url", required=False, format="url"
),
"myEmailProp": port.BlueprintPropertiesStringPropsArgs(
title="My email", required=False, format="email"
),
"myUserProp": port.BlueprintPropertiesStringPropsArgs(
title="My user", required=False, format="user"
),
"myTeamProp": port.BlueprintPropertiesStringPropsArgs(
title="My team", required=False, format="team"
),
"myDatetimeProp": port.BlueprintPropertiesStringPropsArgs(
title="My datetime", required=False, format="date-time"
),
"myTimerProp": port.BlueprintPropertiesStringPropsArgs(
title="My timer", required=False, format="timer"
),
"myYAMLProp": port.BlueprintPropertiesStringPropsArgs(
title="My yaml", required=False, format="yaml"
),
},
number_props={
"myNumberProp": port.BlueprintPropertiesNumberPropsArgs(
title="My number", required=False,
)
},
boolean_props={
"myBooleanProp": port.BlueprintPropertiesBooleanPropsArgs(
title="My boolean", required=False
)
},
object_props={
"myObjectProp": port.BlueprintPropertiesObjectPropsArgs(
title="My object", required=False
)
},
array_props={
"myArrayProp": port.BlueprintPropertiesArrayPropsArgs(
title="My array", required=False
)
}
),
mirror_properties={
"myMirrorProp": port.BlueprintMirrorPropertiesArgs(
title="My mirror property", path="myRelation.myStringProp"
),
"myMirrorPropWithMeta": port.BlueprintMirrorPropertiesArgs(
title="My mirror property of meta property", path="myRelation.$identifier"
),
},
calculation_properties={
"myCalculation": port.BlueprintCalculationPropertiesArgs(
title="My calculation property", calculation=".properties.myStringProp + .properties.myStringProp", type="string",
),
"myCalculationWithMeta": port.BlueprintCalculationPropertiesArgs(
title="My calculation property with meta properties", calculation='.identifier + "-" + .title + "-" + .properties.myStringProp', type="string",
),
},
relations={
"myRelation": port.BlueprintRelationsArgs(
title="My relation", target="test-docs-relation", many=False, required=False,
),
},
opts=ResourceOptions(depends_on=[other]),
)