Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.6.0 published on Friday, May 20, 2022 by Pulumi

getEncryptionScope

Use this data source to access information about an existing Storage Encryption Scope.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleAccount = Output.Create(Azure.Storage.GetAccount.InvokeAsync(new Azure.Storage.GetAccountArgs
        {
            Name = "storageaccountname",
            ResourceGroupName = "resourcegroupname",
        }));
        var exampleEncryptionScope = exampleAccount.Apply(exampleAccount => Output.Create(Azure.Storage.GetEncryptionScope.InvokeAsync(new Azure.Storage.GetEncryptionScopeArgs
        {
            Name = "existingStorageES",
            StorageAccountId = exampleAccount.Id,
        })));
        this.Id = exampleEncryptionScope.Apply(exampleEncryptionScope => exampleEncryptionScope.Id);
    }

    [Output("id")]
    public Output<string> Id { get; set; }
}
package main

import (
	"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 {
		exampleAccount, err := storage.LookupAccount(ctx, &storage.LookupAccountArgs{
			Name:              "storageaccountname",
			ResourceGroupName: pulumi.StringRef("resourcegroupname"),
		}, nil)
		if err != nil {
			return err
		}
		exampleEncryptionScope, err := storage.LookupEncryptionScope(ctx, &storage.LookupEncryptionScopeArgs{
			Name:             "existingStorageES",
			StorageAccountId: exampleAccount.Id,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", exampleEncryptionScope.Id)
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var exampleAccount = Output.of(StorageFunctions.getAccount(GetAccountArgs.builder()
            .name("storageaccountname")
            .resourceGroupName("resourcegroupname")
            .build()));

        final var exampleEncryptionScope = Output.of(StorageFunctions.getEncryptionScope(GetEncryptionScopeArgs.builder()
            .name("existingStorageES")
            .storageAccountId(exampleAccount.apply(getAccountResult -> getAccountResult.getId()))
            .build()));

        ctx.export("id", exampleEncryptionScope.apply(getEncryptionScopeResult -> getEncryptionScopeResult.getId()));
        }
}
import pulumi
import pulumi_azure as azure

example_account = azure.storage.get_account(name="storageaccountname",
    resource_group_name="resourcegroupname")
example_encryption_scope = azure.storage.get_encryption_scope(name="existingStorageES",
    storage_account_id=example_account.id)
pulumi.export("id", example_encryption_scope.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleAccount = azure.storage.getAccount({
    name: "storageaccountname",
    resourceGroupName: "resourcegroupname",
});
const exampleEncryptionScope = exampleAccount.then(exampleAccount => azure.storage.getEncryptionScope({
    name: "existingStorageES",
    storageAccountId: exampleAccount.id,
}));
export const id = exampleEncryptionScope.then(exampleEncryptionScope => exampleEncryptionScope.id);
variables:
  exampleAccount:
    Fn::Invoke:
      Function: azure:storage:getAccount
      Arguments:
        name: storageaccountname
        resourceGroupName: resourcegroupname
  exampleEncryptionScope:
    Fn::Invoke:
      Function: azure:storage:getEncryptionScope
      Arguments:
        name: existingStorageES
        storageAccountId: ${exampleAccount.id}
outputs:
  id: ${exampleEncryptionScope.id}

Using getEncryptionScope

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getEncryptionScope(args: GetEncryptionScopeArgs, opts?: InvokeOptions): Promise<GetEncryptionScopeResult>
function getEncryptionScopeOutput(args: GetEncryptionScopeOutputArgs, opts?: InvokeOptions): Output<GetEncryptionScopeResult>
def get_encryption_scope(name: Optional[str] = None,
                         storage_account_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetEncryptionScopeResult
def get_encryption_scope_output(name: Optional[pulumi.Input[str]] = None,
                         storage_account_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetEncryptionScopeResult]
func LookupEncryptionScope(ctx *Context, args *LookupEncryptionScopeArgs, opts ...InvokeOption) (*LookupEncryptionScopeResult, error)
func LookupEncryptionScopeOutput(ctx *Context, args *LookupEncryptionScopeOutputArgs, opts ...InvokeOption) LookupEncryptionScopeResultOutput

> Note: This function is named LookupEncryptionScope in the Go SDK.

public static class GetEncryptionScope 
{
    public static Task<GetEncryptionScopeResult> InvokeAsync(GetEncryptionScopeArgs args, InvokeOptions? opts = null)
    public static Output<GetEncryptionScopeResult> Invoke(GetEncryptionScopeInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetEncryptionScopeResult> getEncryptionScope(GetEncryptionScopeArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: azure:storage/getEncryptionScope:getEncryptionScope
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

The name of this Storage Encryption Scope.

StorageAccountId string

The ID of the Storage Account where this Storage Encryption Scope exists.

Name string

The name of this Storage Encryption Scope.

StorageAccountId string

The ID of the Storage Account where this Storage Encryption Scope exists.

name String

The name of this Storage Encryption Scope.

storageAccountId String

The ID of the Storage Account where this Storage Encryption Scope exists.

name string

The name of this Storage Encryption Scope.

storageAccountId string

The ID of the Storage Account where this Storage Encryption Scope exists.

name str

The name of this Storage Encryption Scope.

storage_account_id str

The ID of the Storage Account where this Storage Encryption Scope exists.

name String

The name of this Storage Encryption Scope.

storageAccountId String

The ID of the Storage Account where this Storage Encryption Scope exists.

getEncryptionScope Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

KeyVaultKeyId string

The ID of the Key Vault Key.

Name string
Source string

The source of the Storage Encryption Scope.

StorageAccountId string
Id string

The provider-assigned unique ID for this managed resource.

KeyVaultKeyId string

The ID of the Key Vault Key.

Name string
Source string

The source of the Storage Encryption Scope.

StorageAccountId string
id String

The provider-assigned unique ID for this managed resource.

keyVaultKeyId String

The ID of the Key Vault Key.

name String
source String

The source of the Storage Encryption Scope.

storageAccountId String
id string

The provider-assigned unique ID for this managed resource.

keyVaultKeyId string

The ID of the Key Vault Key.

name string
source string

The source of the Storage Encryption Scope.

storageAccountId string
id str

The provider-assigned unique ID for this managed resource.

key_vault_key_id str

The ID of the Key Vault Key.

name str
source str

The source of the Storage Encryption Scope.

storage_account_id str
id String

The provider-assigned unique ID for this managed resource.

keyVaultKeyId String

The ID of the Key Vault Key.

name String
source String

The source of the Storage Encryption Scope.

storageAccountId String

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.