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

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",
});
Copy
import pulumi
import pulumi_ionoscloud as ionoscloud

example = ionoscloud.get_container_registry_token(registry_id=ionoscloud_container_registry["example"]["id"],
    id="token_id")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ionoscloud:getContainerRegistryToken
      arguments:
        registryId: ${ionoscloud_container_registry.example.id}
        id: token_id
Copy

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",
});
Copy
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")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ionoscloud:getContainerRegistryToken
      arguments:
        registryId: ${ionoscloud_container_registry.example.id}
        name: container-registry-token-example
Copy

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,
});
Copy
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)
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ionoscloud:getContainerRegistryToken
      arguments:
        registryId: ${ionoscloud_container_registry.example.id}
        name: -example
        partialMatch: true
Copy

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>
Copy
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]
Copy
func LookupContainerRegistryToken(ctx *Context, args *LookupContainerRegistryTokenArgs, opts ...InvokeOption) (*LookupContainerRegistryTokenResult, error)
func LookupContainerRegistryTokenOutput(ctx *Context, args *LookupContainerRegistryTokenOutputArgs, opts ...InvokeOption) LookupContainerRegistryTokenResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetContainerRegistryTokenResult> getContainerRegistryToken(GetContainerRegistryTokenArgs args, InvokeOptions options)
public static Output<GetContainerRegistryTokenResult> getContainerRegistryToken(GetContainerRegistryTokenArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ionoscloud:index/getContainerRegistryToken:getContainerRegistryToken
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

RegistryId This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. string
  • expiry-date
Username This property is required. string
  • expiry-date
username This property is required. String
  • expiry-date
username This property is required. string
  • expiry-date
username This property is required. str
  • expiry-date
username This property is required. String
  • expiry-date

GetContainerRegistryTokenScope

Actions This property is required. List<string>
Name This property is required. 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 This property is required. string
Actions This property is required. []string
Name This property is required. 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 This property is required. string
actions This property is required. List<String>
name This property is required. 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 This property is required. String
actions This property is required. string[]
name This property is required. 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 This property is required. string
actions This property is required. Sequence[str]
name This property is required. 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 This property is required. str
actions This property is required. List<String>
name This property is required. 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 This property is required. 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.