azuredevops.EnvironmentResourceKubernetes
Explore with Pulumi AI
Manages a Kubernetes Resource for an Environment.
Example Usage
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 Terraform",
});
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",
],
});
import pulumi
import pulumi_azuredevops as azuredevops
example = azuredevops.Project("example",
name="Example Project",
work_item_template="Agile",
version_control="Git",
visibility="private",
description="Managed by Terraform")
example_environment = azuredevops.Environment("example",
project_id=example.id,
name="Example Environment")
example_service_endpoint_kubernetes = azuredevops.ServiceEndpointKubernetes("example",
project_id=example.id,
service_endpoint_name="Example Kubernetes",
apiserver_url="https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io",
authorization_type="AzureSubscription",
azure_subscriptions=[{
"subscription_id": "00000000-0000-0000-0000-000000000000",
"subscription_name": "Example",
"tenant_id": "00000000-0000-0000-0000-000000000000",
"resourcegroup_id": "example-rg",
"namespace": "default",
"cluster_name": "example-aks",
}])
example_environment_resource_kubernetes = azuredevops.EnvironmentResourceKubernetes("example",
project_id=example.id,
environment_id=example_environment.id,
service_endpoint_id=example_service_endpoint_kubernetes.id,
name="Example",
namespace="default",
cluster_name="example-aks",
tags=[
"tag1",
"tag2",
])
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"),
WorkItemTemplate: pulumi.String("Agile"),
VersionControl: pulumi.String("Git"),
Visibility: pulumi.String("private"),
Description: pulumi.String("Managed by Terraform"),
})
if err != nil {
return err
}
exampleEnvironment, err := azuredevops.NewEnvironment(ctx, "example", &azuredevops.EnvironmentArgs{
ProjectId: example.ID(),
Name: pulumi.String("Example Environment"),
})
if err != nil {
return err
}
exampleServiceEndpointKubernetes, err := azuredevops.NewServiceEndpointKubernetes(ctx, "example", &azuredevops.ServiceEndpointKubernetesArgs{
ProjectId: example.ID(),
ServiceEndpointName: pulumi.String("Example Kubernetes"),
ApiserverUrl: pulumi.String("https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io"),
AuthorizationType: pulumi.String("AzureSubscription"),
AzureSubscriptions: azuredevops.ServiceEndpointKubernetesAzureSubscriptionArray{
&azuredevops.ServiceEndpointKubernetesAzureSubscriptionArgs{
SubscriptionId: pulumi.String("00000000-0000-0000-0000-000000000000"),
SubscriptionName: pulumi.String("Example"),
TenantId: pulumi.String("00000000-0000-0000-0000-000000000000"),
ResourcegroupId: pulumi.String("example-rg"),
Namespace: pulumi.String("default"),
ClusterName: pulumi.String("example-aks"),
},
},
})
if err != nil {
return err
}
_, err = azuredevops.NewEnvironmentResourceKubernetes(ctx, "example", &azuredevops.EnvironmentResourceKubernetesArgs{
ProjectId: example.ID(),
EnvironmentId: exampleEnvironment.ID(),
ServiceEndpointId: exampleServiceEndpointKubernetes.ID(),
Name: pulumi.String("Example"),
Namespace: pulumi.String("default"),
ClusterName: pulumi.String("example-aks"),
Tags: pulumi.StringArray{
pulumi.String("tag1"),
pulumi.String("tag2"),
},
})
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",
WorkItemTemplate = "Agile",
VersionControl = "Git",
Visibility = "private",
Description = "Managed by Terraform",
});
var exampleEnvironment = new AzureDevOps.Environment("example", new()
{
ProjectId = example.Id,
Name = "Example Environment",
});
var exampleServiceEndpointKubernetes = new AzureDevOps.ServiceEndpointKubernetes("example", new()
{
ProjectId = example.Id,
ServiceEndpointName = "Example Kubernetes",
ApiserverUrl = "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io",
AuthorizationType = "AzureSubscription",
AzureSubscriptions = new[]
{
new AzureDevOps.Inputs.ServiceEndpointKubernetesAzureSubscriptionArgs
{
SubscriptionId = "00000000-0000-0000-0000-000000000000",
SubscriptionName = "Example",
TenantId = "00000000-0000-0000-0000-000000000000",
ResourcegroupId = "example-rg",
Namespace = "default",
ClusterName = "example-aks",
},
},
});
var exampleEnvironmentResourceKubernetes = new AzureDevOps.EnvironmentResourceKubernetes("example", new()
{
ProjectId = example.Id,
EnvironmentId = exampleEnvironment.Id,
ServiceEndpointId = exampleServiceEndpointKubernetes.Id,
Name = "Example",
Namespace = "default",
ClusterName = "example-aks",
Tags = new[]
{
"tag1",
"tag2",
},
});
});
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.Environment;
import com.pulumi.azuredevops.EnvironmentArgs;
import com.pulumi.azuredevops.ServiceEndpointKubernetes;
import com.pulumi.azuredevops.ServiceEndpointKubernetesArgs;
import com.pulumi.azuredevops.inputs.ServiceEndpointKubernetesAzureSubscriptionArgs;
import com.pulumi.azuredevops.EnvironmentResourceKubernetes;
import com.pulumi.azuredevops.EnvironmentResourceKubernetesArgs;
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")
.workItemTemplate("Agile")
.versionControl("Git")
.visibility("private")
.description("Managed by Terraform")
.build());
var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()
.projectId(example.id())
.name("Example Environment")
.build());
var exampleServiceEndpointKubernetes = new ServiceEndpointKubernetes("exampleServiceEndpointKubernetes", ServiceEndpointKubernetesArgs.builder()
.projectId(example.id())
.serviceEndpointName("Example Kubernetes")
.apiserverUrl("https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io")
.authorizationType("AzureSubscription")
.azureSubscriptions(ServiceEndpointKubernetesAzureSubscriptionArgs.builder()
.subscriptionId("00000000-0000-0000-0000-000000000000")
.subscriptionName("Example")
.tenantId("00000000-0000-0000-0000-000000000000")
.resourcegroupId("example-rg")
.namespace("default")
.clusterName("example-aks")
.build())
.build());
var exampleEnvironmentResourceKubernetes = new EnvironmentResourceKubernetes("exampleEnvironmentResourceKubernetes", EnvironmentResourceKubernetesArgs.builder()
.projectId(example.id())
.environmentId(exampleEnvironment.id())
.serviceEndpointId(exampleServiceEndpointKubernetes.id())
.name("Example")
.namespace("default")
.clusterName("example-aks")
.tags(
"tag1",
"tag2")
.build());
}
}
resources:
example:
type: azuredevops:Project
properties:
name: Example Project
workItemTemplate: Agile
versionControl: Git
visibility: private
description: Managed by Terraform
exampleEnvironment:
type: azuredevops:Environment
name: example
properties:
projectId: ${example.id}
name: Example Environment
exampleServiceEndpointKubernetes:
type: azuredevops:ServiceEndpointKubernetes
name: example
properties:
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
exampleEnvironmentResourceKubernetes:
type: azuredevops:EnvironmentResourceKubernetes
name: example
properties:
projectId: ${example.id}
environmentId: ${exampleEnvironment.id}
serviceEndpointId: ${exampleServiceEndpointKubernetes.id}
name: Example
namespace: default
clusterName: example-aks
tags:
- tag1
- tag2
Relevant Links
Create EnvironmentResourceKubernetes Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EnvironmentResourceKubernetes(name: string, args: EnvironmentResourceKubernetesArgs, opts?: CustomResourceOptions);
@overload
def EnvironmentResourceKubernetes(resource_name: str,
args: EnvironmentResourceKubernetesArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EnvironmentResourceKubernetes(resource_name: str,
opts: Optional[ResourceOptions] = None,
environment_id: Optional[int] = None,
namespace: Optional[str] = None,
project_id: Optional[str] = None,
service_endpoint_id: Optional[str] = None,
cluster_name: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Sequence[str]] = None)
func NewEnvironmentResourceKubernetes(ctx *Context, name string, args EnvironmentResourceKubernetesArgs, opts ...ResourceOption) (*EnvironmentResourceKubernetes, error)
public EnvironmentResourceKubernetes(string name, EnvironmentResourceKubernetesArgs args, CustomResourceOptions? opts = null)
public EnvironmentResourceKubernetes(String name, EnvironmentResourceKubernetesArgs args)
public EnvironmentResourceKubernetes(String name, EnvironmentResourceKubernetesArgs args, CustomResourceOptions options)
type: azuredevops:EnvironmentResourceKubernetes
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 EnvironmentResourceKubernetesArgs
- 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 EnvironmentResourceKubernetesArgs
- 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 EnvironmentResourceKubernetesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnvironmentResourceKubernetesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EnvironmentResourceKubernetesArgs
- 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 environmentResourceKubernetesResource = new AzureDevOps.EnvironmentResourceKubernetes("environmentResourceKubernetesResource", new()
{
EnvironmentId = 0,
Namespace = "string",
ProjectId = "string",
ServiceEndpointId = "string",
ClusterName = "string",
Name = "string",
Tags = new[]
{
"string",
},
});
example, err := azuredevops.NewEnvironmentResourceKubernetes(ctx, "environmentResourceKubernetesResource", &azuredevops.EnvironmentResourceKubernetesArgs{
EnvironmentId: pulumi.Int(0),
Namespace: pulumi.String("string"),
ProjectId: pulumi.String("string"),
ServiceEndpointId: pulumi.String("string"),
ClusterName: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
var environmentResourceKubernetesResource = new EnvironmentResourceKubernetes("environmentResourceKubernetesResource", EnvironmentResourceKubernetesArgs.builder()
.environmentId(0)
.namespace("string")
.projectId("string")
.serviceEndpointId("string")
.clusterName("string")
.name("string")
.tags("string")
.build());
environment_resource_kubernetes_resource = azuredevops.EnvironmentResourceKubernetes("environmentResourceKubernetesResource",
environment_id=0,
namespace="string",
project_id="string",
service_endpoint_id="string",
cluster_name="string",
name="string",
tags=["string"])
const environmentResourceKubernetesResource = new azuredevops.EnvironmentResourceKubernetes("environmentResourceKubernetesResource", {
environmentId: 0,
namespace: "string",
projectId: "string",
serviceEndpointId: "string",
clusterName: "string",
name: "string",
tags: ["string"],
});
type: azuredevops:EnvironmentResourceKubernetes
properties:
clusterName: string
environmentId: 0
name: string
namespace: string
projectId: string
serviceEndpointId: string
tags:
- string
EnvironmentResourceKubernetes Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The EnvironmentResourceKubernetes resource accepts the following input properties:
- Environment
Id int - The ID of the environment under which to create the Kubernetes Resource.
- Namespace string
- The namespace for the Kubernetes Resource.
- Project
Id string - The ID of the project.
- Service
Endpoint stringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- Cluster
Name string - A cluster name for the Kubernetes Resource.
- Name string
- The name for the Kubernetes Resource.
- List<string>
- A set of tags for the Kubernetes Resource.
- Environment
Id int - The ID of the environment under which to create the Kubernetes Resource.
- Namespace string
- The namespace for the Kubernetes Resource.
- Project
Id string - The ID of the project.
- Service
Endpoint stringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- Cluster
Name string - A cluster name for the Kubernetes Resource.
- Name string
- The name for the Kubernetes Resource.
- []string
- A set of tags for the Kubernetes Resource.
- environment
Id Integer - The ID of the environment under which to create the Kubernetes Resource.
- namespace String
- The namespace for the Kubernetes Resource.
- project
Id String - The ID of the project.
- service
Endpoint StringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- cluster
Name String - A cluster name for the Kubernetes Resource.
- name String
- The name for the Kubernetes Resource.
- List<String>
- A set of tags for the Kubernetes Resource.
- environment
Id number - The ID of the environment under which to create the Kubernetes Resource.
- namespace string
- The namespace for the Kubernetes Resource.
- project
Id string - The ID of the project.
- service
Endpoint stringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- cluster
Name string - A cluster name for the Kubernetes Resource.
- name string
- The name for the Kubernetes Resource.
- string[]
- A set of tags for the Kubernetes Resource.
- environment_
id int - The ID of the environment under which to create the Kubernetes Resource.
- namespace str
- The namespace for the Kubernetes Resource.
- project_
id str - The ID of the project.
- service_
endpoint_ strid - The ID of the service endpoint to associate with the Kubernetes Resource.
- cluster_
name str - A cluster name for the Kubernetes Resource.
- name str
- The name for the Kubernetes Resource.
- Sequence[str]
- A set of tags for the Kubernetes Resource.
- environment
Id Number - The ID of the environment under which to create the Kubernetes Resource.
- namespace String
- The namespace for the Kubernetes Resource.
- project
Id String - The ID of the project.
- service
Endpoint StringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- cluster
Name String - A cluster name for the Kubernetes Resource.
- name String
- The name for the Kubernetes Resource.
- List<String>
- A set of tags for the Kubernetes Resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the EnvironmentResourceKubernetes 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 EnvironmentResourceKubernetes Resource
Get an existing EnvironmentResourceKubernetes 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?: EnvironmentResourceKubernetesState, opts?: CustomResourceOptions): EnvironmentResourceKubernetes
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_name: Optional[str] = None,
environment_id: Optional[int] = None,
name: Optional[str] = None,
namespace: Optional[str] = None,
project_id: Optional[str] = None,
service_endpoint_id: Optional[str] = None,
tags: Optional[Sequence[str]] = None) -> EnvironmentResourceKubernetes
func GetEnvironmentResourceKubernetes(ctx *Context, name string, id IDInput, state *EnvironmentResourceKubernetesState, opts ...ResourceOption) (*EnvironmentResourceKubernetes, error)
public static EnvironmentResourceKubernetes Get(string name, Input<string> id, EnvironmentResourceKubernetesState? state, CustomResourceOptions? opts = null)
public static EnvironmentResourceKubernetes get(String name, Output<String> id, EnvironmentResourceKubernetesState 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.
- Cluster
Name string - A cluster name for the Kubernetes Resource.
- Environment
Id int - The ID of the environment under which to create the Kubernetes Resource.
- Name string
- The name for the Kubernetes Resource.
- Namespace string
- The namespace for the Kubernetes Resource.
- Project
Id string - The ID of the project.
- Service
Endpoint stringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- List<string>
- A set of tags for the Kubernetes Resource.
- Cluster
Name string - A cluster name for the Kubernetes Resource.
- Environment
Id int - The ID of the environment under which to create the Kubernetes Resource.
- Name string
- The name for the Kubernetes Resource.
- Namespace string
- The namespace for the Kubernetes Resource.
- Project
Id string - The ID of the project.
- Service
Endpoint stringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- []string
- A set of tags for the Kubernetes Resource.
- cluster
Name String - A cluster name for the Kubernetes Resource.
- environment
Id Integer - The ID of the environment under which to create the Kubernetes Resource.
- name String
- The name for the Kubernetes Resource.
- namespace String
- The namespace for the Kubernetes Resource.
- project
Id String - The ID of the project.
- service
Endpoint StringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- List<String>
- A set of tags for the Kubernetes Resource.
- cluster
Name string - A cluster name for the Kubernetes Resource.
- environment
Id number - The ID of the environment under which to create the Kubernetes Resource.
- name string
- The name for the Kubernetes Resource.
- namespace string
- The namespace for the Kubernetes Resource.
- project
Id string - The ID of the project.
- service
Endpoint stringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- string[]
- A set of tags for the Kubernetes Resource.
- cluster_
name str - A cluster name for the Kubernetes Resource.
- environment_
id int - The ID of the environment under which to create the Kubernetes Resource.
- name str
- The name for the Kubernetes Resource.
- namespace str
- The namespace for the Kubernetes Resource.
- project_
id str - The ID of the project.
- service_
endpoint_ strid - The ID of the service endpoint to associate with the Kubernetes Resource.
- Sequence[str]
- A set of tags for the Kubernetes Resource.
- cluster
Name String - A cluster name for the Kubernetes Resource.
- environment
Id Number - The ID of the environment under which to create the Kubernetes Resource.
- name String
- The name for the Kubernetes Resource.
- namespace String
- The namespace for the Kubernetes Resource.
- project
Id String - The ID of the project.
- service
Endpoint StringId - The ID of the service endpoint to associate with the Kubernetes Resource.
- List<String>
- A set of tags for the Kubernetes Resource.
Import
The resource does not support import.
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.