UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

129 lines 5.83 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.EnvironmentResourceKubernetes = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a Kubernetes Resource for an Environment. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Project("example", { * name: "Example Project", * workItemTemplate: "Agile", * versionControl: "Git", * visibility: "private", * description: "Managed by Pulumi", * }); * const exampleEnvironment = new azuredevops.Environment("example", { * projectId: example.id, * name: "Example Environment", * }); * const exampleServiceEndpointKubernetes = new azuredevops.ServiceEndpointKubernetes("example", { * 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 exampleEnvironmentResourceKubernetes = new azuredevops.EnvironmentResourceKubernetes("example", { * projectId: example.id, * environmentId: exampleEnvironment.id, * serviceEndpointId: exampleServiceEndpointKubernetes.id, * name: "Example", * namespace: "default", * clusterName: "example-aks", * tags: [ * "tag1", * "tag2", * ], * }); * ``` * * ## Relevant Links * * * [Azure DevOps Service REST API 6.0 - Kubernetes](https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/kubernetes?view=azure-devops-rest-6.0) * * ## Import * * The resource does not support import. */ class EnvironmentResourceKubernetes extends pulumi.CustomResource { /** * Get an existing EnvironmentResourceKubernetes 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, id, state, opts) { return new EnvironmentResourceKubernetes(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of EnvironmentResourceKubernetes. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === EnvironmentResourceKubernetes.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["clusterName"] = state ? state.clusterName : undefined; resourceInputs["environmentId"] = state ? state.environmentId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["namespace"] = state ? state.namespace : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["serviceEndpointId"] = state ? state.serviceEndpointId : undefined; resourceInputs["tags"] = state ? state.tags : undefined; } else { const args = argsOrState; if ((!args || args.environmentId === undefined) && !opts.urn) { throw new Error("Missing required property 'environmentId'"); } if ((!args || args.namespace === undefined) && !opts.urn) { throw new Error("Missing required property 'namespace'"); } if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if ((!args || args.serviceEndpointId === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceEndpointId'"); } resourceInputs["clusterName"] = args ? args.clusterName : undefined; resourceInputs["environmentId"] = args ? args.environmentId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["namespace"] = args ? args.namespace : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["serviceEndpointId"] = args ? args.serviceEndpointId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EnvironmentResourceKubernetes.__pulumiType, name, resourceInputs, opts); } } exports.EnvironmentResourceKubernetes = EnvironmentResourceKubernetes; /** @internal */ EnvironmentResourceKubernetes.__pulumiType = 'azuredevops:index/environmentResourceKubernetes:EnvironmentResourceKubernetes'; //# sourceMappingURL=environmentResourceKubernetes.js.map