azure.containerapp.EnvironmentStorage

Manages a Container App Environment Storage.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        Sku = "PerGB2018",
        RetentionInDays = 30,
    });

    var exampleEnvironment = new Azure.ContainerApp.Environment("exampleEnvironment", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id,
    });

    var exampleAccount = new Azure.Storage.Account("exampleAccount", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
        AccountTier = "Standard",
        AccountReplicationType = "LRS",
    });

    var exampleShare = new Azure.Storage.Share("exampleShare", new()
    {
        StorageAccountName = exampleAccount.Name,
        Quota = 5,
    });

    var exampleEnvironmentStorage = new Azure.ContainerApp.EnvironmentStorage("exampleEnvironmentStorage", new()
    {
        ContainerAppEnvironmentId = exampleEnvironment.Id,
        AccountName = exampleAccount.Name,
        ShareName = exampleShare.Name,
        AccessKey = exampleAccount.PrimaryAccessKey,
        AccessMode = "ReadOnly",
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights"
	"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 {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			Sku:               pulumi.String("PerGB2018"),
			RetentionInDays:   pulumi.Int(30),
		})
		if err != nil {
			return err
		}
		exampleEnvironment, err := containerapp.NewEnvironment(ctx, "exampleEnvironment", &containerapp.EnvironmentArgs{
			Location:                exampleResourceGroup.Location,
			ResourceGroupName:       exampleResourceGroup.Name,
			LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(),
		})
		if err != nil {
			return err
		}
		exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
			ResourceGroupName:      exampleResourceGroup.Name,
			Location:               exampleResourceGroup.Location,
			AccountTier:            pulumi.String("Standard"),
			AccountReplicationType: pulumi.String("LRS"),
		})
		if err != nil {
			return err
		}
		exampleShare, err := storage.NewShare(ctx, "exampleShare", &storage.ShareArgs{
			StorageAccountName: exampleAccount.Name,
			Quota:              pulumi.Int(5),
		})
		if err != nil {
			return err
		}
		_, err = containerapp.NewEnvironmentStorage(ctx, "exampleEnvironmentStorage", &containerapp.EnvironmentStorageArgs{
			ContainerAppEnvironmentId: exampleEnvironment.ID(),
			AccountName:               exampleAccount.Name,
			ShareName:                 exampleShare.Name,
			AccessKey:                 exampleAccount.PrimaryAccessKey,
			AccessMode:                pulumi.String("ReadOnly"),
		})
		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.operationalinsights.AnalyticsWorkspace;
import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
import com.pulumi.azure.containerapp.Environment;
import com.pulumi.azure.containerapp.EnvironmentArgs;
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.containerapp.EnvironmentStorage;
import com.pulumi.azure.containerapp.EnvironmentStorageArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .sku("PerGB2018")
            .retentionInDays(30)
            .build());

        var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .logAnalyticsWorkspaceId(exampleAnalyticsWorkspace.id())
            .build());

        var exampleAccount = new Account("exampleAccount", AccountArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .accountTier("Standard")
            .accountReplicationType("LRS")
            .build());

        var exampleShare = new Share("exampleShare", ShareArgs.builder()        
            .storageAccountName(exampleAccount.name())
            .quota(5)
            .build());

        var exampleEnvironmentStorage = new EnvironmentStorage("exampleEnvironmentStorage", EnvironmentStorageArgs.builder()        
            .containerAppEnvironmentId(exampleEnvironment.id())
            .accountName(exampleAccount.name())
            .shareName(exampleShare.name())
            .accessKey(exampleAccount.primaryAccessKey())
            .accessMode("ReadOnly")
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku="PerGB2018",
    retention_in_days=30)
example_environment = azure.containerapp.Environment("exampleEnvironment",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    log_analytics_workspace_id=example_analytics_workspace.id)
example_account = azure.storage.Account("exampleAccount",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    account_tier="Standard",
    account_replication_type="LRS")
example_share = azure.storage.Share("exampleShare",
    storage_account_name=example_account.name,
    quota=5)
example_environment_storage = azure.containerapp.EnvironmentStorage("exampleEnvironmentStorage",
    container_app_environment_id=example_environment.id,
    account_name=example_account.name,
    share_name=example_share.name,
    access_key=example_account.primary_access_key,
    access_mode="ReadOnly")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    sku: "PerGB2018",
    retentionInDays: 30,
});
const exampleEnvironment = new azure.containerapp.Environment("exampleEnvironment", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id,
});
const exampleAccount = new azure.storage.Account("exampleAccount", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});
const exampleShare = new azure.storage.Share("exampleShare", {
    storageAccountName: exampleAccount.name,
    quota: 5,
});
const exampleEnvironmentStorage = new azure.containerapp.EnvironmentStorage("exampleEnvironmentStorage", {
    containerAppEnvironmentId: exampleEnvironment.id,
    accountName: exampleAccount.name,
    shareName: exampleShare.name,
    accessKey: exampleAccount.primaryAccessKey,
    accessMode: "ReadOnly",
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleAnalyticsWorkspace:
    type: azure:operationalinsights:AnalyticsWorkspace
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      sku: PerGB2018
      retentionInDays: 30
  exampleEnvironment:
    type: azure:containerapp:Environment
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      logAnalyticsWorkspaceId: ${exampleAnalyticsWorkspace.id}
  exampleAccount:
    type: azure:storage:Account
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      accountTier: Standard
      accountReplicationType: LRS
  exampleShare:
    type: azure:storage:Share
    properties:
      storageAccountName: ${exampleAccount.name}
      quota: 5
  exampleEnvironmentStorage:
    type: azure:containerapp:EnvironmentStorage
    properties:
      containerAppEnvironmentId: ${exampleEnvironment.id}
      accountName: ${exampleAccount.name}
      shareName: ${exampleShare.name}
      accessKey: ${exampleAccount.primaryAccessKey}
      accessMode: ReadOnly

Create EnvironmentStorage Resource

new EnvironmentStorage(name: string, args: EnvironmentStorageArgs, opts?: CustomResourceOptions);
@overload
def EnvironmentStorage(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       access_key: Optional[str] = None,
                       access_mode: Optional[str] = None,
                       account_name: Optional[str] = None,
                       container_app_environment_id: Optional[str] = None,
                       name: Optional[str] = None,
                       share_name: Optional[str] = None)
@overload
def EnvironmentStorage(resource_name: str,
                       args: EnvironmentStorageArgs,
                       opts: Optional[ResourceOptions] = None)
func NewEnvironmentStorage(ctx *Context, name string, args EnvironmentStorageArgs, opts ...ResourceOption) (*EnvironmentStorage, error)
public EnvironmentStorage(string name, EnvironmentStorageArgs args, CustomResourceOptions? opts = null)
public EnvironmentStorage(String name, EnvironmentStorageArgs args)
public EnvironmentStorage(String name, EnvironmentStorageArgs args, CustomResourceOptions options)
type: azure:containerapp:EnvironmentStorage
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args EnvironmentStorageArgs
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 EnvironmentStorageArgs
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 EnvironmentStorageArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EnvironmentStorageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args EnvironmentStorageArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

AccessKey string

The Storage Account Access Key.

AccessMode string

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

AccountName string

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

ContainerAppEnvironmentId string

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

ShareName string

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

Name string

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

AccessKey string

The Storage Account Access Key.

AccessMode string

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

AccountName string

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

ContainerAppEnvironmentId string

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

ShareName string

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

Name string

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

accessKey String

The Storage Account Access Key.

accessMode String

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

accountName String

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

containerAppEnvironmentId String

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

shareName String

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

name String

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

accessKey string

The Storage Account Access Key.

accessMode string

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

accountName string

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

containerAppEnvironmentId string

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

shareName string

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

name string

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

access_key str

The Storage Account Access Key.

access_mode str

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

account_name str

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

container_app_environment_id str

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

share_name str

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

name str

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

accessKey String

The Storage Account Access Key.

accessMode String

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

accountName String

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

containerAppEnvironmentId String

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

shareName String

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

name String

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the EnvironmentStorage 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 EnvironmentStorage Resource

Get an existing EnvironmentStorage 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?: EnvironmentStorageState, opts?: CustomResourceOptions): EnvironmentStorage
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_key: Optional[str] = None,
        access_mode: Optional[str] = None,
        account_name: Optional[str] = None,
        container_app_environment_id: Optional[str] = None,
        name: Optional[str] = None,
        share_name: Optional[str] = None) -> EnvironmentStorage
func GetEnvironmentStorage(ctx *Context, name string, id IDInput, state *EnvironmentStorageState, opts ...ResourceOption) (*EnvironmentStorage, error)
public static EnvironmentStorage Get(string name, Input<string> id, EnvironmentStorageState? state, CustomResourceOptions? opts = null)
public static EnvironmentStorage get(String name, Output<String> id, EnvironmentStorageState 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.
The following state arguments are supported:
AccessKey string

The Storage Account Access Key.

AccessMode string

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

AccountName string

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

ContainerAppEnvironmentId string

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

Name string

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

ShareName string

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

AccessKey string

The Storage Account Access Key.

AccessMode string

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

AccountName string

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

ContainerAppEnvironmentId string

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

Name string

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

ShareName string

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

accessKey String

The Storage Account Access Key.

accessMode String

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

accountName String

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

containerAppEnvironmentId String

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

name String

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

shareName String

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

accessKey string

The Storage Account Access Key.

accessMode string

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

accountName string

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

containerAppEnvironmentId string

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

name string

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

shareName string

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

access_key str

The Storage Account Access Key.

access_mode str

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

account_name str

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

container_app_environment_id str

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

name str

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

share_name str

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

accessKey String

The Storage Account Access Key.

accessMode String

The access mode to connect this storage to the Container App. Possible values include ReadOnly and ReadWrite. Changing this forces a new resource to be created.

accountName String

The Azure Storage Account in which the Share to be used is located. Changing this forces a new resource to be created.

containerAppEnvironmentId String

The ID of the Container App Environment to which this storage belongs. Changing this forces a new resource to be created.

name String

The name for this Container App Environment Storage. Changing this forces a new resource to be created.

shareName String

The name of the Azure Storage Share to use. Changing this forces a new resource to be created.

Import

A Container App Environment Storage can be imported using the resource id, e.g.

 $ pulumi import azure:containerapp/environmentStorage:EnvironmentStorage example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.App/managedEnvironments/myEnvironment/storages/mystorage"

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.