We recommend using Azure Native.
azure.media.Asset
Explore with Pulumi AI
Manages a Media Asset.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "media-resources",
location: "West Europe",
});
const exampleAccount = new azure.storage.Account("example", {
name: "examplestoracc",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "GRS",
});
const exampleServiceAccount = new azure.media.ServiceAccount("example", {
name: "examplemediaacc",
location: example.location,
resourceGroupName: example.name,
storageAccounts: [{
id: exampleAccount.id,
isPrimary: true,
}],
});
const exampleAsset = new azure.media.Asset("example", {
name: "Asset1",
resourceGroupName: example.name,
mediaServicesAccountName: exampleServiceAccount.name,
description: "Asset description",
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="media-resources",
location="West Europe")
example_account = azure.storage.Account("example",
name="examplestoracc",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="GRS")
example_service_account = azure.media.ServiceAccount("example",
name="examplemediaacc",
location=example.location,
resource_group_name=example.name,
storage_accounts=[azure.media.ServiceAccountStorageAccountArgs(
id=example_account.id,
is_primary=True,
)])
example_asset = azure.media.Asset("example",
name="Asset1",
resource_group_name=example.name,
media_services_account_name=example_service_account.name,
description="Asset description")
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media"
"github.com/pulumi/pulumi-azure/sdk/v5/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("media-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("examplestoracc"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("GRS"),
})
if err != nil {
return err
}
exampleServiceAccount, err := media.NewServiceAccount(ctx, "example", &media.ServiceAccountArgs{
Name: pulumi.String("examplemediaacc"),
Location: example.Location,
ResourceGroupName: example.Name,
StorageAccounts: media.ServiceAccountStorageAccountArray{
&media.ServiceAccountStorageAccountArgs{
Id: exampleAccount.ID(),
IsPrimary: pulumi.Bool(true),
},
},
})
if err != nil {
return err
}
_, err = media.NewAsset(ctx, "example", &media.AssetArgs{
Name: pulumi.String("Asset1"),
ResourceGroupName: example.Name,
MediaServicesAccountName: exampleServiceAccount.Name,
Description: pulumi.String("Asset description"),
})
if err != nil {
return err
}
return nil
})
}
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 = "media-resources",
Location = "West Europe",
});
var exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "examplestoracc",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "GRS",
});
var exampleServiceAccount = new Azure.Media.ServiceAccount("example", new()
{
Name = "examplemediaacc",
Location = example.Location,
ResourceGroupName = example.Name,
StorageAccounts = new[]
{
new Azure.Media.Inputs.ServiceAccountStorageAccountArgs
{
Id = exampleAccount.Id,
IsPrimary = true,
},
},
});
var exampleAsset = new Azure.Media.Asset("example", new()
{
Name = "Asset1",
ResourceGroupName = example.Name,
MediaServicesAccountName = exampleServiceAccount.Name,
Description = "Asset description",
});
});
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.media.ServiceAccount;
import com.pulumi.azure.media.ServiceAccountArgs;
import com.pulumi.azure.media.inputs.ServiceAccountStorageAccountArgs;
import com.pulumi.azure.media.Asset;
import com.pulumi.azure.media.AssetArgs;
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("media-resources")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("examplestoracc")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("GRS")
.build());
var exampleServiceAccount = new ServiceAccount("exampleServiceAccount", ServiceAccountArgs.builder()
.name("examplemediaacc")
.location(example.location())
.resourceGroupName(example.name())
.storageAccounts(ServiceAccountStorageAccountArgs.builder()
.id(exampleAccount.id())
.isPrimary(true)
.build())
.build());
var exampleAsset = new Asset("exampleAsset", AssetArgs.builder()
.name("Asset1")
.resourceGroupName(example.name())
.mediaServicesAccountName(exampleServiceAccount.name())
.description("Asset description")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: media-resources
location: West Europe
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: examplestoracc
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: GRS
exampleServiceAccount:
type: azure:media:ServiceAccount
name: example
properties:
name: examplemediaacc
location: ${example.location}
resourceGroupName: ${example.name}
storageAccounts:
- id: ${exampleAccount.id}
isPrimary: true
exampleAsset:
type: azure:media:Asset
name: example
properties:
name: Asset1
resourceGroupName: ${example.name}
mediaServicesAccountName: ${exampleServiceAccount.name}
description: Asset description
Create Asset Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Asset(name: string, args: AssetArgs, opts?: CustomResourceOptions);
@overload
def Asset(resource_name: str,
args: AssetArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Asset(resource_name: str,
opts: Optional[ResourceOptions] = None,
media_services_account_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
alternate_id: Optional[str] = None,
container: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
storage_account_name: Optional[str] = None)
func NewAsset(ctx *Context, name string, args AssetArgs, opts ...ResourceOption) (*Asset, error)
public Asset(string name, AssetArgs args, CustomResourceOptions? opts = null)
type: azure:media:Asset
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 AssetArgs
- 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 AssetArgs
- 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 AssetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AssetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AssetArgs
- 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 assetResource = new Azure.Media.Asset("assetResource", new()
{
MediaServicesAccountName = "string",
ResourceGroupName = "string",
AlternateId = "string",
Container = "string",
Description = "string",
Name = "string",
StorageAccountName = "string",
});
example, err := media.NewAsset(ctx, "assetResource", &media.AssetArgs{
MediaServicesAccountName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
AlternateId: pulumi.String("string"),
Container: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
StorageAccountName: pulumi.String("string"),
})
var assetResource = new Asset("assetResource", AssetArgs.builder()
.mediaServicesAccountName("string")
.resourceGroupName("string")
.alternateId("string")
.container("string")
.description("string")
.name("string")
.storageAccountName("string")
.build());
asset_resource = azure.media.Asset("assetResource",
media_services_account_name="string",
resource_group_name="string",
alternate_id="string",
container="string",
description="string",
name="string",
storage_account_name="string")
const assetResource = new azure.media.Asset("assetResource", {
mediaServicesAccountName: "string",
resourceGroupName: "string",
alternateId: "string",
container: "string",
description: "string",
name: "string",
storageAccountName: "string",
});
type: azure:media:Asset
properties:
alternateId: string
container: string
description: string
mediaServicesAccountName: string
name: string
resourceGroupName: string
storageAccountName: string
Asset 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 Asset resource accepts the following input properties:
- Media
Services stringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- Resource
Group stringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- Alternate
Id string - The alternate ID of the Asset.
- Container string
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- Description string
- The Asset description.
- Name string
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- Storage
Account stringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- Media
Services stringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- Resource
Group stringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- Alternate
Id string - The alternate ID of the Asset.
- Container string
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- Description string
- The Asset description.
- Name string
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- Storage
Account stringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- media
Services StringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- resource
Group StringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- alternate
Id String - The alternate ID of the Asset.
- container String
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- description String
- The Asset description.
- name String
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- storage
Account StringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- media
Services stringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- resource
Group stringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- alternate
Id string - The alternate ID of the Asset.
- container string
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- description string
- The Asset description.
- name string
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- storage
Account stringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- media_
services_ straccount_ name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- resource_
group_ strname - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- alternate_
id str - The alternate ID of the Asset.
- container str
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- description str
- The Asset description.
- name str
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- storage_
account_ strname - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- media
Services StringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- resource
Group StringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- alternate
Id String - The alternate ID of the Asset.
- container String
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- description String
- The Asset description.
- name String
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- storage
Account StringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Asset 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.
Look up Existing Asset Resource
Get an existing Asset 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?: AssetState, opts?: CustomResourceOptions): Asset
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
alternate_id: Optional[str] = None,
container: Optional[str] = None,
description: Optional[str] = None,
media_services_account_name: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
storage_account_name: Optional[str] = None) -> Asset
func GetAsset(ctx *Context, name string, id IDInput, state *AssetState, opts ...ResourceOption) (*Asset, error)
public static Asset Get(string name, Input<string> id, AssetState? state, CustomResourceOptions? opts = null)
public static Asset get(String name, Output<String> id, AssetState 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.
- Alternate
Id string - The alternate ID of the Asset.
- Container string
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- Description string
- The Asset description.
- Media
Services stringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- Name string
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- Resource
Group stringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- Storage
Account stringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- Alternate
Id string - The alternate ID of the Asset.
- Container string
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- Description string
- The Asset description.
- Media
Services stringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- Name string
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- Resource
Group stringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- Storage
Account stringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- alternate
Id String - The alternate ID of the Asset.
- container String
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- description String
- The Asset description.
- media
Services StringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- name String
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- resource
Group StringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- storage
Account StringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- alternate
Id string - The alternate ID of the Asset.
- container string
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- description string
- The Asset description.
- media
Services stringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- name string
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- resource
Group stringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- storage
Account stringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- alternate_
id str - The alternate ID of the Asset.
- container str
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- description str
- The Asset description.
- media_
services_ straccount_ name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- name str
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- resource_
group_ strname - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- storage_
account_ strname - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
- alternate
Id String - The alternate ID of the Asset.
- container String
- The name of the asset blob container. Changing this forces a new Media Asset to be created.
- description String
- The Asset description.
- media
Services StringAccount Name - Specifies the name of the Media Services Account. Changing this forces a new Media Asset to be created.
- name String
- The name which should be used for this Media Asset. Changing this forces a new Media Asset to be created.
- resource
Group StringName - The name of the Resource Group where the Media Asset should exist. Changing this forces a new Media Asset to be created.
- storage
Account StringName - The name of the storage account where to store the media asset. Changing this forces a new Media Asset to be created.
Import
Media Assets can be imported using the resource id
, e.g.
$ pulumi import azure:media/asset:Asset example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Media/mediaServices/account1/assets/asset1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.