mirror of https://github.com/pulumi/pulumi.git
55 KiB
55 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,
baz_map: Optional[Mapping[str, 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",
},
},
BazMap =
{
{ "string", 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: &example.FooArgs{
A: false,
C: 0,
E: "string",
B: false,
D: 0,
F: "string",
},
Baz: []example.FooArgs{
{
A: false,
C: 0,
E: "string",
B: false,
D: 0,
F: "string",
},
},
BazMap: map[string]example.FooArgs{
"string": &example.FooArgs{
A: false,
C: 0,
E: "string",
B: false,
D: 0,
F: "string",
},
},
D: 0,
F: "string",
Foo: &example.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())
.bazMap(Map.of("string", Map.ofEntries(
Map.entry("a", false),
Map.entry("c", 0),
Map.entry("e", "string"),
Map.entry("b", false),
Map.entry("d", 0),
Map.entry("f", "string")
)))
.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",
}],
baz_map={
"string": {
"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",
}],
bazMap: {
string: {
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
bazMap:
string:
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 Boolean
- c Number
- e String
- b Boolean
- bar Property Map
- baz List<Property Map>
-
baz
Map Map<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
Package Details
- Repository
- example
- License