URL
URL is a data type used to save links to websites.
๐ก Common url usageโ
The URL property type can be used to store a link to any web resource, for example:
- Link to Datadog dashboard
- Link to Sentry tracing
- Link to pull request
API definitionโ
- Basic
- Enum
- Array
{
"myUrlProp": {
"title": "My url",
"icon": "My icon",
"description": "My url property",
"type": "string",
"format": "url",
"default": "https://example.com"
}
}
{
"myUrlEnum": {
"title": "My url enum",
"icon": "My icon",
"description": "My url enum",
"type": "string",
"format": "url",
"enum": ["https://example.com", "https://getport.io"],
"enumColors": {
"https://example.com": "red",
"https://getport.io": "green"
}
}
}
{
"myUrlArray": {
"title": "My url array",
"icon": "My icon",
"description": "My url array",
"type": "array",
"items": {
"type": "string",
"format": "url"
}
}
}
Check out Port's API reference to learn more.
Terraform definitionโ
- Basic
- Enum
- Array
resource "port_blueprint" "myBlueprint" {
# ...blueprint properties
properties = {
string_props = {
"myUrlProp" = {
title = "My url"
required = false
format = "url"
}
}
}
}
resource "port_blueprint" "myBlueprint" {
# ...blueprint properties
properties = {
string_props = {
"myUrlEnum" = {
title = "My url enum"
required = false
format = "url"
enum = ["https://example.com", "https://getport.io"]
enum_colors = {
"https://example.com" = "red",
"https://getport.io" = "green"
}
}
}
}
}
resource "port_blueprint" "myBlueprint" {
# ...blueprint properties
properties = {
string_props = {
"myUrlArray" = {
title = "My url array"
required = false
string_items = {
format = "url"
}
}
}
}
}
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={
"myUrlProp": BlueprintPropertiesStringPropsArgs(
title="My url", required=False, format="url"
),
}
),
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: {
myUrlProp: {
title: "My url",
required: true,
format: "url",
},
},
},
});
"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: {
myUrlProp: {
title: "My url",
required: true,
format: "url",
},
},
},
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{
"myUrlProp": &port.BlueprintPropertyArgs{
Title: pulumi.String("My url"),
Required: pulumi.Bool(true),
Format: pulumi.String("url"),
},
},
},
})
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
blueprint = Blueprint(
"myBlueprint",
identifier="myBlueprint",
title="My Blueprint",
properties=BlueprintPropertiesArgs(
string_props={
"myUrlProp":BlueprintPropertiesStringPropsArgs(
title="My url",
required=True,
format="url",
enum=["https://example.com", "https://getport.io"],
enum_colors={
"https://example.com": "red",
"https://getport.io": "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: {
myUrlProp: {
title: "My url",
required: true,
format: "url",
enums: ["https://example.com", "https://getport.io"],
enumColors: {
"https://example.com": "red",
"https://getport.io": "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: {
myUrlProp: {
title: "My url",
required: true,
format: "url",
enums: ["https://example.com", "https://getport.io"],
enumColors: {
"https://example.com": "red",
"https://getport.io": "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{
"myUrlProp": port.BlueprintPropertiesStringPropsArgs{
Title: pulumi.String("My url"),
Required: pulumi.Bool(false),
Format: pulumi.String("url"),
Enums: pulumi.StringArray{
pulumi.String("https://example.com"),
pulumi.String("https://getport.io"),
},
EnumColors: pulumi.StringMap{
"https://example.com": pulumi.String("red"),
"https://getport.io": pulumi.String("green"),
},
},
},
},
})
ctx.Export("blueprint", blueprint.Title)
if err != nil {
return err
}
return nil
})
}