pulumi/tests/testdata/codegen/external-resource-schema/docs/cat/_index.md

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)
public Cat(String name, CatArgs args)
public Cat(String name, CatArgs args, CustomResourceOptions options)
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 int
Pet Pet
age Integer
pet Pet
age number
pet Pet

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
Id string
The provider-assigned unique ID for this managed resource.
Name string
id String
The provider-assigned unique ID for this managed resource.
name String
id string
The provider-assigned unique ID for this managed resource.
name string
id str
The provider-assigned unique ID for this managed resource.
name str
id String
The provider-assigned unique ID for this managed resource.
name String

Supporting Types

Pet, PetArgs

RequiredName Pulumi.Random.RandomPet
This type is defined in the random package.
RequiredNameArray List<Pulumi.Random.RandomPet>
RequiredNameMap Dictionary<string, Pulumi.Random.RandomPet>
Age int
Name Pulumi.Random.RandomPet
This type is defined in the random package.
NameArray List<Pulumi.Random.RandomPet>
NameMap Dictionary<string, Pulumi.Random.RandomPet>
RequiredName RandomPet
This type is defined in the random package.
RequiredNameArray RandomPet
RequiredNameMap RandomPet
Age int
Name RandomPet
This type is defined in the random package.
NameArray RandomPet
NameMap RandomPet
requiredName RandomPet
This type is defined in the random package.
requiredNameArray List<RandomPet>
requiredNameMap Map<String,RandomPet>
age Integer
name RandomPet
This type is defined in the random package.
nameArray List<RandomPet>
nameMap Map<String,RandomPet>
requiredName pulumiRandomRandomPet
This type is defined in the random package.
requiredNameArray pulumiRandomRandomPet[]
requiredNameMap {[key: string]: pulumiRandomRandomPet}
age number
name pulumiRandomRandomPet
This type is defined in the random package.
nameArray pulumiRandomRandomPet[]
nameMap {[key: string]: pulumiRandomRandomPet}
required_name pulumi_random.RandomPet
This type is defined in the random package.
required_name_array Sequence[pulumi_random.RandomPet]
required_name_map Mapping[str, pulumi_random.RandomPet]
age int
name pulumi_random.RandomPet
This type is defined in the random package.
name_array Sequence[pulumi_random.RandomPet]
name_map Mapping[str, pulumi_random.RandomPet]
requiredName random:RandomPet
This type is defined in the random package.
requiredNameArray List<random:RandomPet>
requiredNameMap Map<random:RandomPet>
age Number
name random:RandomPet
This type is defined in the random package.
nameArray List<random:RandomPet>
nameMap Map<random:RandomPet>

Package Details

Repository
example
License