splight.Asset
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as splight from "@splightplatform/pulumi-splight";
const assetMainTest = new splight.Asset("assetMainTest", {
description: "Created with Terraform",
geometry: JSON.stringify({
type: "GeometryCollection",
geometries: [],
}),
kinds: [{
id: "1234-1234-1234-1234",
name: "Line",
}],
});
import pulumi
import json
import pulumi_splight as splight
asset_main_test = splight.Asset("assetMainTest",
description="Created with Terraform",
geometry=json.dumps({
"type": "GeometryCollection",
"geometries": [],
}),
kinds=[splight.AssetKindArgs(
id="1234-1234-1234-1234",
name="Line",
)])
package main
import (
"encoding/json"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/splightplatform/pulumi-splight/sdk/go/splight"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"type": "GeometryCollection",
"geometries": []interface{}{},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = splight.NewAsset(ctx, "assetMainTest", &splight.AssetArgs{
Description: pulumi.String("Created with Terraform"),
Geometry: pulumi.String(json0),
Kinds: splight.AssetKindArray{
&splight.AssetKindArgs{
Id: pulumi.String("1234-1234-1234-1234"),
Name: pulumi.String("Line"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Splight = Splight.Splight;
return await Deployment.RunAsync(() =>
{
var assetMainTest = new Splight.Asset("assetMainTest", new()
{
Description = "Created with Terraform",
Geometry = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["type"] = "GeometryCollection",
["geometries"] = new[]
{
},
}),
Kinds = new[]
{
new Splight.Inputs.AssetKindArgs
{
Id = "1234-1234-1234-1234",
Name = "Line",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.splight.Asset;
import com.pulumi.splight.AssetArgs;
import com.pulumi.splight.inputs.AssetKindArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var assetMainTest = new Asset("assetMainTest", AssetArgs.builder()
.description("Created with Terraform")
.geometry(serializeJson(
jsonObject(
jsonProperty("type", "GeometryCollection"),
jsonProperty("geometries", jsonArray(
))
)))
.kinds(AssetKindArgs.builder()
.id("1234-1234-1234-1234")
.name("Line")
.build())
.build());
}
}
resources:
assetMainTest:
type: splight:Asset
properties:
description: Created with Terraform
geometry:
fn::toJSON:
type: GeometryCollection
geometries: []
kinds:
- id: 1234-1234-1234-1234
name: Line
Create Asset Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Asset(name: string, args?: AssetArgs, opts?: CustomResourceOptions);
@overload
def Asset(resource_name: str,
args: Optional[AssetArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Asset(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
geometry: Optional[str] = None,
kinds: Optional[Sequence[AssetKindArgs]] = None,
name: Optional[str] = None,
related_assets: Optional[Sequence[str]] = None)
func NewAsset(ctx *Context, name string, args *AssetArgs, opts ...ResourceOption) (*Asset, error)
public Asset(string name, AssetArgs? args = null, CustomResourceOptions? opts = null)
type: splight:Asset
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AssetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AssetArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AssetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AssetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AssetArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var assetResource = new Splight.Asset("assetResource", new()
{
Description = "string",
Geometry = "string",
Kinds = new[]
{
new Splight.Inputs.AssetKindArgs
{
Id = "string",
Name = "string",
},
},
Name = "string",
RelatedAssets = new[]
{
"string",
},
});
example, err := splight.NewAsset(ctx, "assetResource", &splight.AssetArgs{
Description: pulumi.String("string"),
Geometry: pulumi.String("string"),
Kinds: splight.AssetKindArray{
&splight.AssetKindArgs{
Id: pulumi.String("string"),
Name: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
RelatedAssets: pulumi.StringArray{
pulumi.String("string"),
},
})
var assetResource = new Asset("assetResource", AssetArgs.builder()
.description("string")
.geometry("string")
.kinds(AssetKindArgs.builder()
.id("string")
.name("string")
.build())
.name("string")
.relatedAssets("string")
.build());
asset_resource = splight.Asset("assetResource",
description="string",
geometry="string",
kinds=[splight.AssetKindArgs(
id="string",
name="string",
)],
name="string",
related_assets=["string"])
const assetResource = new splight.Asset("assetResource", {
description: "string",
geometry: "string",
kinds: [{
id: "string",
name: "string",
}],
name: "string",
relatedAssets: ["string"],
});
type: splight:Asset
properties:
description: string
geometry: string
kinds:
- id: string
name: string
name: string
relatedAssets:
- string
Asset Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Asset resource accepts the following input properties:
- Description string
- description of the resource
- Geometry string
- geo position and shape of the resource
- Kinds
List<Splight.
Splight. Inputs. Asset Kind> - kind of the resource
- Name string
- name of the resource
- List<string>
- linked assets
- Description string
- description of the resource
- Geometry string
- geo position and shape of the resource
- Kinds
[]Asset
Kind Args - kind of the resource
- Name string
- name of the resource
- []string
- linked assets
- description String
- description of the resource
- geometry String
- geo position and shape of the resource
- kinds
List<Asset
Kind> - kind of the resource
- name String
- name of the resource
- List<String>
- linked assets
- description string
- description of the resource
- geometry string
- geo position and shape of the resource
- kinds
Asset
Kind[] - kind of the resource
- name string
- name of the resource
- string[]
- linked assets
- description str
- description of the resource
- geometry str
- geo position and shape of the resource
- kinds
Sequence[Asset
Kind Args] - kind of the resource
- name str
- name of the resource
- Sequence[str]
- linked assets
- description String
- description of the resource
- geometry String
- geo position and shape of the resource
- kinds List<Property Map>
- kind of the resource
- name String
- name of the resource
- List<String>
- linked assets
Outputs
All input properties are implicitly available as output properties. Additionally, the Asset resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Asset Resource
Get an existing Asset resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AssetState, opts?: CustomResourceOptions): Asset
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
geometry: Optional[str] = None,
kinds: Optional[Sequence[AssetKindArgs]] = None,
name: Optional[str] = None,
related_assets: Optional[Sequence[str]] = None) -> Asset
func GetAsset(ctx *Context, name string, id IDInput, state *AssetState, opts ...ResourceOption) (*Asset, error)
public static Asset Get(string name, Input<string> id, AssetState? state, CustomResourceOptions? opts = null)
public static Asset get(String name, Output<String> id, AssetState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Description string
- description of the resource
- Geometry string
- geo position and shape of the resource
- Kinds
List<Splight.
Splight. Inputs. Asset Kind> - kind of the resource
- Name string
- name of the resource
- List<string>
- linked assets
- Description string
- description of the resource
- Geometry string
- geo position and shape of the resource
- Kinds
[]Asset
Kind Args - kind of the resource
- Name string
- name of the resource
- []string
- linked assets
- description String
- description of the resource
- geometry String
- geo position and shape of the resource
- kinds
List<Asset
Kind> - kind of the resource
- name String
- name of the resource
- List<String>
- linked assets
- description string
- description of the resource
- geometry string
- geo position and shape of the resource
- kinds
Asset
Kind[] - kind of the resource
- name string
- name of the resource
- string[]
- linked assets
- description str
- description of the resource
- geometry str
- geo position and shape of the resource
- kinds
Sequence[Asset
Kind Args] - kind of the resource
- name str
- name of the resource
- Sequence[str]
- linked assets
- description String
- description of the resource
- geometry String
- geo position and shape of the resource
- kinds List<Property Map>
- kind of the resource
- name String
- name of the resource
- List<String>
- linked assets
Supporting Types
AssetKind, AssetKindArgs
Import
$ pulumi import splight:index/asset:Asset [options] splight_asset.<name> <asset_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- splight splightplatform/pulumi-splight
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
splight
Terraform Provider.