1. Packages
  2. OVH
  3. API Docs
  4. CloudProject
  5. KubeIpRestrictions
OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud

ovh.CloudProject.KubeIpRestrictions

Explore with Pulumi AI

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",
});
Copy
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")
Copy
package main

import (
	"github.com/ovh/pulumi-ovh/sdk/v2/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
	})
}
Copy
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",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.ovhcloud.pulumi.ovh.CloudProject.KubeIpRestrictions;
import com.ovhcloud.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());

    }
}
Copy
resources:
  vrackOnly:
    type: ovh:CloudProject:KubeIpRestrictions
    properties:
      ips:
        - 10.42.0.0/16
      kubeId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
      serviceName: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. KubeIpRestrictionsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. KubeIpRestrictionsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. KubeIpRestrictionsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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",
});
Copy
example, err := cloudproject.NewKubeIpRestrictions(ctx, "kubeIpRestrictionsResource", &cloudproject.KubeIpRestrictionsArgs{
	Ips: pulumi.StringArray{
		pulumi.String("string"),
	},
	KubeId:      pulumi.String("string"),
	ServiceName: pulumi.String("string"),
})
Copy
var kubeIpRestrictionsResource = new KubeIpRestrictions("kubeIpRestrictionsResource", KubeIpRestrictionsArgs.builder()
    .ips("string")
    .kubeId("string")
    .serviceName("string")
    .build());
Copy
kube_ip_restrictions_resource = ovh.cloud_project.KubeIpRestrictions("kubeIpRestrictionsResource",
    ips=["string"],
    kube_id="string",
    service_name="string")
Copy
const kubeIpRestrictionsResource = new ovh.cloudproject.KubeIpRestrictions("kubeIpRestrictionsResource", {
    ips: ["string"],
    kubeId: "string",
    serviceName: "string",
});
Copy
type: ovh:CloudProject:KubeIpRestrictions
properties:
    ips:
        - string
    kubeId: string
    serviceName: string
Copy

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 This property is required. List<string>
List of CIDR authorized to interact with the managed Kubernetes cluster.
KubeId
This property is required.
Changes to this property will trigger replacement.
string
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
ServiceName
This property is required.
Changes to this property will trigger replacement.
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 This property is required. []string
List of CIDR authorized to interact with the managed Kubernetes cluster.
KubeId
This property is required.
Changes to this property will trigger replacement.
string
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
ServiceName
This property is required.
Changes to this property will trigger replacement.
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 This property is required. List<String>
List of CIDR authorized to interact with the managed Kubernetes cluster.
kubeId
This property is required.
Changes to this property will trigger replacement.
String
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
serviceName
This property is required.
Changes to this property will trigger replacement.
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 This property is required. string[]
List of CIDR authorized to interact with the managed Kubernetes cluster.
kubeId
This property is required.
Changes to this property will trigger replacement.
string
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
serviceName
This property is required.
Changes to this property will trigger replacement.
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 This property is required. Sequence[str]
List of CIDR authorized to interact with the managed Kubernetes cluster.
kube_id
This property is required.
Changes to this property will trigger replacement.
str
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
service_name
This property is required.
Changes to this property will trigger replacement.
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 This property is required. List<String>
List of CIDR authorized to interact with the managed Kubernetes cluster.
kubeId
This property is required.
Changes to this property will trigger replacement.
String
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
serviceName
This property is required.
Changes to this property will trigger replacement.
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)
resources:  _:    type: ovh:CloudProject:KubeIpRestrictions    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
ServiceName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
ServiceName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
serviceName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
serviceName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
service_name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The id of the managed Kubernetes cluster. Changing this value recreates the resource.
serviceName Changes to this property will trigger replacement. 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
Copy

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.