mirror of https://github.com/pulumi/pulumi.git
44 KiB
44 KiB
title: "Cat" title_tag: "example.Cat" meta_desc: "Documentation for the example.Cat resource with examples, input properties, output properties, lookup functions, and supporting types." layout: api no_edit_this_page: true
Create Cat Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Cat(name: string, args?: CatArgs, opts?: CustomResourceOptions);
@overload
def Cat(resource_name: str,
args: Optional[CatArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Cat(resource_name: str,
opts: Optional[ResourceOptions] = None,
age: Optional[int] = None,
pet: Optional[PetArgs] = None)
func NewCat(ctx *Context, name string, args *CatArgs, opts ...ResourceOption) (*Cat, error)
public Cat(string name, CatArgs? args = null, CustomResourceOptions? opts = null)
type: example:Cat
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 CatArgs
- 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 CatArgs
- 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 CatArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CatArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CatArgs
- 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 catResource = new Example.Cat("catResource", new()
{
Age = 0,
Pet = new Example.Inputs.PetArgs
{
RequiredName = randomPet,
RequiredNameArray = new[]
{
randomPet,
},
RequiredNameMap =
{
{ "string", randomPet },
},
Age = 0,
Name = randomPet,
NameArray = new[]
{
randomPet,
},
NameMap =
{
{ "string", randomPet },
},
},
});
example, err := example.NewCat(ctx, "catResource", &example.CatArgs{
Age: pulumi.Int(0),
Pet: &example.PetArgs{
RequiredName: pulumi.Any(randomPet),
RequiredNameArray: random.RandomPetArray{
randomPet,
},
RequiredNameMap: random.RandomPetMap{
"string": pulumi.Any(randomPet),
},
Age: pulumi.Int(0),
Name: pulumi.Any(randomPet),
NameArray: random.RandomPetArray{
randomPet,
},
NameMap: random.RandomPetMap{
"string": pulumi.Any(randomPet),
},
},
})
var catResource = new Cat("catResource", CatArgs.builder()
.age(0)
.pet(PetArgs.builder()
.requiredName(randomPet)
.requiredNameArray(randomPet)
.requiredNameMap(Map.of("string", randomPet))
.age(0)
.name(randomPet)
.nameArray(randomPet)
.nameMap(Map.of("string", randomPet))
.build())
.build());
cat_resource = example.Cat("catResource",
age=0,
pet={
"required_name": random_pet,
"required_name_array": [random_pet],
"required_name_map": {
"string": random_pet,
},
"age": 0,
"name": random_pet,
"name_array": [random_pet],
"name_map": {
"string": random_pet,
},
})
const catResource = new example.Cat("catResource", {
age: 0,
pet: {
requiredName: randomPet,
requiredNameArray: [randomPet],
requiredNameMap: {
string: randomPet,
},
age: 0,
name: randomPet,
nameArray: [randomPet],
nameMap: {
string: randomPet,
},
},
});
type: example:Cat
properties:
age: 0
pet:
age: 0
name: ${randomPet}
nameArray:
- ${randomPet}
nameMap:
string: ${randomPet}
requiredName: ${randomPet}
requiredNameArray:
- ${randomPet}
requiredNameMap:
string: ${randomPet}
Cat 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 Cat resource accepts the following input properties:
- age Number
- pet Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the Cat resource produces the following output properties:
Supporting Types
Pet, PetArgs
-
Required
Name Pulumi.Random. Random Pet - This type is defined in the random package.
-
Required
Name List<Pulumi.Array Random. Random Pet> -
Required
Name Dictionary<string, Pulumi.Map Random. Random Pet> - Age int
-
Name
Pulumi.
Random. Random Pet - This type is defined in the random package.
-
Name
Array List<Pulumi.Random. Random Pet> -
Name
Map Dictionary<string, Pulumi.Random. Random Pet>
-
Required
Name RandomPet - This type is defined in the random package.
-
Required
Name RandomArray Pet -
Required
Name RandomMap Pet - Age int
-
Name
Random
Pet - This type is defined in the random package.
-
Name
Array RandomPet -
Name
Map RandomPet
-
required
Name RandomPet - This type is defined in the random package.
-
required
Name List<RandomArray Pet> -
required
Name Map<String,RandomMap Pet> - age Integer
-
name
Random
Pet - This type is defined in the random package.
-
name
Array List<RandomPet> -
name
Map Map<String,RandomPet>
-
required
Name pulumiRandom Random Pet - This type is defined in the random package.
-
required
Name pulumiArray Random Random Pet[] -
required
Name {[key: string]: pulumiMap Random Random Pet} - age number
-
name
pulumi
Random Random Pet - This type is defined in the random package.
-
name
Array pulumiRandom Random Pet[] -
name
Map {[key: string]: pulumiRandom Random Pet}
-
required_
name pulumi_random. Random Pet - This type is defined in the random package.
-
required_
name_ Sequence[pulumi_array random. Random Pet] -
required_
name_ Mapping[str, pulumi_map random. Random Pet] - age int
-
name
pulumi_
random. Random Pet - This type is defined in the random package.
-
name_
array Sequence[pulumi_random. Random Pet] -
name_
map Mapping[str, pulumi_random. Random Pet]
-
required
Name random:RandomPet - This type is defined in the random package.
-
required
Name List<random:RandomArray Pet> -
required
Name Map<random:RandomMap Pet> - age Number
-
name
random:Random
Pet - This type is defined in the random package.
-
name
Array List<random:RandomPet> -
name
Map Map<random:RandomPet>
Package Details
- Repository
- example
- License