ShareFile

class ShareFile : KotlinCustomResource

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleAccount = new azure.storage.Account("example", {
name: "azureteststorage",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const exampleShare = new azure.storage.Share("example", {
name: "sharename",
storageAccountName: exampleAccount.name,
quota: 50,
});
const exampleShareFile = new azure.storage.ShareFile("example", {
name: "my-awesome-content.zip",
storageShareId: exampleShare.id,
source: "some-local-file.zip",
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_account = azure.storage.Account("example",
name="azureteststorage",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="LRS")
example_share = azure.storage.Share("example",
name="sharename",
storage_account_name=example_account.name,
quota=50)
example_share_file = azure.storage.ShareFile("example",
name="my-awesome-content.zip",
storage_share_id=example_share.id,
source="some-local-file.zip")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "azureteststorage",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var exampleShare = new Azure.Storage.Share("example", new()
{
Name = "sharename",
StorageAccountName = exampleAccount.Name,
Quota = 50,
});
var exampleShareFile = new Azure.Storage.ShareFile("example", new()
{
Name = "my-awesome-content.zip",
StorageShareId = exampleShare.Id,
Source = "some-local-file.zip",
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("azureteststorage"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
})
if err != nil {
return err
}
exampleShare, err := storage.NewShare(ctx, "example", &storage.ShareArgs{
Name: pulumi.String("sharename"),
StorageAccountName: exampleAccount.Name,
Quota: pulumi.Int(50),
})
if err != nil {
return err
}
_, err = storage.NewShareFile(ctx, "example", &storage.ShareFileArgs{
Name: pulumi.String("my-awesome-content.zip"),
StorageShareId: exampleShare.ID(),
Source: pulumi.String("some-local-file.zip"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.Share;
import com.pulumi.azure.storage.ShareArgs;
import com.pulumi.azure.storage.ShareFile;
import com.pulumi.azure.storage.ShareFileArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("azureteststorage")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var exampleShare = new Share("exampleShare", ShareArgs.builder()
.name("sharename")
.storageAccountName(exampleAccount.name())
.quota(50)
.build());
var exampleShareFile = new ShareFile("exampleShareFile", ShareFileArgs.builder()
.name("my-awesome-content.zip")
.storageShareId(exampleShare.id())
.source("some-local-file.zip")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: azureteststorage
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: LRS
exampleShare:
type: azure:storage:Share
name: example
properties:
name: sharename
storageAccountName: ${exampleAccount.name}
quota: 50
exampleShareFile:
type: azure:storage:ShareFile
name: example
properties:
name: my-awesome-content.zip
storageShareId: ${exampleShare.id}
source: some-local-file.zip

Import

Directories within an Azure Storage File Share can be imported using the resource id, e.g.

$ pulumi import azure:storage/shareFile:ShareFile example https://account1.file.core.windows.net/share1/file1

Properties

Link copied to clipboard

Sets the file’s Content-Disposition header.

Link copied to clipboard
val contentEncoding: Output<String>?

Specifies which content encodings have been applied to the file.

Link copied to clipboard
val contentLength: Output<Int>

The length in bytes of the file content

Link copied to clipboard
val contentMd5: Output<String>?
Link copied to clipboard
val contentType: Output<String>?

The content type of the share file. Defaults to application/octet-stream.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val metadata: Output<Map<String, String>>?

A mapping of metadata to assign to this file.

Link copied to clipboard
val name: Output<String>

The name (or path) of the File that should be created within this File Share. Changing this forces a new resource to be created.

Link copied to clipboard
val path: Output<String>?

The storage share directory that you would like the file placed into. Changing this forces a new resource to be created. Defaults to "".

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val source: Output<String>?

An absolute path to a file on the local system. Changing this forces a new resource to be created.

Link copied to clipboard
val storageShareId: Output<String>

The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.

Link copied to clipboard
val urn: Output<String>