1. Packages
  2. OVH
  3. API Docs
  4. CloudProject
  5. KubeIpRestrictions
OVHCloud v1.1.0 published on Thursday, Nov 21, 2024 by OVHcloud

ovh.CloudProject.KubeIpRestrictions

Explore with Pulumi AI

ovh logo
OVHCloud v1.1.0 published on Thursday, Nov 21, 2024 by OVHcloud

    Apply IP restrictions to an OVHcloud Managed Kubernetes cluster.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const vrackOnly = new ovh.cloudproject.KubeIpRestrictions("vrackOnly", {
        ips: ["10.42.0.0/16"],
        kubeId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
        serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    vrack_only = ovh.cloud_project.KubeIpRestrictions("vrackOnly",
        ips=["10.42.0.0/16"],
        kube_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
        service_name="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/CloudProject"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := CloudProject.NewKubeIpRestrictions(ctx, "vrackOnly", &CloudProject.KubeIpRestrictionsArgs{
    			Ips: pulumi.StringArray{
    				pulumi.String("10.42.0.0/16"),
    			},
    			KubeId:      pulumi.String("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"),
    			ServiceName: pulumi.String("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var vrackOnly = new Ovh.CloudProject.KubeIpRestrictions("vrackOnly", new()
        {
            Ips = new[]
            {
                "10.42.0.0/16",
            },
            KubeId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
            ServiceName = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.CloudProject.KubeIpRestrictions;
    import com.pulumi.ovh.CloudProject.KubeIpRestrictionsArgs;
    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 vrackOnly = new KubeIpRestrictions("vrackOnly", KubeIpRestrictionsArgs.builder()
                .ips("10.42.0.0/16")
                .kubeId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx")
                .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
                .build());
    
        }
    }
    
    resources:
      vrackOnly:
        type: ovh:CloudProject:KubeIpRestrictions
        properties:
          ips:
            - 10.42.0.0/16
          kubeId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
          serviceName: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    

    Create KubeIpRestrictions Resource

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

    Constructor syntax

    new KubeIpRestrictions(name: string, args: KubeIpRestrictionsArgs, opts?: CustomResourceOptions);
    @overload
    def KubeIpRestrictions(resource_name: str,
                           args: KubeIpRestrictionsArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def KubeIpRestrictions(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           ips: Optional[Sequence[str]] = None,
                           kube_id: Optional[str] = None,
                           service_name: Optional[str] = None)
    func NewKubeIpRestrictions(ctx *Context, name string, args KubeIpRestrictionsArgs, opts ...ResourceOption) (*KubeIpRestrictions, error)
    public KubeIpRestrictions(string name, KubeIpRestrictionsArgs args, CustomResourceOptions? opts = null)
    public KubeIpRestrictions(String name, KubeIpRestrictionsArgs args)
    public KubeIpRestrictions(String name, KubeIpRestrictionsArgs args, CustomResourceOptions options)
    
    type: ovh:CloudProject:KubeIpRestrictions
    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 KubeIpRestrictionsArgs
    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 KubeIpRestrictionsArgs
    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 KubeIpRestrictionsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KubeIpRestrictionsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KubeIpRestrictionsArgs
    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 kubeIpRestrictionsResource = new Ovh.CloudProject.KubeIpRestrictions("kubeIpRestrictionsResource", new()
    {
        Ips = new[]
        {
            "string",
        },
        KubeId = "string",
        ServiceName = "string",
    });
    
    example, err := CloudProject.NewKubeIpRestrictions(ctx, "kubeIpRestrictionsResource", &CloudProject.KubeIpRestrictionsArgs{
    	Ips: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	KubeId:      pulumi.String("string"),
    	ServiceName: pulumi.String("string"),
    })
    
    var kubeIpRestrictionsResource = new KubeIpRestrictions("kubeIpRestrictionsResource", KubeIpRestrictionsArgs.builder()
        .ips("string")
        .kubeId("string")
        .serviceName("string")
        .build());
    
    kube_ip_restrictions_resource = ovh.cloud_project.KubeIpRestrictions("kubeIpRestrictionsResource",
        ips=["string"],
        kube_id="string",
        service_name="string")
    
    const kubeIpRestrictionsResource = new ovh.cloudproject.KubeIpRestrictions("kubeIpRestrictionsResource", {
        ips: ["string"],
        kubeId: "string",
        serviceName: "string",
    });
    
    type: ovh:CloudProject:KubeIpRestrictions
    properties:
        ips:
            - string
        kubeId: string
        serviceName: string
    

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

    Ips List<string>
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    KubeId string
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    Ips []string
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    KubeId string
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    ips List<String>
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    kubeId String
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    ips string[]
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    kubeId string
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    ips Sequence[str]
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    kube_id str
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    ips List<String>
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    kubeId String
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.

    Outputs

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

    Get an existing KubeIpRestrictions 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?: KubeIpRestrictionsState, opts?: CustomResourceOptions): KubeIpRestrictions
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ips: Optional[Sequence[str]] = None,
            kube_id: Optional[str] = None,
            service_name: Optional[str] = None) -> KubeIpRestrictions
    func GetKubeIpRestrictions(ctx *Context, name string, id IDInput, state *KubeIpRestrictionsState, opts ...ResourceOption) (*KubeIpRestrictions, error)
    public static KubeIpRestrictions Get(string name, Input<string> id, KubeIpRestrictionsState? state, CustomResourceOptions? opts = null)
    public static KubeIpRestrictions get(String name, Output<String> id, KubeIpRestrictionsState 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:
    Ips List<string>
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    KubeId string
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    Ips []string
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    KubeId string
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    ips List<String>
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    kubeId String
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    ips string[]
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    kubeId string
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    ips Sequence[str]
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    kube_id str
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.
    ips List<String>
    List of CIDR authorized to interact with the managed Kubernetes cluster.
    kubeId String
    The id of the managed Kubernetes cluster. Changing this value recreates the resource.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used. Changing this value recreates the resource.

    Import

    OVHcloud Managed Kubernetes Service cluster IP restrictions can be imported using the service_name and the id of the cluster, separated by “/” E.g.,

    bash

    $ pulumi import ovh:CloudProject/kubeIpRestrictions:KubeIpRestrictions iprestrictions service_name/kube_id
    

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

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v1.1.0 published on Thursday, Nov 21, 2024 by OVHcloud