DigitalOcean

v4.16.0 published on Wednesday, Sep 28, 2022 by Pulumi

ContainerRegistryDockerCredentials

Get Docker credentials for your DigitalOcean container registry.

An error is triggered if the provided container registry name does not exist.

Example Usage

Basic Example

using System.Collections.Generic;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var example = new DigitalOcean.ContainerRegistryDockerCredentials("example", new()
    {
        RegistryName = "example",
    });

});
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := digitalocean.NewContainerRegistryDockerCredentials(ctx, "example", &digitalocean.ContainerRegistryDockerCredentialsArgs{
			RegistryName: pulumi.String("example"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.ContainerRegistryDockerCredentials;
import com.pulumi.digitalocean.ContainerRegistryDockerCredentialsArgs;
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) {
        var example = new ContainerRegistryDockerCredentials("example", ContainerRegistryDockerCredentialsArgs.builder()        
            .registryName("example")
            .build());

    }
}
import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.ContainerRegistryDockerCredentials("example", registry_name="example")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = new digitalocean.ContainerRegistryDockerCredentials("example", {
    registryName: "example",
});
resources:
  example:
    type: digitalocean:ContainerRegistryDockerCredentials
    properties:
      registryName: example

Docker Provider Example

using System.Collections.Generic;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var exampleContainerRegistry = DigitalOcean.GetContainerRegistry.Invoke(new()
    {
        Name = "example",
    });

    var exampleContainerRegistryDockerCredentials = new DigitalOcean.ContainerRegistryDockerCredentials("exampleContainerRegistryDockerCredentials", new()
    {
        RegistryName = "example",
    });

});
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := digitalocean.LookupContainerRegistry(ctx, &GetContainerRegistryArgs{
			Name: "example",
		}, nil)
		if err != nil {
			return err
		}
		_, err = digitalocean.NewContainerRegistryDockerCredentials(ctx, "exampleContainerRegistryDockerCredentials", &digitalocean.ContainerRegistryDockerCredentialsArgs{
			RegistryName: pulumi.String("example"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetContainerRegistryArgs;
import com.pulumi.digitalocean.ContainerRegistryDockerCredentials;
import com.pulumi.digitalocean.ContainerRegistryDockerCredentialsArgs;
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 exampleContainerRegistry = DigitaloceanFunctions.getContainerRegistry(GetContainerRegistryArgs.builder()
            .name("example")
            .build());

        var exampleContainerRegistryDockerCredentials = new ContainerRegistryDockerCredentials("exampleContainerRegistryDockerCredentials", ContainerRegistryDockerCredentialsArgs.builder()        
            .registryName("example")
            .build());

    }
}
import pulumi
import pulumi_digitalocean as digitalocean

example_container_registry = digitalocean.get_container_registry(name="example")
example_container_registry_docker_credentials = digitalocean.ContainerRegistryDockerCredentials("exampleContainerRegistryDockerCredentials", registry_name="example")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const exampleContainerRegistry = digitalocean.getContainerRegistry({
    name: "example",
});
const exampleContainerRegistryDockerCredentials = new digitalocean.ContainerRegistryDockerCredentials("exampleContainerRegistryDockerCredentials", {registryName: "example"});
resources:
  exampleContainerRegistryDockerCredentials:
    type: digitalocean:ContainerRegistryDockerCredentials
    properties:
      registryName: example
variables:
  exampleContainerRegistry:
    Fn::Invoke:
      Function: digitalocean:getContainerRegistry
      Arguments:
        name: example

Create ContainerRegistryDockerCredentials Resource

new ContainerRegistryDockerCredentials(name: string, args: ContainerRegistryDockerCredentialsArgs, opts?: CustomResourceOptions);
@overload
def ContainerRegistryDockerCredentials(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       expiry_seconds: Optional[int] = None,
                                       registry_name: Optional[str] = None,
                                       write: Optional[bool] = None)
@overload
def ContainerRegistryDockerCredentials(resource_name: str,
                                       args: ContainerRegistryDockerCredentialsArgs,
                                       opts: Optional[ResourceOptions] = None)
func NewContainerRegistryDockerCredentials(ctx *Context, name string, args ContainerRegistryDockerCredentialsArgs, opts ...ResourceOption) (*ContainerRegistryDockerCredentials, error)
public ContainerRegistryDockerCredentials(string name, ContainerRegistryDockerCredentialsArgs args, CustomResourceOptions? opts = null)
public ContainerRegistryDockerCredentials(String name, ContainerRegistryDockerCredentialsArgs args)
public ContainerRegistryDockerCredentials(String name, ContainerRegistryDockerCredentialsArgs args, CustomResourceOptions options)
type: digitalocean:ContainerRegistryDockerCredentials
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

ContainerRegistryDockerCredentials Resource Properties

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

Inputs

The ContainerRegistryDockerCredentials resource accepts the following input properties:

RegistryName string

The name of the container registry.

ExpirySeconds int

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

Write bool

Allow for write access to the container registry. Defaults to false.

RegistryName string

The name of the container registry.

ExpirySeconds int

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

Write bool

Allow for write access to the container registry. Defaults to false.

registryName String

The name of the container registry.

expirySeconds Integer

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

write Boolean

Allow for write access to the container registry. Defaults to false.

registryName string

The name of the container registry.

expirySeconds number

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

write boolean

Allow for write access to the container registry. Defaults to false.

registry_name str

The name of the container registry.

expiry_seconds int

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

write bool

Allow for write access to the container registry. Defaults to false.

registryName String

The name of the container registry.

expirySeconds Number

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

write Boolean

Allow for write access to the container registry. Defaults to false.

Outputs

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

CredentialExpirationTime string
DockerCredentials string
Id string

The provider-assigned unique ID for this managed resource.

CredentialExpirationTime string
DockerCredentials string
Id string

The provider-assigned unique ID for this managed resource.

credentialExpirationTime String
dockerCredentials String
id String

The provider-assigned unique ID for this managed resource.

credentialExpirationTime string
dockerCredentials string
id string

The provider-assigned unique ID for this managed resource.

credential_expiration_time str
docker_credentials str
id str

The provider-assigned unique ID for this managed resource.

credentialExpirationTime String
dockerCredentials String
id String

The provider-assigned unique ID for this managed resource.

Look up Existing ContainerRegistryDockerCredentials Resource

Get an existing ContainerRegistryDockerCredentials 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?: ContainerRegistryDockerCredentialsState, opts?: CustomResourceOptions): ContainerRegistryDockerCredentials
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        credential_expiration_time: Optional[str] = None,
        docker_credentials: Optional[str] = None,
        expiry_seconds: Optional[int] = None,
        registry_name: Optional[str] = None,
        write: Optional[bool] = None) -> ContainerRegistryDockerCredentials
func GetContainerRegistryDockerCredentials(ctx *Context, name string, id IDInput, state *ContainerRegistryDockerCredentialsState, opts ...ResourceOption) (*ContainerRegistryDockerCredentials, error)
public static ContainerRegistryDockerCredentials Get(string name, Input<string> id, ContainerRegistryDockerCredentialsState? state, CustomResourceOptions? opts = null)
public static ContainerRegistryDockerCredentials get(String name, Output<String> id, ContainerRegistryDockerCredentialsState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:
CredentialExpirationTime string
DockerCredentials string
ExpirySeconds int

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

RegistryName string

The name of the container registry.

Write bool

Allow for write access to the container registry. Defaults to false.

CredentialExpirationTime string
DockerCredentials string
ExpirySeconds int

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

RegistryName string

The name of the container registry.

Write bool

Allow for write access to the container registry. Defaults to false.

credentialExpirationTime String
dockerCredentials String
expirySeconds Integer

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

registryName String

The name of the container registry.

write Boolean

Allow for write access to the container registry. Defaults to false.

credentialExpirationTime string
dockerCredentials string
expirySeconds number

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

registryName string

The name of the container registry.

write boolean

Allow for write access to the container registry. Defaults to false.

credential_expiration_time str
docker_credentials str
expiry_seconds int

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

registry_name str

The name of the container registry.

write bool

Allow for write access to the container registry. Defaults to false.

credentialExpirationTime String
dockerCredentials String
expirySeconds Number

The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000.

registryName String

The name of the container registry.

write Boolean

Allow for write access to the container registry. Defaults to false.

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes

This Pulumi package is based on the digitalocean Terraform Provider.