pulumi/tests/testdata/codegen/simple-plain-schema-with-ro.../docs/component/_index.md

51 KiB


title: "Component" title_tag: "example.Component" meta_desc: "Documentation for the example.Component resource with examples, input properties, output properties, lookup functions, and supporting types." layout: api no_edit_this_page: true

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?: ComponentResourceOptions);
@overload
def Component(resource_name: str,
              args: ComponentArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def Component(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              a: Optional[bool] = None,
              c: Optional[int] = None,
              e: Optional[str] = None,
              b: Optional[bool] = None,
              bar: Optional[FooArgs] = None,
              baz: Optional[Sequence[FooArgs]] = None,
              d: Optional[int] = None,
              f: Optional[str] = None,
              foo: Optional[FooArgs] = None)
func NewComponent(ctx *Context, name string, args ComponentArgs, opts ...ResourceOption) (*Component, error)
public Component(string name, ComponentArgs args, ComponentResourceOptions? opts = null)
public Component(String name, ComponentArgs args)
public Component(String name, ComponentArgs args, ComponentResourceOptions options)
type: example: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 ComponentResourceOptions
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 ComponentResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ComponentArgs
The arguments to resource properties.
options ComponentResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var componentResource = new Example.Component("componentResource", new()
{
    A = false,
    C = 0,
    E = "string",
    B = false,
    Bar = new Example.Inputs.FooArgs
    {
        A = false,
        C = 0,
        E = "string",
        B = false,
        D = 0,
        F = "string",
    },
    Baz = new()
    {
        new Example.Inputs.FooArgs
        {
            A = false,
            C = 0,
            E = "string",
            B = false,
            D = 0,
            F = "string",
        },
    },
    D = 0,
    F = "string",
    Foo = new Example.Inputs.FooArgs
    {
        A = false,
        C = 0,
        E = "string",
        B = false,
        D = 0,
        F = "string",
    },
});
example, err := example.NewComponent(ctx, "componentResource", &example.ComponentArgs{
A: false,
C: 0,
E: "string",
B: false,
Bar: &.FooArgs{
A: false,
C: 0,
E: "string",
B: false,
D: 0,
F: "string",
},
Baz: [].FooArgs{
{
A: false,
C: 0,
E: "string",
B: false,
D: 0,
F: "string",
},
},
D: 0,
F: "string",
Foo: &.FooArgs{
A: false,
C: 0,
E: "string",
B: false,
D: 0,
F: "string",
},
})
var componentResource = new Component("componentResource", ComponentArgs.builder()
    .a(false)
    .c(0)
    .e("string")
    .b(false)
    .bar(FooArgs.builder()
        .a(false)
        .c(0)
        .e("string")
        .b(false)
        .d(0)
        .f("string")
        .build())
    .baz(FooArgs.builder()
        .a(false)
        .c(0)
        .e("string")
        .b(false)
        .d(0)
        .f("string")
        .build())
    .d(0)
    .f("string")
    .foo(FooArgs.builder()
        .a(false)
        .c(0)
        .e("string")
        .b(false)
        .d(0)
        .f("string")
        .build())
    .build());
component_resource = example.Component("componentResource",
    a=False,
    c=0,
    e="string",
    b=False,
    bar={
        "a": False,
        "c": 0,
        "e": "string",
        "b": False,
        "d": 0,
        "f": "string",
    },
    baz=[{
        "a": False,
        "c": 0,
        "e": "string",
        "b": False,
        "d": 0,
        "f": "string",
    }],
    d=0,
    f="string",
    foo={
        "a": False,
        "c": 0,
        "e": "string",
        "b": False,
        "d": 0,
        "f": "string",
    })
const componentResource = new example.Component("componentResource", {
    a: false,
    c: 0,
    e: "string",
    b: false,
    bar: {
        a: false,
        c: 0,
        e: "string",
        b: false,
        d: 0,
        f: "string",
    },
    baz: [{
        a: false,
        c: 0,
        e: "string",
        b: false,
        d: 0,
        f: "string",
    }],
    d: 0,
    f: "string",
    foo: {
        a: false,
        c: 0,
        e: "string",
        b: false,
        d: 0,
        f: "string",
    },
});
type: example:Component
properties:
    a: false
    b: false
    bar:
        a: false
        b: false
        c: 0
        d: 0
        e: string
        f: string
    baz:
        - a: false
          b: false
          c: 0
          d: 0
          e: string
          f: string
    c: 0
    d: 0
    e: string
    f: string
    foo:
        a: false
        b: false
        c: 0
        d: 0
        e: string
        f: 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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Component resource accepts the following input properties:

A bool
C int
E string
B bool
Bar Foo
Baz List<Foo>
D int
F string
Foo Foo
A bool
C int
E string
B bool
Bar FooArgs
Baz []FooArgs
D int
F string
Foo FooArgs
a Boolean
c Integer
e String
b Boolean
bar Foo
baz List<Foo>
d Integer
f String
foo Foo
a boolean
c number
e string
b boolean
bar Foo
baz Foo[]
d number
f string
foo Foo
a bool
c int
e str
b bool
bar FooArgs
baz Sequence[FooArgs]
d int
f str
foo FooArgs
a Boolean
c Number
e String
b Boolean
bar Property Map
baz List<Property Map>
d Number
f String
foo Property Map

Outputs

All input properties are implicitly available as output properties. Additionally, the Component resource produces the following output properties:

Supporting Types

Foo, FooArgs

A bool
C int
E string
B bool
D int
F string
A bool
C int
E string
B bool
D int
F string
a Boolean
c Integer
e String
b Boolean
d Integer
f String
a boolean
c number
e string
b boolean
d number
f string
a bool
c int
e str
b bool
d int
f str
a Boolean
c Number
e String
b Boolean
d Number
f String

Package Details

Repository
example
License