1. Packages
  2. Gcore Provider
  3. API Docs
  4. RegistryCredential
gcore 0.19.0 published on Monday, Apr 14, 2025 by g-core

gcore.RegistryCredential

Explore with Pulumi AI

Represent inference registry credential

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";

const project = gcore.getProject({
    name: "Default",
});
const creds = new gcore.RegistryCredential("creds", {
    password: "passwd",
    registryUrl: "docker.io",
    username: "username",
});
Copy
import pulumi
import pulumi_gcore as gcore

project = gcore.get_project(name="Default")
creds = gcore.RegistryCredential("creds",
    password="passwd",
    registry_url="docker.io",
    username="username")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gcore.GetProject(ctx, &gcore.GetProjectArgs{
			Name: "Default",
		}, nil)
		if err != nil {
			return err
		}
		_, err = gcore.NewRegistryCredential(ctx, "creds", &gcore.RegistryCredentialArgs{
			Password:    pulumi.String("passwd"),
			RegistryUrl: pulumi.String("docker.io"),
			Username:    pulumi.String("username"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;

return await Deployment.RunAsync(() => 
{
    var project = Gcore.GetProject.Invoke(new()
    {
        Name = "Default",
    });

    var creds = new Gcore.RegistryCredential("creds", new()
    {
        Password = "passwd",
        RegistryUrl = "docker.io",
        Username = "username",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.GcoreFunctions;
import com.pulumi.gcore.inputs.GetProjectArgs;
import com.pulumi.gcore.RegistryCredential;
import com.pulumi.gcore.RegistryCredentialArgs;
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 project = GcoreFunctions.getProject(GetProjectArgs.builder()
            .name("Default")
            .build());

        var creds = new RegistryCredential("creds", RegistryCredentialArgs.builder()
            .password("passwd")
            .registryUrl("docker.io")
            .username("username")
            .build());

    }
}
Copy
resources:
  creds:
    type: gcore:RegistryCredential
    properties:
      password: passwd
      registryUrl: docker.io
      username: username
variables:
  project:
    fn::invoke:
      function: gcore:getProject
      arguments:
        name: Default
Copy

Create RegistryCredential Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RegistryCredential(name: string, args: RegistryCredentialArgs, opts?: CustomResourceOptions);
@overload
def RegistryCredential(resource_name: str,
                       args: RegistryCredentialArgs,
                       opts: Optional[ResourceOptions] = None)

@overload
def RegistryCredential(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       password: Optional[str] = None,
                       registry_url: Optional[str] = None,
                       username: Optional[str] = None,
                       name: Optional[str] = None,
                       project_id: Optional[float] = None,
                       project_name: Optional[str] = None,
                       registry_credential_id: Optional[str] = None)
func NewRegistryCredential(ctx *Context, name string, args RegistryCredentialArgs, opts ...ResourceOption) (*RegistryCredential, error)
public RegistryCredential(string name, RegistryCredentialArgs args, CustomResourceOptions? opts = null)
public RegistryCredential(String name, RegistryCredentialArgs args)
public RegistryCredential(String name, RegistryCredentialArgs args, CustomResourceOptions options)
type: gcore:RegistryCredential
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RegistryCredentialArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RegistryCredentialArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RegistryCredentialArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RegistryCredentialArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RegistryCredentialArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var registryCredentialResource = new Gcore.RegistryCredential("registryCredentialResource", new()
{
    Password = "string",
    RegistryUrl = "string",
    Username = "string",
    Name = "string",
    ProjectId = 0,
    ProjectName = "string",
    RegistryCredentialId = "string",
});
Copy
example, err := gcore.NewRegistryCredential(ctx, "registryCredentialResource", &gcore.RegistryCredentialArgs{
Password: pulumi.String("string"),
RegistryUrl: pulumi.String("string"),
Username: pulumi.String("string"),
Name: pulumi.String("string"),
ProjectId: pulumi.Float64(0),
ProjectName: pulumi.String("string"),
RegistryCredentialId: pulumi.String("string"),
})
Copy
var registryCredentialResource = new RegistryCredential("registryCredentialResource", RegistryCredentialArgs.builder()
    .password("string")
    .registryUrl("string")
    .username("string")
    .name("string")
    .projectId(0)
    .projectName("string")
    .registryCredentialId("string")
    .build());
Copy
registry_credential_resource = gcore.RegistryCredential("registryCredentialResource",
    password="string",
    registry_url="string",
    username="string",
    name="string",
    project_id=0,
    project_name="string",
    registry_credential_id="string")
Copy
const registryCredentialResource = new gcore.RegistryCredential("registryCredentialResource", {
    password: "string",
    registryUrl: "string",
    username: "string",
    name: "string",
    projectId: 0,
    projectName: "string",
    registryCredentialId: "string",
});
Copy
type: gcore:RegistryCredential
properties:
    name: string
    password: string
    projectId: 0
    projectName: string
    registryCredentialId: string
    registryUrl: string
    username: string
Copy

RegistryCredential Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RegistryCredential resource accepts the following input properties:

Password This property is required. string
RegistryUrl This property is required. string
Username This property is required. string
Name string
ProjectId double
ProjectName string
RegistryCredentialId string
The ID of this resource.
Password This property is required. string
RegistryUrl This property is required. string
Username This property is required. string
Name string
ProjectId float64
ProjectName string
RegistryCredentialId string
The ID of this resource.
password This property is required. String
registryUrl This property is required. String
username This property is required. String
name String
projectId Double
projectName String
registryCredentialId String
The ID of this resource.
password This property is required. string
registryUrl This property is required. string
username This property is required. string
name string
projectId number
projectName string
registryCredentialId string
The ID of this resource.
password This property is required. str
registry_url This property is required. str
username This property is required. str
name str
project_id float
project_name str
registry_credential_id str
The ID of this resource.
password This property is required. String
registryUrl This property is required. String
username This property is required. String
name String
projectId Number
projectName String
registryCredentialId String
The ID of this resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the RegistryCredential resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing RegistryCredential Resource

Get an existing RegistryCredential resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RegistryCredentialState, opts?: CustomResourceOptions): RegistryCredential
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        project_id: Optional[float] = None,
        project_name: Optional[str] = None,
        registry_credential_id: Optional[str] = None,
        registry_url: Optional[str] = None,
        username: Optional[str] = None) -> RegistryCredential
func GetRegistryCredential(ctx *Context, name string, id IDInput, state *RegistryCredentialState, opts ...ResourceOption) (*RegistryCredential, error)
public static RegistryCredential Get(string name, Input<string> id, RegistryCredentialState? state, CustomResourceOptions? opts = null)
public static RegistryCredential get(String name, Output<String> id, RegistryCredentialState state, CustomResourceOptions options)
resources:  _:    type: gcore:RegistryCredential    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Name string
Password string
ProjectId double
ProjectName string
RegistryCredentialId string
The ID of this resource.
RegistryUrl string
Username string
Name string
Password string
ProjectId float64
ProjectName string
RegistryCredentialId string
The ID of this resource.
RegistryUrl string
Username string
name String
password String
projectId Double
projectName String
registryCredentialId String
The ID of this resource.
registryUrl String
username String
name string
password string
projectId number
projectName string
registryCredentialId string
The ID of this resource.
registryUrl string
username string
name str
password str
project_id float
project_name str
registry_credential_id str
The ID of this resource.
registry_url str
username str
name String
password String
projectId Number
projectName String
registryCredentialId String
The ID of this resource.
registryUrl String
username String

Import

import using <project_id>:<credentials_name> format

$ pulumi import gcore:index/registryCredential:RegistryCredential dockerio 1:docekrio
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
gcore g-core/terraform-provider-gcore
License
Notes
This Pulumi package is based on the gcore Terraform Provider.