1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ContainerEngine
  5. ClusterWorkloadMapping
Oracle Cloud Infrastructure v1.10.0 published on Thursday, Sep 7, 2023 by Pulumi

oci.ContainerEngine.ClusterWorkloadMapping

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.10.0 published on Thursday, Sep 7, 2023 by Pulumi

    This resource provides the Cluster Workload Mapping resource in Oracle Cloud Infrastructure Container Engine service.

    Create the specified workloadMapping for a cluster.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testClusterWorkloadMapping = new Oci.ContainerEngine.ClusterWorkloadMapping("testClusterWorkloadMapping", new()
        {
            ClusterId = oci_containerengine_cluster.Test_cluster.Id,
            MappedCompartmentId = oci_identity_compartment.Test_compartment.Id,
            Namespace = @var.Cluster_workload_mapping_namespace,
            DefinedTags = 
            {
                { "Operations.CostCenter", "42" },
            },
            FreeformTags = 
            {
                { "Department", "Finance" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/ContainerEngine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ContainerEngine.NewClusterWorkloadMapping(ctx, "testClusterWorkloadMapping", &ContainerEngine.ClusterWorkloadMappingArgs{
    			ClusterId:           pulumi.Any(oci_containerengine_cluster.Test_cluster.Id),
    			MappedCompartmentId: pulumi.Any(oci_identity_compartment.Test_compartment.Id),
    			Namespace:           pulumi.Any(_var.Cluster_workload_mapping_namespace),
    			DefinedTags: pulumi.AnyMap{
    				"Operations.CostCenter": pulumi.Any("42"),
    			},
    			FreeformTags: pulumi.AnyMap{
    				"Department": pulumi.Any("Finance"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ContainerEngine.ClusterWorkloadMapping;
    import com.pulumi.oci.ContainerEngine.ClusterWorkloadMappingArgs;
    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 testClusterWorkloadMapping = new ClusterWorkloadMapping("testClusterWorkloadMapping", ClusterWorkloadMappingArgs.builder()        
                .clusterId(oci_containerengine_cluster.test_cluster().id())
                .mappedCompartmentId(oci_identity_compartment.test_compartment().id())
                .namespace(var_.cluster_workload_mapping_namespace())
                .definedTags(Map.of("Operations.CostCenter", "42"))
                .freeformTags(Map.of("Department", "Finance"))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_oci as oci
    
    test_cluster_workload_mapping = oci.container_engine.ClusterWorkloadMapping("testClusterWorkloadMapping",
        cluster_id=oci_containerengine_cluster["test_cluster"]["id"],
        mapped_compartment_id=oci_identity_compartment["test_compartment"]["id"],
        namespace=var["cluster_workload_mapping_namespace"],
        defined_tags={
            "Operations.CostCenter": "42",
        },
        freeform_tags={
            "Department": "Finance",
        })
    
    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testClusterWorkloadMapping = new oci.containerengine.ClusterWorkloadMapping("testClusterWorkloadMapping", {
        clusterId: oci_containerengine_cluster.test_cluster.id,
        mappedCompartmentId: oci_identity_compartment.test_compartment.id,
        namespace: _var.cluster_workload_mapping_namespace,
        definedTags: {
            "Operations.CostCenter": "42",
        },
        freeformTags: {
            Department: "Finance",
        },
    });
    
    resources:
      testClusterWorkloadMapping:
        type: oci:ContainerEngine:ClusterWorkloadMapping
        properties:
          #Required
          clusterId: ${oci_containerengine_cluster.test_cluster.id}
          mappedCompartmentId: ${oci_identity_compartment.test_compartment.id}
          namespace: ${var.cluster_workload_mapping_namespace}
          #Optional
          definedTags:
            Operations.CostCenter: '42'
          freeformTags:
            Department: Finance
    

    Create ClusterWorkloadMapping Resource

    new ClusterWorkloadMapping(name: string, args: ClusterWorkloadMappingArgs, opts?: CustomResourceOptions);
    @overload
    def ClusterWorkloadMapping(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               cluster_id: Optional[str] = None,
                               defined_tags: Optional[Mapping[str, Any]] = None,
                               freeform_tags: Optional[Mapping[str, Any]] = None,
                               mapped_compartment_id: Optional[str] = None,
                               namespace: Optional[str] = None)
    @overload
    def ClusterWorkloadMapping(resource_name: str,
                               args: ClusterWorkloadMappingArgs,
                               opts: Optional[ResourceOptions] = None)
    func NewClusterWorkloadMapping(ctx *Context, name string, args ClusterWorkloadMappingArgs, opts ...ResourceOption) (*ClusterWorkloadMapping, error)
    public ClusterWorkloadMapping(string name, ClusterWorkloadMappingArgs args, CustomResourceOptions? opts = null)
    public ClusterWorkloadMapping(String name, ClusterWorkloadMappingArgs args)
    public ClusterWorkloadMapping(String name, ClusterWorkloadMappingArgs args, CustomResourceOptions options)
    
    type: oci:ContainerEngine:ClusterWorkloadMapping
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ClusterWorkloadMappingArgs
    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 ClusterWorkloadMappingArgs
    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 ClusterWorkloadMappingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClusterWorkloadMappingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClusterWorkloadMappingArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    ClusterId string

    The OCID of the cluster.

    MappedCompartmentId string

    (Updatable) The OCID of the mapped customer compartment.

    Namespace string

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    DefinedTags Dictionary<string, object>

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    FreeformTags Dictionary<string, object>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ClusterId string

    The OCID of the cluster.

    MappedCompartmentId string

    (Updatable) The OCID of the mapped customer compartment.

    Namespace string

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    DefinedTags map[string]interface{}

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    FreeformTags map[string]interface{}

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    clusterId String

    The OCID of the cluster.

    mappedCompartmentId String

    (Updatable) The OCID of the mapped customer compartment.

    namespace String

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    definedTags Map<String,Object>

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    freeformTags Map<String,Object>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    clusterId string

    The OCID of the cluster.

    mappedCompartmentId string

    (Updatable) The OCID of the mapped customer compartment.

    namespace string

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    definedTags {[key: string]: any}

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    freeformTags {[key: string]: any}

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    cluster_id str

    The OCID of the cluster.

    mapped_compartment_id str

    (Updatable) The OCID of the mapped customer compartment.

    namespace str

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    defined_tags Mapping[str, Any]

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    freeform_tags Mapping[str, Any]

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    clusterId String

    The OCID of the cluster.

    mappedCompartmentId String

    (Updatable) The OCID of the mapped customer compartment.

    namespace String

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    definedTags Map<Any>

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    freeformTags Map<Any>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ClusterWorkloadMapping resource produces the following output properties:

    Id string

    The provider-assigned unique ID for this managed resource.

    MappedTenancyId string

    The OCID of the mapped customer tenancy.

    State string

    The state of the workloadMapping.

    TimeCreated string

    The time the cluster was created.

    Id string

    The provider-assigned unique ID for this managed resource.

    MappedTenancyId string

    The OCID of the mapped customer tenancy.

    State string

    The state of the workloadMapping.

    TimeCreated string

    The time the cluster was created.

    id String

    The provider-assigned unique ID for this managed resource.

    mappedTenancyId String

    The OCID of the mapped customer tenancy.

    state String

    The state of the workloadMapping.

    timeCreated String

    The time the cluster was created.

    id string

    The provider-assigned unique ID for this managed resource.

    mappedTenancyId string

    The OCID of the mapped customer tenancy.

    state string

    The state of the workloadMapping.

    timeCreated string

    The time the cluster was created.

    id str

    The provider-assigned unique ID for this managed resource.

    mapped_tenancy_id str

    The OCID of the mapped customer tenancy.

    state str

    The state of the workloadMapping.

    time_created str

    The time the cluster was created.

    id String

    The provider-assigned unique ID for this managed resource.

    mappedTenancyId String

    The OCID of the mapped customer tenancy.

    state String

    The state of the workloadMapping.

    timeCreated String

    The time the cluster was created.

    Look up Existing ClusterWorkloadMapping Resource

    Get an existing ClusterWorkloadMapping 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?: ClusterWorkloadMappingState, opts?: CustomResourceOptions): ClusterWorkloadMapping
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            defined_tags: Optional[Mapping[str, Any]] = None,
            freeform_tags: Optional[Mapping[str, Any]] = None,
            mapped_compartment_id: Optional[str] = None,
            mapped_tenancy_id: Optional[str] = None,
            namespace: Optional[str] = None,
            state: Optional[str] = None,
            time_created: Optional[str] = None) -> ClusterWorkloadMapping
    func GetClusterWorkloadMapping(ctx *Context, name string, id IDInput, state *ClusterWorkloadMappingState, opts ...ResourceOption) (*ClusterWorkloadMapping, error)
    public static ClusterWorkloadMapping Get(string name, Input<string> id, ClusterWorkloadMappingState? state, CustomResourceOptions? opts = null)
    public static ClusterWorkloadMapping get(String name, Output<String> id, ClusterWorkloadMappingState 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:
    ClusterId string

    The OCID of the cluster.

    DefinedTags Dictionary<string, object>

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    FreeformTags Dictionary<string, object>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    MappedCompartmentId string

    (Updatable) The OCID of the mapped customer compartment.

    MappedTenancyId string

    The OCID of the mapped customer tenancy.

    Namespace string

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    State string

    The state of the workloadMapping.

    TimeCreated string

    The time the cluster was created.

    ClusterId string

    The OCID of the cluster.

    DefinedTags map[string]interface{}

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    FreeformTags map[string]interface{}

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    MappedCompartmentId string

    (Updatable) The OCID of the mapped customer compartment.

    MappedTenancyId string

    The OCID of the mapped customer tenancy.

    Namespace string

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    State string

    The state of the workloadMapping.

    TimeCreated string

    The time the cluster was created.

    clusterId String

    The OCID of the cluster.

    definedTags Map<String,Object>

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    freeformTags Map<String,Object>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    mappedCompartmentId String

    (Updatable) The OCID of the mapped customer compartment.

    mappedTenancyId String

    The OCID of the mapped customer tenancy.

    namespace String

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state String

    The state of the workloadMapping.

    timeCreated String

    The time the cluster was created.

    clusterId string

    The OCID of the cluster.

    definedTags {[key: string]: any}

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    freeformTags {[key: string]: any}

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    mappedCompartmentId string

    (Updatable) The OCID of the mapped customer compartment.

    mappedTenancyId string

    The OCID of the mapped customer tenancy.

    namespace string

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state string

    The state of the workloadMapping.

    timeCreated string

    The time the cluster was created.

    cluster_id str

    The OCID of the cluster.

    defined_tags Mapping[str, Any]

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    freeform_tags Mapping[str, Any]

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    mapped_compartment_id str

    (Updatable) The OCID of the mapped customer compartment.

    mapped_tenancy_id str

    The OCID of the mapped customer tenancy.

    namespace str

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state str

    The state of the workloadMapping.

    time_created str

    The time the cluster was created.

    clusterId String

    The OCID of the cluster.

    definedTags Map<Any>

    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

    freeformTags Map<Any>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    mappedCompartmentId String

    (Updatable) The OCID of the mapped customer compartment.

    mappedTenancyId String

    The OCID of the mapped customer tenancy.

    namespace String

    The namespace of the workloadMapping.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state String

    The state of the workloadMapping.

    timeCreated String

    The time the cluster was created.

    Import

    ClusterWorkloadMappings can be imported using the id, e.g.

     $ pulumi import oci:ContainerEngine/clusterWorkloadMapping:ClusterWorkloadMapping test_cluster_workload_mapping "clusters/{clusterId}/workloadMappings/{workloadMappingId}"
    

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the oci Terraform Provider.

    oci logo
    Oracle Cloud Infrastructure v1.10.0 published on Thursday, Sep 7, 2023 by Pulumi