1. Packages
  2. Azure Classic
  3. API Docs
  4. containerservice
  5. getRegistryToken

We recommend using Azure Native.

Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi

azure.containerservice.getRegistryToken

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi

    Use this data source to access information about an existing Container Registry token.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.containerservice.getRegistryToken({
        name: "exampletoken",
        resourceGroupName: "example-resource-group",
        containerRegistryName: "example-registry",
    });
    export const scopeMapId = example.then(example => example.scopeMapId);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.containerservice.get_registry_token(name="exampletoken",
        resource_group_name="example-resource-group",
        container_registry_name="example-registry")
    pulumi.export("scopeMapId", example.scope_map_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := containerservice.LookupRegistryToken(ctx, &containerservice.LookupRegistryTokenArgs{
    			Name:                  "exampletoken",
    			ResourceGroupName:     "example-resource-group",
    			ContainerRegistryName: "example-registry",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("scopeMapId", example.ScopeMapId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.ContainerService.GetRegistryToken.Invoke(new()
        {
            Name = "exampletoken",
            ResourceGroupName = "example-resource-group",
            ContainerRegistryName = "example-registry",
        });
    
        return new Dictionary<string, object?>
        {
            ["scopeMapId"] = example.Apply(getRegistryTokenResult => getRegistryTokenResult.ScopeMapId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.containerservice.ContainerserviceFunctions;
    import com.pulumi.azure.containerservice.inputs.GetRegistryTokenArgs;
    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) {
            final var example = ContainerserviceFunctions.getRegistryToken(GetRegistryTokenArgs.builder()
                .name("exampletoken")
                .resourceGroupName("example-resource-group")
                .containerRegistryName("example-registry")
                .build());
    
            ctx.export("scopeMapId", example.applyValue(getRegistryTokenResult -> getRegistryTokenResult.scopeMapId()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:containerservice:getRegistryToken
          Arguments:
            name: exampletoken
            resourceGroupName: example-resource-group
            containerRegistryName: example-registry
    outputs:
      scopeMapId: ${example.scopeMapId}
    

    Using getRegistryToken

    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 getRegistryToken(args: GetRegistryTokenArgs, opts?: InvokeOptions): Promise<GetRegistryTokenResult>
    function getRegistryTokenOutput(args: GetRegistryTokenOutputArgs, opts?: InvokeOptions): Output<GetRegistryTokenResult>
    def get_registry_token(container_registry_name: Optional[str] = None,
                           name: Optional[str] = None,
                           resource_group_name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetRegistryTokenResult
    def get_registry_token_output(container_registry_name: Optional[pulumi.Input[str]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           resource_group_name: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetRegistryTokenResult]
    func LookupRegistryToken(ctx *Context, args *LookupRegistryTokenArgs, opts ...InvokeOption) (*LookupRegistryTokenResult, error)
    func LookupRegistryTokenOutput(ctx *Context, args *LookupRegistryTokenOutputArgs, opts ...InvokeOption) LookupRegistryTokenResultOutput

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

    public static class GetRegistryToken 
    {
        public static Task<GetRegistryTokenResult> InvokeAsync(GetRegistryTokenArgs args, InvokeOptions? opts = null)
        public static Output<GetRegistryTokenResult> Invoke(GetRegistryTokenInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRegistryTokenResult> getRegistryToken(GetRegistryTokenArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:containerservice/getRegistryToken:getRegistryToken
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ContainerRegistryName string
    The Name of the Container Registry where the token exists.
    Name string
    The name of the Container Registry token.
    ResourceGroupName string
    The Name of the Resource Group where this Container Registry token exists.
    ContainerRegistryName string
    The Name of the Container Registry where the token exists.
    Name string
    The name of the Container Registry token.
    ResourceGroupName string
    The Name of the Resource Group where this Container Registry token exists.
    containerRegistryName String
    The Name of the Container Registry where the token exists.
    name String
    The name of the Container Registry token.
    resourceGroupName String
    The Name of the Resource Group where this Container Registry token exists.
    containerRegistryName string
    The Name of the Container Registry where the token exists.
    name string
    The name of the Container Registry token.
    resourceGroupName string
    The Name of the Resource Group where this Container Registry token exists.
    container_registry_name str
    The Name of the Container Registry where the token exists.
    name str
    The name of the Container Registry token.
    resource_group_name str
    The Name of the Resource Group where this Container Registry token exists.
    containerRegistryName String
    The Name of the Container Registry where the token exists.
    name String
    The name of the Container Registry token.
    resourceGroupName String
    The Name of the Resource Group where this Container Registry token exists.

    getRegistryToken Result

    The following output properties are available:

    ContainerRegistryName string
    Enabled bool
    Whether this Token is enabled.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    ResourceGroupName string
    ScopeMapId string
    The Scope Map ID used by the token.
    ContainerRegistryName string
    Enabled bool
    Whether this Token is enabled.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    ResourceGroupName string
    ScopeMapId string
    The Scope Map ID used by the token.
    containerRegistryName String
    enabled Boolean
    Whether this Token is enabled.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    resourceGroupName String
    scopeMapId String
    The Scope Map ID used by the token.
    containerRegistryName string
    enabled boolean
    Whether this Token is enabled.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    resourceGroupName string
    scopeMapId string
    The Scope Map ID used by the token.
    container_registry_name str
    enabled bool
    Whether this Token is enabled.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    resource_group_name str
    scope_map_id str
    The Scope Map ID used by the token.
    containerRegistryName String
    enabled Boolean
    Whether this Token is enabled.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    resourceGroupName String
    scopeMapId String
    The Scope Map ID used by the token.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi