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",
});
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:
- Registry
Id 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. - Partial
Match bool Whether partial matching is allowed or not when using name argument. Default value is false.
registry_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- Timeouts
Get
Container Registry Token Timeouts
- Registry
Id 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. - Partial
Match bool Whether partial matching is allowed or not when using name argument. Default value is false.
registry_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- Timeouts
Get
Container Registry Token Timeouts
- registry
Id 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. - partial
Match Boolean Whether partial matching is allowed or not when using name argument. Default value is false.
registry_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- timeouts
Get
Container Registry Token Timeouts
- registry
Id 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. - partial
Match boolean Whether partial matching is allowed or not when using name argument. Default value is false.
registry_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- timeouts
Get
Container Registry Token Timeouts
- 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 eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- timeouts
Get
Container Registry Token Timeouts
- registry
Id 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. - partial
Match Boolean Whether partial matching is allowed or not when using name argument. Default value is false.
registry_id
and eithername
orid
must be provided. If none, or both ofname
andid
are provided, the datasource will return an error.- timeouts Property Map
getContainerRegistryToken Result
The following output properties are available:
- Credentials
List<Get
Container Registry Token Credential> - Expiry
Date string - Id string
- Id of the container registry token.
- Name string
- Registry
Id string - Scopes
List<Get
Container Registry Token Scope> - Status string
- Partial
Match bool - Timeouts
Get
Container Registry Token Timeouts
- Credentials
[]Get
Container Registry Token Credential - Expiry
Date string - Id string
- Id of the container registry token.
- Name string
- Registry
Id string - Scopes
[]Get
Container Registry Token Scope - Status string
- Partial
Match bool - Timeouts
Get
Container Registry Token Timeouts
- credentials
List<Get
Container Registry Token Credential> - expiry
Date String - id String
- Id of the container registry token.
- name String
- registry
Id String - scopes
List<Get
Container Registry Token Scope> - status String
- partial
Match Boolean - timeouts
Get
Container Registry Token Timeouts
- credentials
Get
Container Registry Token Credential[] - expiry
Date string - id string
- Id of the container registry token.
- name string
- registry
Id string - scopes
Get
Container Registry Token Scope[] - status string
- partial
Match boolean - timeouts
Get
Container Registry Token Timeouts
- credentials
Sequence[Get
Container Registry Token Credential] - expiry_
date str - id str
- Id of the container registry token.
- name str
- registry_
id str - scopes
Sequence[Get
Container Registry Token Scope] - status str
- partial_
match bool - timeouts
Get
Container Registry Token Timeouts
- credentials List<Property Map>
- expiry
Date String - id String
- Id of the container registry token.
- name String
- registry
Id String - scopes List<Property Map>
- status String
- partial
Match 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
GetContainerRegistryTokenTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.