pulumi/tests/testdata/codegen/plain-and-default/docs/moduleresource/_index.md

58 KiB


title: "ModuleResource" title_tag: "foobar.ModuleResource" meta_desc: "Documentation for the foobar.ModuleResource resource with examples, input properties, output properties, lookup functions, and supporting types." layout: api no_edit_this_page: true

Create ModuleResource Resource

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

Constructor syntax

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

@overload
def ModuleResource(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   plain_required_bool: Optional[bool] = None,
                   required_string: Optional[str] = None,
                   required_number: Optional[float] = None,
                   required_enum: Optional[EnumThing] = None,
                   required_bool: Optional[bool] = None,
                   plain_required_string: Optional[str] = None,
                   plain_required_number: Optional[float] = None,
                   optional_string: Optional[str] = None,
                   plain_optional_string: Optional[str] = None,
                   plain_optional_number: Optional[float] = None,
                   plain_optional_bool: Optional[bool] = None,
                   optional_bool: Optional[bool] = None,
                   optional_number: Optional[float] = None,
                   optional_enum: Optional[EnumThing] = None)
func NewModuleResource(ctx *Context, name string, args ModuleResourceArgs, opts ...ResourceOption) (*ModuleResource, error)
public ModuleResource(string name, ModuleResourceArgs args, CustomResourceOptions? opts = null)
public ModuleResource(String name, ModuleResourceArgs args)
public ModuleResource(String name, ModuleResourceArgs args, CustomResourceOptions options)
type: foobar:ModuleResource
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 ModuleResourceArgs
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 ModuleResourceArgs
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 ModuleResourceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ModuleResourceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ModuleResourceArgs
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 moduleResourceResource = new FooBar.ModuleResource("moduleResourceResource", new()
{
    PlainRequiredBool = false,
    RequiredString = "string",
    RequiredNumber = 0,
    RequiredEnum = FooBar.EnumThing.Four,
    RequiredBool = false,
    PlainRequiredString = "string",
    PlainRequiredNumber = 0,
    PlainRequiredConst = "string",
    OptionalString = "string",
    PlainOptionalString = "string",
    PlainOptionalNumber = 0,
    PlainOptionalConst = "string",
    PlainOptionalBool = false,
    OptionalBool = false,
    OptionalNumber = 0,
    OptionalEnum = FooBar.EnumThing.Four,
    OptionalConst = "string",
});
example, err := foobar.NewModuleResource(ctx, "moduleResourceResource", &foobar.ModuleResourceArgs{
	PlainRequiredBool:   false,
	RequiredString:      pulumi.String("string"),
	RequiredNumber:      pulumi.Float64(0),
	RequiredEnum:        foobar.EnumThingFour,
	RequiredBool:        pulumi.Bool(false),
	PlainRequiredString: "string",
	PlainRequiredNumber: 0,
	PlainRequiredConst:  "string",
	OptionalString:      pulumi.String("string"),
	PlainOptionalString: "string",
	PlainOptionalNumber: 0,
	PlainOptionalConst:  "string",
	PlainOptionalBool:   false,
	OptionalBool:        pulumi.Bool(false),
	OptionalNumber:      pulumi.Float64(0),
	OptionalEnum:        foobar.EnumThingFour,
	OptionalConst:       pulumi.String("string"),
})
var moduleResourceResource = new ModuleResource("moduleResourceResource", ModuleResourceArgs.builder()
    .plainRequiredBool(false)
    .requiredString("string")
    .requiredNumber(0)
    .requiredEnum(4)
    .requiredBool(false)
    .plainRequiredString("string")
    .plainRequiredNumber(0)
    .plainRequiredConst("string")
    .optionalString("string")
    .plainOptionalString("string")
    .plainOptionalNumber(0)
    .plainOptionalConst("string")
    .plainOptionalBool(false)
    .optionalBool(false)
    .optionalNumber(0)
    .optionalEnum(4)
    .optionalConst("string")
    .build());
module_resource_resource = foobar.ModuleResource("moduleResourceResource",
    plain_required_bool=False,
    required_string="string",
    required_number=0,
    required_enum=foobar.EnumThing.FOUR,
    required_bool=False,
    plain_required_string="string",
    plain_required_number=0,
    plain_required_const="string",
    optional_string="string",
    plain_optional_string="string",
    plain_optional_number=0,
    plain_optional_const="string",
    plain_optional_bool=False,
    optional_bool=False,
    optional_number=0,
    optional_enum=foobar.EnumThing.FOUR,
    optional_const="string")
const moduleResourceResource = new foobar.ModuleResource("moduleResourceResource", {
    plainRequiredBool: false,
    requiredString: "string",
    requiredNumber: 0,
    requiredEnum: foobar.EnumThing.Four,
    requiredBool: false,
    plainRequiredString: "string",
    plainRequiredNumber: 0,
    plainRequiredConst: "string",
    optionalString: "string",
    plainOptionalString: "string",
    plainOptionalNumber: 0,
    plainOptionalConst: "string",
    plainOptionalBool: false,
    optionalBool: false,
    optionalNumber: 0,
    optionalEnum: foobar.EnumThing.Four,
    optionalConst: "string",
});
type: foobar:ModuleResource
properties:
    optionalBool: false
    optionalConst: string
    optionalEnum: 4
    optionalNumber: 0
    optionalString: string
    plainOptionalBool: false
    plainOptionalConst: string
    plainOptionalNumber: 0
    plainOptionalString: string
    plainRequiredBool: false
    plainRequiredConst: string
    plainRequiredNumber: 0
    plainRequiredString: string
    requiredBool: false
    requiredEnum: 4
    requiredNumber: 0
    requiredString: string

ModuleResource 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 ModuleResource resource accepts the following input properties:

Outputs

All input properties are implicitly available as output properties. Additionally, the ModuleResource 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 str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Supporting Types

EnumThing, EnumThingArgs

Four
4
Six
6
Eight
8
EnumThingFour
4
EnumThingSix
6
EnumThingEight
8
Four
4
Six
6
Eight
8
Four
4
Six
6
Eight
8
FOUR
4
SIX
6
EIGHT
8
'\x04'
4
'\x06'
6
'\b'
8

Package Details

Repository
foobar
License