mirror of https://github.com/pulumi/pulumi.git
22 KiB
22 KiB
title: "Resource" title_tag: "example.Resource" meta_desc: "Documentation for the example.Resource resource with examples, input properties, output properties, lookup functions, and supporting types." layout: api no_edit_this_page: true
Create Resource Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Resource(name: string, args?: ResourceArgs, opts?: CustomResourceOptions);
@overload
def Resource(resource_name: str,
args: Optional[ResourceArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Resource(resource_name: str,
opts: Optional[ResourceOptions] = None,
bar: Optional[str] = None)
func NewResource(ctx *Context, name string, args *ResourceArgs, opts ...ResourceOption) (*Resource, error)
public Resource(string name, ResourceArgs? args = null, CustomResourceOptions? opts = null)
public Resource(String name, ResourceArgs args)
public Resource(String name, ResourceArgs args, CustomResourceOptions options)
type: example:Resource
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 ResourceArgs
- 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 ResourceArgs
- 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 ResourceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResourceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ResourceArgs
- 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 resourceResource = new Example.Resource("resourceResource", new()
{
Bar = "string",
});
example, err := example.NewResource(ctx, "resourceResource", &example.ResourceArgs{
Bar: pulumi.String("string"),
})
var resourceResource = new Resource("resourceResource", ResourceArgs.builder()
.bar("string")
.build());
resource_resource = example.Resource("resourceResource", bar="string")
const resourceResource = new example.Resource("resourceResource", {bar: "string"});
type: example:Resource
properties:
bar: string
Resource 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 Resource resource accepts the following input properties:
- Bar string
- Bar string
- bar String
- bar string
- bar str
- bar String
Outputs
All input properties are implicitly available as output properties. Additionally, the Resource resource produces the following output properties:
Package Details
- Repository
- example
- License