@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
217 lines (216 loc) • 8.74 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Manages a Kubernetes service endpoint within Azure DevOps.
*
* ## Example Usage
*
* ```typescript
* 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 Pulumi",
* });
* const example_azure = new azuredevops.ServiceEndpointKubernetes("example-azure", {
* projectId: example.id,
* serviceEndpointName: "Example Kubernetes",
* apiserverUrl: "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io",
* authorizationType: "AzureSubscription",
* azureSubscriptions: [{
* subscriptionId: "00000000-0000-0000-0000-000000000000",
* subscriptionName: "Example",
* tenantId: "00000000-0000-0000-0000-000000000000",
* resourcegroupId: "example-rg",
* namespace: "default",
* clusterName: "example-aks",
* }],
* });
* const example_kubeconfig = new azuredevops.ServiceEndpointKubernetes("example-kubeconfig", {
* projectId: example.id,
* serviceEndpointName: "Example Kubernetes",
* apiserverUrl: "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io",
* authorizationType: "Kubeconfig",
* kubeconfig: {
* kubeConfig: ` apiVersion: v1
* clusters:
* - cluster:
* certificate-authority: fake-ca-file
* server: https://1.2.3.4
* name: development
* contexts:
* - context:
* cluster: development
* namespace: frontend
* user: developer
* name: dev-frontend
* current-context: dev-frontend
* kind: Config
* preferences: {}
* users:
* - name: developer
* user:
* client-certificate: fake-cert-file
* client-key: fake-key-file
* `,
* acceptUntrustedCerts: true,
* clusterContext: "dev-frontend",
* },
* });
* const example_service_account = new azuredevops.ServiceEndpointKubernetes("example-service-account", {
* projectId: example.id,
* serviceEndpointName: "Example Kubernetes",
* apiserverUrl: "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io",
* authorizationType: "ServiceAccount",
* serviceAccount: {
* token: "000000000000000000000000",
* caCert: "0000000000000000000000000000000",
* },
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - Endpoints](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints?view=azure-devops-rest-7.0)
*
* ## Import
*
* Azure DevOps Kubernetes Service Endpoint can be imported using **projectID/serviceEndpointID** or **projectName/serviceEndpointID**
*
* ```sh
* $ pulumi import azuredevops:index/serviceEndpointKubernetes:ServiceEndpointKubernetes example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
* ```
*/
export declare class ServiceEndpointKubernetes extends pulumi.CustomResource {
/**
* Get an existing ServiceEndpointKubernetes 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?: ServiceEndpointKubernetesState, opts?: pulumi.CustomResourceOptions): ServiceEndpointKubernetes;
/**
* Returns true if the given object is an instance of ServiceEndpointKubernetes. 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 ServiceEndpointKubernetes;
/**
* The hostname (in form of URI) of the Kubernetes API.
*/
readonly apiserverUrl: pulumi.Output<string>;
readonly authorization: pulumi.Output<{
[key: string]: string;
}>;
/**
* The authentication method used to authenticate on the Kubernetes cluster. The value should be one of AzureSubscription, Kubeconfig, ServiceAccount.
*/
readonly authorizationType: pulumi.Output<string>;
/**
* An `azureSubscription` block as defined below.
*/
readonly azureSubscriptions: pulumi.Output<outputs.ServiceEndpointKubernetesAzureSubscription[] | undefined>;
readonly description: pulumi.Output<string | undefined>;
/**
* A `kubeconfig` block as defined below.
*/
readonly kubeconfig: pulumi.Output<outputs.ServiceEndpointKubernetesKubeconfig | undefined>;
/**
* The ID of the project.
*/
readonly projectId: pulumi.Output<string>;
/**
* A `serviceAccount` block as defined below.
*/
readonly serviceAccount: pulumi.Output<outputs.ServiceEndpointKubernetesServiceAccount | undefined>;
/**
* The Service Endpoint name.
*/
readonly serviceEndpointName: pulumi.Output<string>;
/**
* Create a ServiceEndpointKubernetes 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: ServiceEndpointKubernetesArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ServiceEndpointKubernetes resources.
*/
export interface ServiceEndpointKubernetesState {
/**
* The hostname (in form of URI) of the Kubernetes API.
*/
apiserverUrl?: pulumi.Input<string>;
authorization?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The authentication method used to authenticate on the Kubernetes cluster. The value should be one of AzureSubscription, Kubeconfig, ServiceAccount.
*/
authorizationType?: pulumi.Input<string>;
/**
* An `azureSubscription` block as defined below.
*/
azureSubscriptions?: pulumi.Input<pulumi.Input<inputs.ServiceEndpointKubernetesAzureSubscription>[]>;
description?: pulumi.Input<string>;
/**
* A `kubeconfig` block as defined below.
*/
kubeconfig?: pulumi.Input<inputs.ServiceEndpointKubernetesKubeconfig>;
/**
* The ID of the project.
*/
projectId?: pulumi.Input<string>;
/**
* A `serviceAccount` block as defined below.
*/
serviceAccount?: pulumi.Input<inputs.ServiceEndpointKubernetesServiceAccount>;
/**
* The Service Endpoint name.
*/
serviceEndpointName?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ServiceEndpointKubernetes resource.
*/
export interface ServiceEndpointKubernetesArgs {
/**
* The hostname (in form of URI) of the Kubernetes API.
*/
apiserverUrl: pulumi.Input<string>;
/**
* The authentication method used to authenticate on the Kubernetes cluster. The value should be one of AzureSubscription, Kubeconfig, ServiceAccount.
*/
authorizationType: pulumi.Input<string>;
/**
* An `azureSubscription` block as defined below.
*/
azureSubscriptions?: pulumi.Input<pulumi.Input<inputs.ServiceEndpointKubernetesAzureSubscription>[]>;
description?: pulumi.Input<string>;
/**
* A `kubeconfig` block as defined below.
*/
kubeconfig?: pulumi.Input<inputs.ServiceEndpointKubernetesKubeconfig>;
/**
* The ID of the project.
*/
projectId: pulumi.Input<string>;
/**
* A `serviceAccount` block as defined below.
*/
serviceAccount?: pulumi.Input<inputs.ServiceEndpointKubernetesServiceAccount>;
/**
* The Service Endpoint name.
*/
serviceEndpointName: pulumi.Input<string>;
}