mirror of https://github.com/pulumi/pulumi.git
40 KiB
40 KiB
title: "ResourceWithAssets" title_tag: "example.ResourceWithAssets" meta_desc: "Documentation for the example.ResourceWithAssets resource with examples, input properties, output properties, lookup functions, and supporting types." layout: api no_edit_this_page: true
Create ResourceWithAssets Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ResourceWithAssets(name: string, args: ResourceWithAssetsArgs, opts?: CustomResourceOptions);
@overload
def ResourceWithAssets(resource_name: str,
args: ResourceWithAssetsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ResourceWithAssets(resource_name: str,
opts: Optional[ResourceOptions] = None,
source: Optional[Union[pulumi.Asset, pulumi.Archive]] = None,
archive: Optional[pulumi.Archive] = None,
nested: Optional[TypeWithAssetsArgs] = None)
func NewResourceWithAssets(ctx *Context, name string, args ResourceWithAssetsArgs, opts ...ResourceOption) (*ResourceWithAssets, error)
public ResourceWithAssets(string name, ResourceWithAssetsArgs args, CustomResourceOptions? opts = null)
public ResourceWithAssets(String name, ResourceWithAssetsArgs args)
public ResourceWithAssets(String name, ResourceWithAssetsArgs args, CustomResourceOptions options)
type: example:ResourceWithAssets
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 ResourceWithAssetsArgs
- 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 ResourceWithAssetsArgs
- 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 ResourceWithAssetsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResourceWithAssetsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ResourceWithAssetsArgs
- 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 resourceWithAssetsResource = new Example.ResourceWithAssets("resourceWithAssetsResource", new()
{
Source = new StringAsset("content"),
Archive = new FileArchive("./path/to/archive"),
Nested = new Example.Inputs.TypeWithAssetsArgs
{
Asset = new StringAsset("content"),
PlainArchive = new FileArchive("./path/to/archive"),
Archive = new FileArchive("./path/to/archive"),
PlainAsset = new StringAsset("content"),
},
});
example, err := example.NewResourceWithAssets(ctx, "resourceWithAssetsResource", &example.ResourceWithAssetsArgs{
Source: pulumi.NewStringAsset("content"),
Archive: pulumi.NewFileArchive("./path/to/archive"),
Nested: &example.TypeWithAssetsArgs{
Asset: pulumi.NewStringAsset("content"),
PlainArchive: pulumi.NewFileArchive("./path/to/archive"),
Archive: pulumi.NewFileArchive("./path/to/archive"),
PlainAsset: pulumi.NewStringAsset("content"),
},
})
var resourceWithAssetsResource = new ResourceWithAssets("resourceWithAssetsResource", ResourceWithAssetsArgs.builder()
.source(new StringAsset("content"))
.archive(new FileArchive("./path/to/archive"))
.nested(TypeWithAssetsArgs.builder()
.asset(new StringAsset("content"))
.plainArchive(new FileArchive("./path/to/archive"))
.archive(new FileArchive("./path/to/archive"))
.plainAsset(new StringAsset("content"))
.build())
.build());
resource_with_assets_resource = example.ResourceWithAssets("resourceWithAssetsResource",
source=pulumi.StringAsset("content"),
archive=pulumi.FileArchive("./path/to/archive"),
nested={
"asset": pulumi.StringAsset("content"),
"plain_archive": pulumi.FileArchive("./path/to/archive"),
"archive": pulumi.FileArchive("./path/to/archive"),
"plain_asset": pulumi.StringAsset("content"),
})
const resourceWithAssetsResource = new example.ResourceWithAssets("resourceWithAssetsResource", {
source: new pulumi.asset.StringAsset("content"),
archive: new pulumi.asset.FileArchive("./path/to/archive"),
nested: {
asset: new pulumi.asset.StringAsset("content"),
plainArchive: new pulumi.asset.FileArchive("./path/to/archive"),
archive: new pulumi.asset.FileArchive("./path/to/archive"),
plainAsset: new pulumi.asset.StringAsset("content"),
},
});
type: example:ResourceWithAssets
properties:
archive:
fn::FileArchive: ./path/to/archive
nested:
archive:
fn::FileArchive: ./path/to/archive
asset:
fn::StringAsset: content
plainArchive:
fn::FileArchive: ./path/to/archive
plainAsset:
fn::StringAsset: content
source:
fn::StringAsset: content
ResourceWithAssets 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 ResourceWithAssets resource accepts the following input properties:
-
Source
Asset
Or Archive - Archive Archive
-
Nested
Type
With Assets
-
Source
pulumi.
Asset Or Archive -
Archive
pulumi.
Archive -
Nested
Type
With Assets Args
-
source
Asset
Or Archive - archive Archive
-
nested
Type
With Assets
-
source
pulumi.asset.
Asset | pulumi.asset. Archive -
archive
pulumi.asset.
Archive -
nested
Type
With Assets
-
source
Union[pulumi.
Asset, pulumi. Archive] -
archive
pulumi.
Archive -
nested
Type
With Assets Args
- source Asset
- archive Archive
- nested Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the ResourceWithAssets resource produces the following output properties:
Supporting Types
TypeWithAssets, TypeWithAssetsArgs
-
Asset
Asset
Or Archive -
Plain
Archive Archive - Archive Archive
-
Plain
Asset AssetOr Archive
-
Asset
pulumi.
Asset Or Archive -
Plain
Archive pulumi.Archive -
Archive
pulumi.
Archive -
Plain
Asset pulumi.Asset Or Archive
-
asset
Asset
Or Archive -
plain
Archive Archive - archive Archive
-
plain
Asset AssetOr Archive
-
asset
pulumi.asset.
Asset | pulumi.asset. Archive -
plain
Archive pulumi.asset.Archive -
archive
pulumi.asset.
Archive -
plain
Asset pulumi.asset.Asset | pulumi.asset. Archive
-
asset
Union[pulumi.
Asset, pulumi. Archive] -
plain_
archive pulumi.Archive -
archive
pulumi.
Archive -
plain_
asset Union[pulumi.Asset, pulumi. Archive]
- asset Asset
-
plain
Archive Archive - archive Archive
-
plain
Asset Asset
Package Details
- Repository
- example
- License