splight.Component
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as splight from "@splightplatform/pulumi-splight";
const componentTest = new splight.Component("componentTest", {
description: "Created with Terraform",
version: "Random-3.1.0",
inputs: [
{
name: "period",
type: "int",
value: JSON.stringify(10),
multiple: false,
required: false,
sensitive: false,
description: "",
},
{
name: "min",
type: "int",
value: JSON.stringify(1),
multiple: false,
required: false,
sensitive: false,
description: "",
},
{
name: "max",
type: "int",
value: JSON.stringify(150),
multiple: false,
required: false,
sensitive: false,
description: "",
},
{
name: "max_iterations",
type: "int",
value: JSON.stringify(3),
multiple: false,
required: false,
sensitive: false,
description: "",
},
{
name: "should_crash",
type: "bool",
value: JSON.stringify("true"),
multiple: false,
required: false,
sensitive: false,
description: "",
},
],
});
import pulumi
import json
import pulumi_splight as splight
component_test = splight.Component("componentTest",
description="Created with Terraform",
version="Random-3.1.0",
inputs=[
splight.ComponentInputArgs(
name="period",
type="int",
value=json.dumps(10),
multiple=False,
required=False,
sensitive=False,
description="",
),
splight.ComponentInputArgs(
name="min",
type="int",
value=json.dumps(1),
multiple=False,
required=False,
sensitive=False,
description="",
),
splight.ComponentInputArgs(
name="max",
type="int",
value=json.dumps(150),
multiple=False,
required=False,
sensitive=False,
description="",
),
splight.ComponentInputArgs(
name="max_iterations",
type="int",
value=json.dumps(3),
multiple=False,
required=False,
sensitive=False,
description="",
),
splight.ComponentInputArgs(
name="should_crash",
type="bool",
value=json.dumps("true"),
multiple=False,
required=False,
sensitive=False,
description="",
),
])
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(10)
if err != nil {
return err
}
json0 := string(tmpJSON0)
tmpJSON1, err := json.Marshal(1)
if err != nil {
return err
}
json1 := string(tmpJSON1)
tmpJSON2, err := json.Marshal(150)
if err != nil {
return err
}
json2 := string(tmpJSON2)
tmpJSON3, err := json.Marshal(3)
if err != nil {
return err
}
json3 := string(tmpJSON3)
tmpJSON4, err := json.Marshal("true")
if err != nil {
return err
}
json4 := string(tmpJSON4)
_, err = splight.NewComponent(ctx, "componentTest", &splight.ComponentArgs{
Description: pulumi.String("Created with Terraform"),
Version: pulumi.String("Random-3.1.0"),
Inputs: splight.ComponentInputTypeArray{
&splight.ComponentInputTypeArgs{
Name: pulumi.String("period"),
Type: pulumi.String("int"),
Value: pulumi.String(json0),
Multiple: pulumi.Bool(false),
Required: pulumi.Bool(false),
Sensitive: pulumi.Bool(false),
Description: pulumi.String(""),
},
&splight.ComponentInputTypeArgs{
Name: pulumi.String("min"),
Type: pulumi.String("int"),
Value: pulumi.String(json1),
Multiple: pulumi.Bool(false),
Required: pulumi.Bool(false),
Sensitive: pulumi.Bool(false),
Description: pulumi.String(""),
},
&splight.ComponentInputTypeArgs{
Name: pulumi.String("max"),
Type: pulumi.String("int"),
Value: pulumi.String(json2),
Multiple: pulumi.Bool(false),
Required: pulumi.Bool(false),
Sensitive: pulumi.Bool(false),
Description: pulumi.String(""),
},
&splight.ComponentInputTypeArgs{
Name: pulumi.String("max_iterations"),
Type: pulumi.String("int"),
Value: pulumi.String(json3),
Multiple: pulumi.Bool(false),
Required: pulumi.Bool(false),
Sensitive: pulumi.Bool(false),
Description: pulumi.String(""),
},
&splight.ComponentInputTypeArgs{
Name: pulumi.String("should_crash"),
Type: pulumi.String("bool"),
Value: pulumi.String(json4),
Multiple: pulumi.Bool(false),
Required: pulumi.Bool(false),
Sensitive: pulumi.Bool(false),
Description: pulumi.String(""),
},
},
})
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 componentTest = new Splight.Component("componentTest", new()
{
Description = "Created with Terraform",
Version = "Random-3.1.0",
Inputs = new[]
{
new Splight.Inputs.ComponentInputArgs
{
Name = "period",
Type = "int",
Value = JsonSerializer.Serialize(10),
Multiple = false,
Required = false,
Sensitive = false,
Description = "",
},
new Splight.Inputs.ComponentInputArgs
{
Name = "min",
Type = "int",
Value = JsonSerializer.Serialize(1),
Multiple = false,
Required = false,
Sensitive = false,
Description = "",
},
new Splight.Inputs.ComponentInputArgs
{
Name = "max",
Type = "int",
Value = JsonSerializer.Serialize(150),
Multiple = false,
Required = false,
Sensitive = false,
Description = "",
},
new Splight.Inputs.ComponentInputArgs
{
Name = "max_iterations",
Type = "int",
Value = JsonSerializer.Serialize(3),
Multiple = false,
Required = false,
Sensitive = false,
Description = "",
},
new Splight.Inputs.ComponentInputArgs
{
Name = "should_crash",
Type = "bool",
Value = JsonSerializer.Serialize("true"),
Multiple = false,
Required = false,
Sensitive = false,
Description = "",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.splight.Component;
import com.pulumi.splight.ComponentArgs;
import com.pulumi.splight.inputs.ComponentInputArgs;
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 componentTest = new Component("componentTest", ComponentArgs.builder()
.description("Created with Terraform")
.version("Random-3.1.0")
.inputs(
ComponentInputArgs.builder()
.name("period")
.type("int")
.value(serializeJson(
10))
.multiple(false)
.required(false)
.sensitive(false)
.description("")
.build(),
ComponentInputArgs.builder()
.name("min")
.type("int")
.value(serializeJson(
1))
.multiple(false)
.required(false)
.sensitive(false)
.description("")
.build(),
ComponentInputArgs.builder()
.name("max")
.type("int")
.value(serializeJson(
150))
.multiple(false)
.required(false)
.sensitive(false)
.description("")
.build(),
ComponentInputArgs.builder()
.name("max_iterations")
.type("int")
.value(serializeJson(
3))
.multiple(false)
.required(false)
.sensitive(false)
.description("")
.build(),
ComponentInputArgs.builder()
.name("should_crash")
.type("bool")
.value(serializeJson(
"true"))
.multiple(false)
.required(false)
.sensitive(false)
.description("")
.build())
.build());
}
}
resources:
componentTest:
type: splight:Component
properties:
description: Created with Terraform
version: Random-3.1.0
inputs:
- name: period
type: int
value:
fn::toJSON: 10
multiple: false
required: false
sensitive: false
description:
- name: min
type: int
value:
fn::toJSON: 1
multiple: false
required: false
sensitive: false
description:
- name: max
type: int
value:
fn::toJSON: 150
multiple: false
required: false
sensitive: false
description:
- name: max_iterations
type: int
value:
fn::toJSON: 3
multiple: false
required: false
sensitive: false
description:
- name: should_crash
type: bool
value:
fn::toJSON: 'true'
multiple: false
required: false
sensitive: false
description:
Create Component Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Component(name: string, args: ComponentArgs, opts?: CustomResourceOptions);
@overload
def Component(resource_name: str,
args: ComponentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Component(resource_name: str,
opts: Optional[ResourceOptions] = None,
version: Optional[str] = None,
description: Optional[str] = None,
inputs: Optional[Sequence[ComponentInputArgs]] = None,
name: Optional[str] = None)
func NewComponent(ctx *Context, name string, args ComponentArgs, opts ...ResourceOption) (*Component, error)
public Component(string name, ComponentArgs args, CustomResourceOptions? opts = null)
public Component(String name, ComponentArgs args)
public Component(String name, ComponentArgs args, CustomResourceOptions options)
type: splight:Component
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 ComponentArgs
- 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 ComponentArgs
- 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 ComponentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ComponentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ComponentArgs
- 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 componentResource = new Splight.Component("componentResource", new()
{
Version = "string",
Description = "string",
Inputs = new[]
{
new Splight.Inputs.ComponentInputArgs
{
Name = "string",
Type = "string",
Description = "string",
Multiple = false,
Required = false,
Sensitive = false,
Value = "string",
},
},
Name = "string",
});
example, err := splight.NewComponent(ctx, "componentResource", &splight.ComponentArgs{
Version: pulumi.String("string"),
Description: pulumi.String("string"),
Inputs: splight.ComponentInputTypeArray{
&splight.ComponentInputTypeArgs{
Name: pulumi.String("string"),
Type: pulumi.String("string"),
Description: pulumi.String("string"),
Multiple: pulumi.Bool(false),
Required: pulumi.Bool(false),
Sensitive: pulumi.Bool(false),
Value: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
})
var componentResource = new Component("componentResource", ComponentArgs.builder()
.version("string")
.description("string")
.inputs(ComponentInputArgs.builder()
.name("string")
.type("string")
.description("string")
.multiple(false)
.required(false)
.sensitive(false)
.value("string")
.build())
.name("string")
.build());
component_resource = splight.Component("componentResource",
version="string",
description="string",
inputs=[splight.ComponentInputArgs(
name="string",
type="string",
description="string",
multiple=False,
required=False,
sensitive=False,
value="string",
)],
name="string")
const componentResource = new splight.Component("componentResource", {
version: "string",
description: "string",
inputs: [{
name: "string",
type: "string",
description: "string",
multiple: false,
required: false,
sensitive: false,
value: "string",
}],
name: "string",
});
type: splight:Component
properties:
description: string
inputs:
- description: string
multiple: false
name: string
required: false
sensitive: false
type: string
value: string
name: string
version: string
Component 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 Component resource accepts the following input properties:
- Version string
- [NAME-VERSION] the version of the hub component
- Description string
- optinal description to add details of the resource
- Inputs
List<Splight.
Splight. Inputs. Component Input> - static config parameters of the routine
- Name string
- the name of the component to be created
- Version string
- [NAME-VERSION] the version of the hub component
- Description string
- optinal description to add details of the resource
- Inputs
[]Component
Input Type Args - static config parameters of the routine
- Name string
- the name of the component to be created
- version String
- [NAME-VERSION] the version of the hub component
- description String
- optinal description to add details of the resource
- inputs
List<Component
Input> - static config parameters of the routine
- name String
- the name of the component to be created
- version string
- [NAME-VERSION] the version of the hub component
- description string
- optinal description to add details of the resource
- inputs
Component
Input[] - static config parameters of the routine
- name string
- the name of the component to be created
- version str
- [NAME-VERSION] the version of the hub component
- description str
- optinal description to add details of the resource
- inputs
Sequence[Component
Input Args] - static config parameters of the routine
- name str
- the name of the component to be created
- version String
- [NAME-VERSION] the version of the hub component
- description String
- optinal description to add details of the resource
- inputs List<Property Map>
- static config parameters of the routine
- name String
- the name of the component to be created
Outputs
All input properties are implicitly available as output properties. Additionally, the Component 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 Component Resource
Get an existing Component 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?: ComponentState, opts?: CustomResourceOptions): Component
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
inputs: Optional[Sequence[ComponentInputArgs]] = None,
name: Optional[str] = None,
version: Optional[str] = None) -> Component
func GetComponent(ctx *Context, name string, id IDInput, state *ComponentState, opts ...ResourceOption) (*Component, error)
public static Component Get(string name, Input<string> id, ComponentState? state, CustomResourceOptions? opts = null)
public static Component get(String name, Output<String> id, ComponentState 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
- optinal description to add details of the resource
- Inputs
List<Splight.
Splight. Inputs. Component Input> - static config parameters of the routine
- Name string
- the name of the component to be created
- Version string
- [NAME-VERSION] the version of the hub component
- Description string
- optinal description to add details of the resource
- Inputs
[]Component
Input Type Args - static config parameters of the routine
- Name string
- the name of the component to be created
- Version string
- [NAME-VERSION] the version of the hub component
- description String
- optinal description to add details of the resource
- inputs
List<Component
Input> - static config parameters of the routine
- name String
- the name of the component to be created
- version String
- [NAME-VERSION] the version of the hub component
- description string
- optinal description to add details of the resource
- inputs
Component
Input[] - static config parameters of the routine
- name string
- the name of the component to be created
- version string
- [NAME-VERSION] the version of the hub component
- description str
- optinal description to add details of the resource
- inputs
Sequence[Component
Input Args] - static config parameters of the routine
- name str
- the name of the component to be created
- version str
- [NAME-VERSION] the version of the hub component
- description String
- optinal description to add details of the resource
- inputs List<Property Map>
- static config parameters of the routine
- name String
- the name of the component to be created
- version String
- [NAME-VERSION] the version of the hub component
Supporting Types
ComponentInput, ComponentInputArgs
Import
$ pulumi import splight:index/component:Component [options] splight_component.<name> <component_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.