UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

146 lines (145 loc) 5.64 kB
import * as pulumi from "@pulumi/pulumi"; /** * 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 * * Get the container registry: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const example = new digitalocean.ContainerRegistryDockerCredentials("example", {registryName: "example"}); * ``` * * ### Docker Provider Example * * Use the `endpoint` and `dockerCredentials` with the Docker provider: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const example = digitalocean.getContainerRegistry({ * name: "example", * }); * const exampleContainerRegistryDockerCredentials = new digitalocean.ContainerRegistryDockerCredentials("example", {registryName: "example"}); * ``` * * ### Kubernetes Example * * Combined with the Kubernetes Provider's `kubernetesSecret` resource, you can * access the registry from inside your cluster: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * import * as kubernetes from "@pulumi/kubernetes"; * * const exampleContainerRegistryDockerCredentials = new digitalocean.ContainerRegistryDockerCredentials("example", {registryName: "example"}); * const example = digitalocean.getKubernetesCluster({ * name: "prod-cluster-01", * }); * const exampleSecret = new kubernetes.core.v1.Secret("example", { * metadata: { * name: "docker-cfg", * }, * data: { * ".dockerconfigjson": exampleContainerRegistryDockerCredentials.dockerCredentials, * }, * type: "kubernetes.io/dockerconfigjson", * }); * ``` */ export declare class ContainerRegistryDockerCredentials extends pulumi.CustomResource { /** * Get an existing ContainerRegistryDockerCredentials resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ContainerRegistryDockerCredentialsState, opts?: pulumi.CustomResourceOptions): ContainerRegistryDockerCredentials; /** * Returns true if the given object is an instance of ContainerRegistryDockerCredentials. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ContainerRegistryDockerCredentials; /** * The date and time the registry access token will expire. */ readonly credentialExpirationTime: pulumi.Output<string>; /** * Credentials for the container registry. */ readonly dockerCredentials: pulumi.Output<string>; /** * 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. */ readonly expirySeconds: pulumi.Output<number | undefined>; /** * The name of the container registry. */ readonly registryName: pulumi.Output<string>; /** * Allow for write access to the container registry. Defaults to false. */ readonly write: pulumi.Output<boolean | undefined>; /** * Create a ContainerRegistryDockerCredentials resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ContainerRegistryDockerCredentialsArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ContainerRegistryDockerCredentials resources. */ export interface ContainerRegistryDockerCredentialsState { /** * The date and time the registry access token will expire. */ credentialExpirationTime?: pulumi.Input<string>; /** * Credentials for the container registry. */ dockerCredentials?: pulumi.Input<string>; /** * 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. */ expirySeconds?: pulumi.Input<number>; /** * The name of the container registry. */ registryName?: pulumi.Input<string>; /** * Allow for write access to the container registry. Defaults to false. */ write?: pulumi.Input<boolean>; } /** * The set of arguments for constructing a ContainerRegistryDockerCredentials resource. */ export interface ContainerRegistryDockerCredentialsArgs { /** * 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. */ expirySeconds?: pulumi.Input<number>; /** * The name of the container registry. */ registryName: pulumi.Input<string>; /** * Allow for write access to the container registry. Defaults to false. */ write?: pulumi.Input<boolean>; }