1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. getContainerRegistryToken
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.getContainerRegistryToken

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    The Container Registry Token data source can be used to search for and return an existing Container Registry Token. You can provide a string for the name parameter which will be compared with provisioned Container Registry Token. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search and make sure that your resources have unique names.

    Example Usage

    By Id

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getContainerRegistryToken({
        registryId: ionoscloud_container_registry.example.id,
        id: "token_id",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_container_registry_token(registry_id=ionoscloud_container_registry["example"]["id"],
        id="token_id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupContainerRegistryToken(ctx, &ionoscloud.LookupContainerRegistryTokenArgs{
    			RegistryId: ionoscloud_container_registry.Example.Id,
    			Id:         pulumi.StringRef("token_id"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetContainerRegistryToken.Invoke(new()
        {
            RegistryId = ionoscloud_container_registry.Example.Id,
            Id = "token_id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetContainerRegistryTokenArgs;
    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 = IonoscloudFunctions.getContainerRegistryToken(GetContainerRegistryTokenArgs.builder()
                .registryId(ionoscloud_container_registry.example().id())
                .id("token_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getContainerRegistryToken
          arguments:
            registryId: ${ionoscloud_container_registry.example.id}
            id: token_id
    

    By Name

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getContainerRegistryToken({
        registryId: ionoscloud_container_registry.example.id,
        name: "container-registry-token-example",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_container_registry_token(registry_id=ionoscloud_container_registry["example"]["id"],
        name="container-registry-token-example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupContainerRegistryToken(ctx, &ionoscloud.LookupContainerRegistryTokenArgs{
    			RegistryId: ionoscloud_container_registry.Example.Id,
    			Name:       pulumi.StringRef("container-registry-token-example"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetContainerRegistryToken.Invoke(new()
        {
            RegistryId = ionoscloud_container_registry.Example.Id,
            Name = "container-registry-token-example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetContainerRegistryTokenArgs;
    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 = IonoscloudFunctions.getContainerRegistryToken(GetContainerRegistryTokenArgs.builder()
                .registryId(ionoscloud_container_registry.example().id())
                .name("container-registry-token-example")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getContainerRegistryToken
          arguments:
            registryId: ${ionoscloud_container_registry.example.id}
            name: container-registry-token-example
    

    By Name with Partial Match

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getContainerRegistryToken({
        registryId: ionoscloud_container_registry.example.id,
        name: "-example",
        partialMatch: true,
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_container_registry_token(registry_id=ionoscloud_container_registry["example"]["id"],
        name="-example",
        partial_match=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupContainerRegistryToken(ctx, &ionoscloud.LookupContainerRegistryTokenArgs{
    			RegistryId:   ionoscloud_container_registry.Example.Id,
    			Name:         pulumi.StringRef("-example"),
    			PartialMatch: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetContainerRegistryToken.Invoke(new()
        {
            RegistryId = ionoscloud_container_registry.Example.Id,
            Name = "-example",
            PartialMatch = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetContainerRegistryTokenArgs;
    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 = IonoscloudFunctions.getContainerRegistryToken(GetContainerRegistryTokenArgs.builder()
                .registryId(ionoscloud_container_registry.example().id())
                .name("-example")
                .partialMatch(true)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getContainerRegistryToken
          arguments:
            registryId: ${ionoscloud_container_registry.example.id}
            name: -example
            partialMatch: true
    

    Using getContainerRegistryToken

    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 getContainerRegistryToken(args: GetContainerRegistryTokenArgs, opts?: InvokeOptions): Promise<GetContainerRegistryTokenResult>
    function getContainerRegistryTokenOutput(args: GetContainerRegistryTokenOutputArgs, opts?: InvokeOptions): Output<GetContainerRegistryTokenResult>
    def get_container_registry_token(id: Optional[str] = None,
                                     name: Optional[str] = None,
                                     partial_match: Optional[bool] = None,
                                     registry_id: Optional[str] = None,
                                     timeouts: Optional[GetContainerRegistryTokenTimeouts] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetContainerRegistryTokenResult
    def get_container_registry_token_output(id: Optional[pulumi.Input[str]] = None,
                                     name: Optional[pulumi.Input[str]] = None,
                                     partial_match: Optional[pulumi.Input[bool]] = None,
                                     registry_id: Optional[pulumi.Input[str]] = None,
                                     timeouts: Optional[pulumi.Input[GetContainerRegistryTokenTimeoutsArgs]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetContainerRegistryTokenResult]
    func LookupContainerRegistryToken(ctx *Context, args *LookupContainerRegistryTokenArgs, opts ...InvokeOption) (*LookupContainerRegistryTokenResult, error)
    func LookupContainerRegistryTokenOutput(ctx *Context, args *LookupContainerRegistryTokenOutputArgs, opts ...InvokeOption) LookupContainerRegistryTokenResultOutput

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

    public static class GetContainerRegistryToken 
    {
        public static Task<GetContainerRegistryTokenResult> InvokeAsync(GetContainerRegistryTokenArgs args, InvokeOptions? opts = null)
        public static Output<GetContainerRegistryTokenResult> Invoke(GetContainerRegistryTokenInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetContainerRegistryTokenResult> getContainerRegistryToken(GetContainerRegistryTokenArgs args, InvokeOptions options)
    public static Output<GetContainerRegistryTokenResult> getContainerRegistryToken(GetContainerRegistryTokenArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:index/getContainerRegistryToken:getContainerRegistryToken
      arguments:
        # arguments dictionary

    The following arguments are supported:

    RegistryId string
    Registry's UUID.
    Id string
    ID of the container registry token you want to search for.
    Name string
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    PartialMatch bool

    Whether partial matching is allowed or not when using name argument. Default value is false.

    registry_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    Timeouts GetContainerRegistryTokenTimeouts
    RegistryId string
    Registry's UUID.
    Id string
    ID of the container registry token you want to search for.
    Name string
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    PartialMatch bool

    Whether partial matching is allowed or not when using name argument. Default value is false.

    registry_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    Timeouts GetContainerRegistryTokenTimeouts
    registryId String
    Registry's UUID.
    id String
    ID of the container registry token you want to search for.
    name String
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    partialMatch Boolean

    Whether partial matching is allowed or not when using name argument. Default value is false.

    registry_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    timeouts GetContainerRegistryTokenTimeouts
    registryId string
    Registry's UUID.
    id string
    ID of the container registry token you want to search for.
    name string
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    partialMatch boolean

    Whether partial matching is allowed or not when using name argument. Default value is false.

    registry_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    timeouts GetContainerRegistryTokenTimeouts
    registry_id str
    Registry's UUID.
    id str
    ID of the container registry token you want to search for.
    name str
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    partial_match bool

    Whether partial matching is allowed or not when using name argument. Default value is false.

    registry_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    timeouts GetContainerRegistryTokenTimeouts
    registryId String
    Registry's UUID.
    id String
    ID of the container registry token you want to search for.
    name String
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    partialMatch Boolean

    Whether partial matching is allowed or not when using name argument. Default value is false.

    registry_id and either name or id must be provided. If none, or both of name and id are provided, the datasource will return an error.

    timeouts Property Map

    getContainerRegistryToken Result

    The following output properties are available:

    credentials List<Property Map>
    expiryDate String
    id String
    Id of the container registry token.
    name String
    registryId String
    scopes List<Property Map>
    status String
    partialMatch Boolean
    timeouts Property Map

    Supporting Types

    GetContainerRegistryTokenCredential

    Username string
    • expiry-date
    Username string
    • expiry-date
    username String
    • expiry-date
    username string
    • expiry-date
    username str
    • expiry-date
    username String
    • expiry-date

    GetContainerRegistryTokenScope

    Actions List<string>
    Name string
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    Type string
    Actions []string
    Name string
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    Type string
    actions List<String>
    name String
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    type String
    actions string[]
    name string
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    type string
    actions Sequence[str]
    name str
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    type str
    actions List<String>
    name String
    Name of an existing container registry token that you want to search for. Search by name is case-insensitive. The whole resource name is required if partial_match parameter is not set to true.
    type String

    GetContainerRegistryTokenTimeouts

    Create string
    Default string
    Delete string
    Update string
    Create string
    Default string
    Delete string
    Update string
    create String
    default_ String
    delete String
    update String
    create string
    default string
    delete string
    update string
    create String
    default String
    delete String
    update String

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud