Ovh

v0.0.4 published on Saturday, Sep 17, 2022 by lbrlabs

CloudProjectDatabaseIpRestriction

Apply IP restrictions to an OVHcloud Managed Database cluster.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Ovh = Lbrlabs.PulumiPackage.Ovh;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var db = Ovh.GetCloudProjectDatabase.Invoke(new()
    {
        ServiceName = "XXXX",
        Engine = "YYYY",
        ClusterId = "ZZZZ",
    });

    var iprestriction = new Ovh.CloudProjectDatabaseIpRestriction("iprestriction", new()
    {
        ServiceName = ovh_cloud_project_database.Db.Service_name,
        Engine = ovh_cloud_project_database.Db.Engine,
        ClusterId = ovh_cloud_project_database.Db.Cluster_id,
        Ip = "178.97.6.0/24",
    });

});
package main

import (
	"github.com/lbrlabs/pulumi-ovh/sdk/go/ovh"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ovh.LookupCloudProjectDatabase(ctx, &GetCloudProjectDatabaseArgs{
			ServiceName: "XXXX",
			Engine:      "YYYY",
			ClusterId:   "ZZZZ",
		}, nil)
		if err != nil {
			return err
		}
		_, err = ovh.NewCloudProjectDatabaseIpRestriction(ctx, "iprestriction", &ovh.CloudProjectDatabaseIpRestrictionArgs{
			ServiceName: pulumi.Any(ovh_cloud_project_database.Db.Service_name),
			Engine:      pulumi.Any(ovh_cloud_project_database.Db.Engine),
			ClusterId:   pulumi.Any(ovh_cloud_project_database.Db.Cluster_id),
			Ip:          pulumi.String("178.97.6.0/24"),
		})
		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.ovh.OvhFunctions;
import com.pulumi.ovh.inputs.GetCloudProjectDatabaseArgs;
import com.pulumi.ovh.CloudProjectDatabaseIpRestriction;
import com.pulumi.ovh.CloudProjectDatabaseIpRestrictionArgs;
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) {
        final var db = OvhFunctions.getCloudProjectDatabase(GetCloudProjectDatabaseArgs.builder()
            .serviceName("XXXX")
            .engine("YYYY")
            .clusterId("ZZZZ")
            .build());

        var iprestriction = new CloudProjectDatabaseIpRestriction("iprestriction", CloudProjectDatabaseIpRestrictionArgs.builder()        
            .serviceName(ovh_cloud_project_database.db().service_name())
            .engine(ovh_cloud_project_database.db().engine())
            .clusterId(ovh_cloud_project_database.db().cluster_id())
            .ip("178.97.6.0/24")
            .build());

    }
}
import pulumi
import lbrlabs_pulumi_ovh as ovh
import pulumi_ovh as ovh

db = ovh.get_cloud_project_database(service_name="XXXX",
    engine="YYYY",
    cluster_id="ZZZZ")
iprestriction = ovh.CloudProjectDatabaseIpRestriction("iprestriction",
    service_name=ovh_cloud_project_database["db"]["service_name"],
    engine=ovh_cloud_project_database["db"]["engine"],
    cluster_id=ovh_cloud_project_database["db"]["cluster_id"],
    ip="178.97.6.0/24")
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@lbrlabs/pulumi-ovh";
import * as ovh from "@pulumi/ovh";

const db = ovh.getCloudProjectDatabase({
    serviceName: "XXXX",
    engine: "YYYY",
    clusterId: "ZZZZ",
});
const iprestriction = new ovh.CloudProjectDatabaseIpRestriction("iprestriction", {
    serviceName: ovh_cloud_project_database.db.service_name,
    engine: ovh_cloud_project_database.db.engine,
    clusterId: ovh_cloud_project_database.db.cluster_id,
    ip: "178.97.6.0/24",
});
resources:
  iprestriction:
    type: ovh:CloudProjectDatabaseIpRestriction
    properties:
      serviceName: ${ovh_cloud_project_database.db.service_name}
      engine: ${ovh_cloud_project_database.db.engine}
      clusterId: ${ovh_cloud_project_database.db.cluster_id}
      ip: 178.97.6.0/24
variables:
  db:
    Fn::Invoke:
      Function: ovh:getCloudProjectDatabase
      Arguments:
        serviceName: XXXX
        engine: YYYY
        clusterId: ZZZZ

Create a CloudProjectDatabaseIpRestriction Resource

new CloudProjectDatabaseIpRestriction(name: string, args: CloudProjectDatabaseIpRestrictionArgs, opts?: CustomResourceOptions);
@overload
def CloudProjectDatabaseIpRestriction(resource_name: str,
                                      opts: Optional[ResourceOptions] = None,
                                      cluster_id: Optional[str] = None,
                                      description: Optional[str] = None,
                                      engine: Optional[str] = None,
                                      ip: Optional[str] = None,
                                      service_name: Optional[str] = None)
@overload
def CloudProjectDatabaseIpRestriction(resource_name: str,
                                      args: CloudProjectDatabaseIpRestrictionArgs,
                                      opts: Optional[ResourceOptions] = None)
func NewCloudProjectDatabaseIpRestriction(ctx *Context, name string, args CloudProjectDatabaseIpRestrictionArgs, opts ...ResourceOption) (*CloudProjectDatabaseIpRestriction, error)
public CloudProjectDatabaseIpRestriction(string name, CloudProjectDatabaseIpRestrictionArgs args, CustomResourceOptions? opts = null)
public CloudProjectDatabaseIpRestriction(String name, CloudProjectDatabaseIpRestrictionArgs args)
public CloudProjectDatabaseIpRestriction(String name, CloudProjectDatabaseIpRestrictionArgs args, CustomResourceOptions options)
type: ovh:CloudProjectDatabaseIpRestriction
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CloudProjectDatabaseIpRestrictionArgs
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 CloudProjectDatabaseIpRestrictionArgs
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 CloudProjectDatabaseIpRestrictionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CloudProjectDatabaseIpRestrictionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CloudProjectDatabaseIpRestrictionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

ClusterId string

Cluster ID.

Engine string

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

Ip string

Authorized IP.

ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

Description string

Description of the IP restriction.

ClusterId string

Cluster ID.

Engine string

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

Ip string

Authorized IP.

ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

Description string

Description of the IP restriction.

clusterId String

Cluster ID.

engine String

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

ip String

Authorized IP.

serviceName String

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

description String

Description of the IP restriction.

clusterId string

Cluster ID.

engine string

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

ip string

Authorized IP.

serviceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

description string

Description of the IP restriction.

cluster_id str

Cluster ID.

engine str

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

ip str

Authorized IP.

service_name str

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

description str

Description of the IP restriction.

clusterId String

Cluster ID.

engine String

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

ip String

Authorized IP.

serviceName String

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

description String

Description of the IP restriction.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

Current status of the IP restriction.

Id string

The provider-assigned unique ID for this managed resource.

Status string

Current status of the IP restriction.

id String

The provider-assigned unique ID for this managed resource.

status String

Current status of the IP restriction.

id string

The provider-assigned unique ID for this managed resource.

status string

Current status of the IP restriction.

id str

The provider-assigned unique ID for this managed resource.

status str

Current status of the IP restriction.

id String

The provider-assigned unique ID for this managed resource.

status String

Current status of the IP restriction.

Look up an Existing CloudProjectDatabaseIpRestriction Resource

Get an existing CloudProjectDatabaseIpRestriction 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?: CloudProjectDatabaseIpRestrictionState, opts?: CustomResourceOptions): CloudProjectDatabaseIpRestriction
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        description: Optional[str] = None,
        engine: Optional[str] = None,
        ip: Optional[str] = None,
        service_name: Optional[str] = None,
        status: Optional[str] = None) -> CloudProjectDatabaseIpRestriction
func GetCloudProjectDatabaseIpRestriction(ctx *Context, name string, id IDInput, state *CloudProjectDatabaseIpRestrictionState, opts ...ResourceOption) (*CloudProjectDatabaseIpRestriction, error)
public static CloudProjectDatabaseIpRestriction Get(string name, Input<string> id, CloudProjectDatabaseIpRestrictionState? state, CustomResourceOptions? opts = null)
public static CloudProjectDatabaseIpRestriction get(String name, Output<String> id, CloudProjectDatabaseIpRestrictionState 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

Cluster ID.

Description string

Description of the IP restriction.

Engine string

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

Ip string

Authorized IP.

ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

Status string

Current status of the IP restriction.

ClusterId string

Cluster ID.

Description string

Description of the IP restriction.

Engine string

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

Ip string

Authorized IP.

ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

Status string

Current status of the IP restriction.

clusterId String

Cluster ID.

description String

Description of the IP restriction.

engine String

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

ip String

Authorized IP.

serviceName String

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

status String

Current status of the IP restriction.

clusterId string

Cluster ID.

description string

Description of the IP restriction.

engine string

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

ip string

Authorized IP.

serviceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

status string

Current status of the IP restriction.

cluster_id str

Cluster ID.

description str

Description of the IP restriction.

engine str

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

ip str

Authorized IP.

service_name str

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

status str

Current status of the IP restriction.

clusterId String

Cluster ID.

description String

Description of the IP restriction.

engine String

The engine of the database cluster you want to add an IP restriction. To get a full list of available engine visit. public documentation.

ip String

Authorized IP.

serviceName String

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

status String

Current status of the IP restriction.

Import

OVHcloud Managed database cluster IP restrictions can be imported using the service_name, engine, cluster_id and the ip, separated by “/” E.g.,

 $ pulumi import ovh:index/cloudProjectDatabaseIpRestriction:CloudProjectDatabaseIpRestriction my_ip_restriction <service_name>/<engine>/<cluster_id>/178.97.6.0/24

Package Details

Repository
https://github.com/lbrlabs/pulumi-ovh
License
Apache-2.0
Notes

This Pulumi package is based on the ovh Terraform Provider.