Create Person Resource {#create}#

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax#

new Person(name: string, args?: PersonArgs, opts?: CustomResourceOptions);
@overload
def Person(resource_name: str,
           args: Optional[PersonArgs] = None,
           opts: Optional[ResourceOptions] = None)

@overload
def Person(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           name: Optional[str] = None,
           pets: Optional[Sequence[PetArgs]] = None)
func NewPerson(ctx *Context, name string, args *PersonArgs, opts ...ResourceOption) (*Person, error)
public Person(string name, PersonArgs? args = null, CustomResourceOptions? opts = null)
public Person(String name, PersonArgs args)
public Person(String name, PersonArgs args, CustomResourceOptions options)
type: example:Person
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

resource "example_person" "name" {
    # resource properties
}

Parameters#

name string
The unique name of the resource.
args PersonArgs
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 PersonArgs
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 PersonArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PersonArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args PersonArgs
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 personResource = new Example.Person("personResource", new()
{
    Name = "string",
    Pets = new[]
    {
        new Example.Inputs.PetArgs
        {
            Name = "string",
        },
    },
});
example, err := example.NewPerson(ctx, "personResource", &example.PersonArgs{
	Name: pulumi.String("string"),
	Pets: example.PetTypeArray{
		&example.PetTypeArgs{
			Name: pulumi.String("string"),
		},
	},
})
resource "example_person" "personResource" {
  lifecycle {
    create_before_destroy = true
  }
  name = "string"
  pets {
    name = "string"
  }
}
var personResource = new Person("personResource", PersonArgs.builder()
    .name("string")
    .pets(com.pulumi.example.inputs.PetArgs.builder()
        .name("string")
        .build())
    .build());
person_resource = example.Person("personResource",
    name="string",
    pets=[{
        "name": "string",
    }])
const personResource = new example.Person("personResource", {
    name: "string",
    pets: [{
        name: "string",
    }],
});
type: example:Person
properties:
    name: string
    pets:
        - name: string

Person Resource Properties {#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 Person resource accepts the following input properties:

name string
pets Pet[]

Outputs#

All input properties are implicitly available as output properties. Additionally, the Person 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 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.

Supporting Types#

Pet, PetArgs

Name string
Name string
name string
name String
name string
name str
name String

Package Details

Repository
example
License

Was this page helpful?