Azure Classic v5.43.0, May 6 23
Azure Classic v5.43.0, May 6 23
azure.compute.ManagedDiskSasToken
Explore with Pulumi AI
Manages a Disk SAS Token.
Use this resource to obtain a Shared Access Signature (SAS Token) for an existing Managed Disk.
Shared access signatures allow fine-grained, ephemeral access control to various aspects of Managed Disk similar to blob/storage account container.
With the help of this resource, data from the disk can be copied from managed disk to a storage blob or to some other system without the need of azcopy.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var testResourceGroup = new Azure.Core.ResourceGroup("testResourceGroup", new()
{
Location = "West Europe",
});
var testManagedDisk = new Azure.Compute.ManagedDisk("testManagedDisk", new()
{
Location = testResourceGroup.Location,
ResourceGroupName = testResourceGroup.Name,
StorageAccountType = "Standard_LRS",
CreateOption = "Empty",
DiskSizeGb = 1,
});
var testManagedDiskSasToken = new Azure.Compute.ManagedDiskSasToken("testManagedDiskSasToken", new()
{
ManagedDiskId = testManagedDisk.Id,
DurationInSeconds = 300,
AccessLevel = "Read",
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
testResourceGroup, err := core.NewResourceGroup(ctx, "testResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
testManagedDisk, err := compute.NewManagedDisk(ctx, "testManagedDisk", &compute.ManagedDiskArgs{
Location: testResourceGroup.Location,
ResourceGroupName: testResourceGroup.Name,
StorageAccountType: pulumi.String("Standard_LRS"),
CreateOption: pulumi.String("Empty"),
DiskSizeGb: pulumi.Int(1),
})
if err != nil {
return err
}
_, err = compute.NewManagedDiskSasToken(ctx, "testManagedDiskSasToken", &compute.ManagedDiskSasTokenArgs{
ManagedDiskId: testManagedDisk.ID(),
DurationInSeconds: pulumi.Int(300),
AccessLevel: pulumi.String("Read"),
})
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.compute.ManagedDisk;
import com.pulumi.azure.compute.ManagedDiskArgs;
import com.pulumi.azure.compute.ManagedDiskSasToken;
import com.pulumi.azure.compute.ManagedDiskSasTokenArgs;
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 testResourceGroup = new ResourceGroup("testResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var testManagedDisk = new ManagedDisk("testManagedDisk", ManagedDiskArgs.builder()
.location(testResourceGroup.location())
.resourceGroupName(testResourceGroup.name())
.storageAccountType("Standard_LRS")
.createOption("Empty")
.diskSizeGb("1")
.build());
var testManagedDiskSasToken = new ManagedDiskSasToken("testManagedDiskSasToken", ManagedDiskSasTokenArgs.builder()
.managedDiskId(testManagedDisk.id())
.durationInSeconds(300)
.accessLevel("Read")
.build());
}
}
import pulumi
import pulumi_azure as azure
test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="West Europe")
test_managed_disk = azure.compute.ManagedDisk("testManagedDisk",
location=test_resource_group.location,
resource_group_name=test_resource_group.name,
storage_account_type="Standard_LRS",
create_option="Empty",
disk_size_gb=1)
test_managed_disk_sas_token = azure.compute.ManagedDiskSasToken("testManagedDiskSasToken",
managed_disk_id=test_managed_disk.id,
duration_in_seconds=300,
access_level="Read")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const testResourceGroup = new azure.core.ResourceGroup("testResourceGroup", {location: "West Europe"});
const testManagedDisk = new azure.compute.ManagedDisk("testManagedDisk", {
location: testResourceGroup.location,
resourceGroupName: testResourceGroup.name,
storageAccountType: "Standard_LRS",
createOption: "Empty",
diskSizeGb: 1,
});
const testManagedDiskSasToken = new azure.compute.ManagedDiskSasToken("testManagedDiskSasToken", {
managedDiskId: testManagedDisk.id,
durationInSeconds: 300,
accessLevel: "Read",
});
resources:
testResourceGroup:
type: azure:core:ResourceGroup
properties:
location: West Europe
testManagedDisk:
type: azure:compute:ManagedDisk
properties:
location: ${testResourceGroup.location}
resourceGroupName: ${testResourceGroup.name}
storageAccountType: Standard_LRS
createOption: Empty
diskSizeGb: '1'
testManagedDiskSasToken:
type: azure:compute:ManagedDiskSasToken
properties:
managedDiskId: ${testManagedDisk.id}
durationInSeconds: 300
accessLevel: Read
Create ManagedDiskSasToken Resource
new ManagedDiskSasToken(name: string, args: ManagedDiskSasTokenArgs, opts?: CustomResourceOptions);
@overload
def ManagedDiskSasToken(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_level: Optional[str] = None,
duration_in_seconds: Optional[int] = None,
managed_disk_id: Optional[str] = None)
@overload
def ManagedDiskSasToken(resource_name: str,
args: ManagedDiskSasTokenArgs,
opts: Optional[ResourceOptions] = None)
func NewManagedDiskSasToken(ctx *Context, name string, args ManagedDiskSasTokenArgs, opts ...ResourceOption) (*ManagedDiskSasToken, error)
public ManagedDiskSasToken(string name, ManagedDiskSasTokenArgs args, CustomResourceOptions? opts = null)
public ManagedDiskSasToken(String name, ManagedDiskSasTokenArgs args)
public ManagedDiskSasToken(String name, ManagedDiskSasTokenArgs args, CustomResourceOptions options)
type: azure:compute:ManagedDiskSasToken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagedDiskSasTokenArgs
- 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 ManagedDiskSasTokenArgs
- 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 ManagedDiskSasTokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagedDiskSasTokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ManagedDiskSasTokenArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ManagedDiskSasToken Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ManagedDiskSasToken resource accepts the following input properties:
- Access
Level string The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- Duration
In intSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- Managed
Disk stringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- Access
Level string The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- Duration
In intSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- Managed
Disk stringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- access
Level String The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- duration
In IntegerSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- managed
Disk StringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- access
Level string The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- duration
In numberSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- managed
Disk stringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- access_
level str The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- duration_
in_ intseconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- managed_
disk_ strid The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- access
Level String The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- duration
In NumberSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- managed
Disk StringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the ManagedDiskSasToken resource produces the following output properties:
Look up Existing ManagedDiskSasToken Resource
Get an existing ManagedDiskSasToken resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ManagedDiskSasTokenState, opts?: CustomResourceOptions): ManagedDiskSasToken
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_level: Optional[str] = None,
duration_in_seconds: Optional[int] = None,
managed_disk_id: Optional[str] = None,
sas_url: Optional[str] = None) -> ManagedDiskSasToken
func GetManagedDiskSasToken(ctx *Context, name string, id IDInput, state *ManagedDiskSasTokenState, opts ...ResourceOption) (*ManagedDiskSasToken, error)
public static ManagedDiskSasToken Get(string name, Input<string> id, ManagedDiskSasTokenState? state, CustomResourceOptions? opts = null)
public static ManagedDiskSasToken get(String name, Output<String> id, ManagedDiskSasTokenState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Access
Level string The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- Duration
In intSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- Managed
Disk stringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- Sas
Url string The computed Shared Access Signature (SAS) of the Managed Disk.
- Access
Level string The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- Duration
In intSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- Managed
Disk stringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- Sas
Url string The computed Shared Access Signature (SAS) of the Managed Disk.
- access
Level String The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- duration
In IntegerSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- managed
Disk StringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- sas
Url String The computed Shared Access Signature (SAS) of the Managed Disk.
- access
Level string The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- duration
In numberSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- managed
Disk stringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- sas
Url string The computed Shared Access Signature (SAS) of the Managed Disk.
- access_
level str The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- duration_
in_ intseconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- managed_
disk_ strid The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- sas_
url str The computed Shared Access Signature (SAS) of the Managed Disk.
- access
Level String The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
- duration
In NumberSeconds The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
- managed
Disk StringId The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
- sas
Url String The computed Shared Access Signature (SAS) of the Managed Disk.
Import
Disk SAS Token can be imported using the resource id
, e.g.
$ pulumi import azure:compute/managedDiskSasToken:ManagedDiskSasToken example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/disks/manageddisk1
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.