1. Packages
  2. Azuredevops Provider
  3. API Docs
  4. ServiceEndpointDockerRegistry
Azure DevOps v3.3.0 published on Wednesday, Sep 4, 2024 by Pulumi

azuredevops.ServiceEndpointDockerRegistry

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.3.0 published on Wednesday, Sep 4, 2024 by Pulumi

    Manages a Docker Registry service endpoint within Azure DevOps.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = new azuredevops.Project("example", {
        name: "Example Project",
        visibility: "private",
        versionControl: "Git",
        workItemTemplate: "Agile",
        description: "Managed by Terraform",
    });
    // dockerhub registry service connection
    const exampleServiceEndpointDockerRegistry = new azuredevops.ServiceEndpointDockerRegistry("example", {
        projectId: example.id,
        serviceEndpointName: "Example Docker Hub",
        dockerUsername: "example",
        dockerEmail: "email@example.com",
        dockerPassword: "12345",
        registryType: "DockerHub",
    });
    // other docker registry service connection
    const example_other = new azuredevops.ServiceEndpointDockerRegistry("example-other", {
        projectId: example.id,
        serviceEndpointName: "Example Docker Registry",
        dockerRegistry: "https://sample.azurecr.io/v1",
        dockerUsername: "sample",
        dockerPassword: "12345",
        registryType: "Others",
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.Project("example",
        name="Example Project",
        visibility="private",
        version_control="Git",
        work_item_template="Agile",
        description="Managed by Terraform")
    # dockerhub registry service connection
    example_service_endpoint_docker_registry = azuredevops.ServiceEndpointDockerRegistry("example",
        project_id=example.id,
        service_endpoint_name="Example Docker Hub",
        docker_username="example",
        docker_email="email@example.com",
        docker_password="12345",
        registry_type="DockerHub")
    # other docker registry service connection
    example_other = azuredevops.ServiceEndpointDockerRegistry("example-other",
        project_id=example.id,
        service_endpoint_name="Example Docker Registry",
        docker_registry="https://sample.azurecr.io/v1",
        docker_username="sample",
        docker_password="12345",
        registry_type="Others")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
    			Name:             pulumi.String("Example Project"),
    			Visibility:       pulumi.String("private"),
    			VersionControl:   pulumi.String("Git"),
    			WorkItemTemplate: pulumi.String("Agile"),
    			Description:      pulumi.String("Managed by Terraform"),
    		})
    		if err != nil {
    			return err
    		}
    		// dockerhub registry service connection
    		_, err = azuredevops.NewServiceEndpointDockerRegistry(ctx, "example", &azuredevops.ServiceEndpointDockerRegistryArgs{
    			ProjectId:           example.ID(),
    			ServiceEndpointName: pulumi.String("Example Docker Hub"),
    			DockerUsername:      pulumi.String("example"),
    			DockerEmail:         pulumi.String("email@example.com"),
    			DockerPassword:      pulumi.String("12345"),
    			RegistryType:        pulumi.String("DockerHub"),
    		})
    		if err != nil {
    			return err
    		}
    		// other docker registry service connection
    		_, err = azuredevops.NewServiceEndpointDockerRegistry(ctx, "example-other", &azuredevops.ServiceEndpointDockerRegistryArgs{
    			ProjectId:           example.ID(),
    			ServiceEndpointName: pulumi.String("Example Docker Registry"),
    			DockerRegistry:      pulumi.String("https://sample.azurecr.io/v1"),
    			DockerUsername:      pulumi.String("sample"),
    			DockerPassword:      pulumi.String("12345"),
    			RegistryType:        pulumi.String("Others"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureDevOps.Project("example", new()
        {
            Name = "Example Project",
            Visibility = "private",
            VersionControl = "Git",
            WorkItemTemplate = "Agile",
            Description = "Managed by Terraform",
        });
    
        // dockerhub registry service connection
        var exampleServiceEndpointDockerRegistry = new AzureDevOps.ServiceEndpointDockerRegistry("example", new()
        {
            ProjectId = example.Id,
            ServiceEndpointName = "Example Docker Hub",
            DockerUsername = "example",
            DockerEmail = "email@example.com",
            DockerPassword = "12345",
            RegistryType = "DockerHub",
        });
    
        // other docker registry service connection
        var example_other = new AzureDevOps.ServiceEndpointDockerRegistry("example-other", new()
        {
            ProjectId = example.Id,
            ServiceEndpointName = "Example Docker Registry",
            DockerRegistryUrl = "https://sample.azurecr.io/v1",
            DockerUsername = "sample",
            DockerPassword = "12345",
            RegistryType = "Others",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.ServiceEndpointDockerRegistry;
    import com.pulumi.azuredevops.ServiceEndpointDockerRegistryArgs;
    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 Project("example", ProjectArgs.builder()
                .name("Example Project")
                .visibility("private")
                .versionControl("Git")
                .workItemTemplate("Agile")
                .description("Managed by Terraform")
                .build());
    
            // dockerhub registry service connection
            var exampleServiceEndpointDockerRegistry = new ServiceEndpointDockerRegistry("exampleServiceEndpointDockerRegistry", ServiceEndpointDockerRegistryArgs.builder()
                .projectId(example.id())
                .serviceEndpointName("Example Docker Hub")
                .dockerUsername("example")
                .dockerEmail("email@example.com")
                .dockerPassword("12345")
                .registryType("DockerHub")
                .build());
    
            // other docker registry service connection
            var example_other = new ServiceEndpointDockerRegistry("example-other", ServiceEndpointDockerRegistryArgs.builder()
                .projectId(example.id())
                .serviceEndpointName("Example Docker Registry")
                .dockerRegistry("https://sample.azurecr.io/v1")
                .dockerUsername("sample")
                .dockerPassword("12345")
                .registryType("Others")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azuredevops:Project
        properties:
          name: Example Project
          visibility: private
          versionControl: Git
          workItemTemplate: Agile
          description: Managed by Terraform
      # dockerhub registry service connection
      exampleServiceEndpointDockerRegistry:
        type: azuredevops:ServiceEndpointDockerRegistry
        name: example
        properties:
          projectId: ${example.id}
          serviceEndpointName: Example Docker Hub
          dockerUsername: example
          dockerEmail: email@example.com
          dockerPassword: '12345'
          registryType: DockerHub
      # other docker registry service connection
      example-other:
        type: azuredevops:ServiceEndpointDockerRegistry
        properties:
          projectId: ${example.id}
          serviceEndpointName: Example Docker Registry
          dockerRegistry: https://sample.azurecr.io/v1
          dockerUsername: sample
          dockerPassword: '12345'
          registryType: Others
    

    Create ServiceEndpointDockerRegistry Resource

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

    Constructor syntax

    new ServiceEndpointDockerRegistry(name: string, args: ServiceEndpointDockerRegistryArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceEndpointDockerRegistry(resource_name: str,
                                      args: ServiceEndpointDockerRegistryArgs,
                                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceEndpointDockerRegistry(resource_name: str,
                                      opts: Optional[ResourceOptions] = None,
                                      docker_registry: Optional[str] = None,
                                      project_id: Optional[str] = None,
                                      registry_type: Optional[str] = None,
                                      service_endpoint_name: Optional[str] = None,
                                      authorization: Optional[Mapping[str, str]] = None,
                                      description: Optional[str] = None,
                                      docker_email: Optional[str] = None,
                                      docker_password: Optional[str] = None,
                                      docker_username: Optional[str] = None)
    func NewServiceEndpointDockerRegistry(ctx *Context, name string, args ServiceEndpointDockerRegistryArgs, opts ...ResourceOption) (*ServiceEndpointDockerRegistry, error)
    public ServiceEndpointDockerRegistry(string name, ServiceEndpointDockerRegistryArgs args, CustomResourceOptions? opts = null)
    public ServiceEndpointDockerRegistry(String name, ServiceEndpointDockerRegistryArgs args)
    public ServiceEndpointDockerRegistry(String name, ServiceEndpointDockerRegistryArgs args, CustomResourceOptions options)
    
    type: azuredevops:ServiceEndpointDockerRegistry
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ServiceEndpointDockerRegistryArgs
    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 ServiceEndpointDockerRegistryArgs
    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 ServiceEndpointDockerRegistryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceEndpointDockerRegistryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceEndpointDockerRegistryArgs
    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 serviceEndpointDockerRegistryResource = new AzureDevOps.ServiceEndpointDockerRegistry("serviceEndpointDockerRegistryResource", new()
    {
        DockerRegistryUrl = "string",
        ProjectId = "string",
        RegistryType = "string",
        ServiceEndpointName = "string",
        Authorization = 
        {
            { "string", "string" },
        },
        Description = "string",
        DockerEmail = "string",
        DockerPassword = "string",
        DockerUsername = "string",
    });
    
    example, err := azuredevops.NewServiceEndpointDockerRegistry(ctx, "serviceEndpointDockerRegistryResource", &azuredevops.ServiceEndpointDockerRegistryArgs{
    	DockerRegistry:      pulumi.String("string"),
    	ProjectId:           pulumi.String("string"),
    	RegistryType:        pulumi.String("string"),
    	ServiceEndpointName: pulumi.String("string"),
    	Authorization: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description:    pulumi.String("string"),
    	DockerEmail:    pulumi.String("string"),
    	DockerPassword: pulumi.String("string"),
    	DockerUsername: pulumi.String("string"),
    })
    
    var serviceEndpointDockerRegistryResource = new ServiceEndpointDockerRegistry("serviceEndpointDockerRegistryResource", ServiceEndpointDockerRegistryArgs.builder()
        .dockerRegistry("string")
        .projectId("string")
        .registryType("string")
        .serviceEndpointName("string")
        .authorization(Map.of("string", "string"))
        .description("string")
        .dockerEmail("string")
        .dockerPassword("string")
        .dockerUsername("string")
        .build());
    
    service_endpoint_docker_registry_resource = azuredevops.ServiceEndpointDockerRegistry("serviceEndpointDockerRegistryResource",
        docker_registry="string",
        project_id="string",
        registry_type="string",
        service_endpoint_name="string",
        authorization={
            "string": "string",
        },
        description="string",
        docker_email="string",
        docker_password="string",
        docker_username="string")
    
    const serviceEndpointDockerRegistryResource = new azuredevops.ServiceEndpointDockerRegistry("serviceEndpointDockerRegistryResource", {
        dockerRegistry: "string",
        projectId: "string",
        registryType: "string",
        serviceEndpointName: "string",
        authorization: {
            string: "string",
        },
        description: "string",
        dockerEmail: "string",
        dockerPassword: "string",
        dockerUsername: "string",
    });
    
    type: azuredevops:ServiceEndpointDockerRegistry
    properties:
        authorization:
            string: string
        description: string
        dockerEmail: string
        dockerPassword: string
        dockerRegistry: string
        dockerUsername: string
        projectId: string
        registryType: string
        serviceEndpointName: string
    

    ServiceEndpointDockerRegistry 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 ServiceEndpointDockerRegistry resource accepts the following input properties:

    DockerRegistryUrl string
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    ProjectId string
    The ID of the project.
    RegistryType string
    Can be "DockerHub" or "Others" (Default "DockerHub")
    ServiceEndpointName string
    The name you will use to refer to this service connection in task inputs.
    Authorization Dictionary<string, string>
    Description string
    DockerEmail string
    The email for Docker account user.
    DockerPassword string
    The password for the account user identified above.
    DockerUsername string
    The identifier of the Docker account user.
    DockerRegistry string
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    ProjectId string
    The ID of the project.
    RegistryType string
    Can be "DockerHub" or "Others" (Default "DockerHub")
    ServiceEndpointName string
    The name you will use to refer to this service connection in task inputs.
    Authorization map[string]string
    Description string
    DockerEmail string
    The email for Docker account user.
    DockerPassword string
    The password for the account user identified above.
    DockerUsername string
    The identifier of the Docker account user.
    dockerRegistry String
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    projectId String
    The ID of the project.
    registryType String
    Can be "DockerHub" or "Others" (Default "DockerHub")
    serviceEndpointName String
    The name you will use to refer to this service connection in task inputs.
    authorization Map<String,String>
    description String
    dockerEmail String
    The email for Docker account user.
    dockerPassword String
    The password for the account user identified above.
    dockerUsername String
    The identifier of the Docker account user.
    dockerRegistry string
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    projectId string
    The ID of the project.
    registryType string
    Can be "DockerHub" or "Others" (Default "DockerHub")
    serviceEndpointName string
    The name you will use to refer to this service connection in task inputs.
    authorization {[key: string]: string}
    description string
    dockerEmail string
    The email for Docker account user.
    dockerPassword string
    The password for the account user identified above.
    dockerUsername string
    The identifier of the Docker account user.
    docker_registry str
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    project_id str
    The ID of the project.
    registry_type str
    Can be "DockerHub" or "Others" (Default "DockerHub")
    service_endpoint_name str
    The name you will use to refer to this service connection in task inputs.
    authorization Mapping[str, str]
    description str
    docker_email str
    The email for Docker account user.
    docker_password str
    The password for the account user identified above.
    docker_username str
    The identifier of the Docker account user.
    dockerRegistry String
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    projectId String
    The ID of the project.
    registryType String
    Can be "DockerHub" or "Others" (Default "DockerHub")
    serviceEndpointName String
    The name you will use to refer to this service connection in task inputs.
    authorization Map<String>
    description String
    dockerEmail String
    The email for Docker account user.
    dockerPassword String
    The password for the account user identified above.
    dockerUsername String
    The identifier of the Docker account user.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ServiceEndpointDockerRegistry 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 ServiceEndpointDockerRegistry Resource

    Get an existing ServiceEndpointDockerRegistry 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?: ServiceEndpointDockerRegistryState, opts?: CustomResourceOptions): ServiceEndpointDockerRegistry
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            authorization: Optional[Mapping[str, str]] = None,
            description: Optional[str] = None,
            docker_email: Optional[str] = None,
            docker_password: Optional[str] = None,
            docker_registry: Optional[str] = None,
            docker_username: Optional[str] = None,
            project_id: Optional[str] = None,
            registry_type: Optional[str] = None,
            service_endpoint_name: Optional[str] = None) -> ServiceEndpointDockerRegistry
    func GetServiceEndpointDockerRegistry(ctx *Context, name string, id IDInput, state *ServiceEndpointDockerRegistryState, opts ...ResourceOption) (*ServiceEndpointDockerRegistry, error)
    public static ServiceEndpointDockerRegistry Get(string name, Input<string> id, ServiceEndpointDockerRegistryState? state, CustomResourceOptions? opts = null)
    public static ServiceEndpointDockerRegistry get(String name, Output<String> id, ServiceEndpointDockerRegistryState 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:
    Authorization Dictionary<string, string>
    Description string
    DockerEmail string
    The email for Docker account user.
    DockerPassword string
    The password for the account user identified above.
    DockerRegistryUrl string
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    DockerUsername string
    The identifier of the Docker account user.
    ProjectId string
    The ID of the project.
    RegistryType string
    Can be "DockerHub" or "Others" (Default "DockerHub")
    ServiceEndpointName string
    The name you will use to refer to this service connection in task inputs.
    Authorization map[string]string
    Description string
    DockerEmail string
    The email for Docker account user.
    DockerPassword string
    The password for the account user identified above.
    DockerRegistry string
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    DockerUsername string
    The identifier of the Docker account user.
    ProjectId string
    The ID of the project.
    RegistryType string
    Can be "DockerHub" or "Others" (Default "DockerHub")
    ServiceEndpointName string
    The name you will use to refer to this service connection in task inputs.
    authorization Map<String,String>
    description String
    dockerEmail String
    The email for Docker account user.
    dockerPassword String
    The password for the account user identified above.
    dockerRegistry String
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    dockerUsername String
    The identifier of the Docker account user.
    projectId String
    The ID of the project.
    registryType String
    Can be "DockerHub" or "Others" (Default "DockerHub")
    serviceEndpointName String
    The name you will use to refer to this service connection in task inputs.
    authorization {[key: string]: string}
    description string
    dockerEmail string
    The email for Docker account user.
    dockerPassword string
    The password for the account user identified above.
    dockerRegistry string
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    dockerUsername string
    The identifier of the Docker account user.
    projectId string
    The ID of the project.
    registryType string
    Can be "DockerHub" or "Others" (Default "DockerHub")
    serviceEndpointName string
    The name you will use to refer to this service connection in task inputs.
    authorization Mapping[str, str]
    description str
    docker_email str
    The email for Docker account user.
    docker_password str
    The password for the account user identified above.
    docker_registry str
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    docker_username str
    The identifier of the Docker account user.
    project_id str
    The ID of the project.
    registry_type str
    Can be "DockerHub" or "Others" (Default "DockerHub")
    service_endpoint_name str
    The name you will use to refer to this service connection in task inputs.
    authorization Map<String>
    description String
    dockerEmail String
    The email for Docker account user.
    dockerPassword String
    The password for the account user identified above.
    dockerRegistry String
    The URL of the Docker registry. (Default: "https://index.docker.io/v1/")
    dockerUsername String
    The identifier of the Docker account user.
    projectId String
    The ID of the project.
    registryType String
    Can be "DockerHub" or "Others" (Default "DockerHub")
    serviceEndpointName String
    The name you will use to refer to this service connection in task inputs.

    Import

    Azure DevOps Service Endpoint Docker Registry can be imported using projectID/serviceEndpointID or projectName/serviceEndpointID

    $ pulumi import azuredevops:index/serviceEndpointDockerRegistry:ServiceEndpointDockerRegistry example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
    

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

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.3.0 published on Wednesday, Sep 4, 2024 by Pulumi