ovh.Hosting.PrivateDatabaseUserGrant
Explore with Pulumi AI
Add grant on a database in your private cloud database instance.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
const userGrant = new ovh.hosting.PrivateDatabaseUserGrant("userGrant", {
databaseName: "ovhcloud",
grant: "admin",
serviceName: "XXXXXX",
userName: "terraform",
});
import pulumi
import pulumi_ovh as ovh
user_grant = ovh.hosting.PrivateDatabaseUserGrant("userGrant",
database_name="ovhcloud",
grant="admin",
service_name="XXXXXX",
user_name="terraform")
package main
import (
"github.com/ovh/pulumi-ovh/sdk/go/ovh/Hosting"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Hosting.NewPrivateDatabaseUserGrant(ctx, "userGrant", &Hosting.PrivateDatabaseUserGrantArgs{
DatabaseName: pulumi.String("ovhcloud"),
Grant: pulumi.String("admin"),
ServiceName: pulumi.String("XXXXXX"),
UserName: pulumi.String("terraform"),
})
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 userGrant = new Ovh.Hosting.PrivateDatabaseUserGrant("userGrant", new()
{
DatabaseName = "ovhcloud",
Grant = "admin",
ServiceName = "XXXXXX",
UserName = "terraform",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.Hosting.PrivateDatabaseUserGrant;
import com.pulumi.ovh.Hosting.PrivateDatabaseUserGrantArgs;
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 userGrant = new PrivateDatabaseUserGrant("userGrant", PrivateDatabaseUserGrantArgs.builder()
.databaseName("ovhcloud")
.grant("admin")
.serviceName("XXXXXX")
.userName("terraform")
.build());
}
}
resources:
userGrant:
type: ovh:Hosting:PrivateDatabaseUserGrant
properties:
databaseName: ovhcloud
grant: admin
serviceName: XXXXXX
userName: terraform
Create PrivateDatabaseUserGrant Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PrivateDatabaseUserGrant(name: string, args: PrivateDatabaseUserGrantArgs, opts?: CustomResourceOptions);
@overload
def PrivateDatabaseUserGrant(resource_name: str,
args: PrivateDatabaseUserGrantArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PrivateDatabaseUserGrant(resource_name: str,
opts: Optional[ResourceOptions] = None,
database_name: Optional[str] = None,
grant: Optional[str] = None,
service_name: Optional[str] = None,
user_name: Optional[str] = None)
func NewPrivateDatabaseUserGrant(ctx *Context, name string, args PrivateDatabaseUserGrantArgs, opts ...ResourceOption) (*PrivateDatabaseUserGrant, error)
public PrivateDatabaseUserGrant(string name, PrivateDatabaseUserGrantArgs args, CustomResourceOptions? opts = null)
public PrivateDatabaseUserGrant(String name, PrivateDatabaseUserGrantArgs args)
public PrivateDatabaseUserGrant(String name, PrivateDatabaseUserGrantArgs args, CustomResourceOptions options)
type: ovh:Hosting:PrivateDatabaseUserGrant
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 PrivateDatabaseUserGrantArgs
- 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 PrivateDatabaseUserGrantArgs
- 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 PrivateDatabaseUserGrantArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrivateDatabaseUserGrantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrivateDatabaseUserGrantArgs
- 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 privateDatabaseUserGrantResource = new Ovh.Hosting.PrivateDatabaseUserGrant("privateDatabaseUserGrantResource", new()
{
DatabaseName = "string",
Grant = "string",
ServiceName = "string",
UserName = "string",
});
example, err := Hosting.NewPrivateDatabaseUserGrant(ctx, "privateDatabaseUserGrantResource", &Hosting.PrivateDatabaseUserGrantArgs{
DatabaseName: pulumi.String("string"),
Grant: pulumi.String("string"),
ServiceName: pulumi.String("string"),
UserName: pulumi.String("string"),
})
var privateDatabaseUserGrantResource = new PrivateDatabaseUserGrant("privateDatabaseUserGrantResource", PrivateDatabaseUserGrantArgs.builder()
.databaseName("string")
.grant("string")
.serviceName("string")
.userName("string")
.build());
private_database_user_grant_resource = ovh.hosting.PrivateDatabaseUserGrant("privateDatabaseUserGrantResource",
database_name="string",
grant="string",
service_name="string",
user_name="string")
const privateDatabaseUserGrantResource = new ovh.hosting.PrivateDatabaseUserGrant("privateDatabaseUserGrantResource", {
databaseName: "string",
grant: "string",
serviceName: "string",
userName: "string",
});
type: ovh:Hosting:PrivateDatabaseUserGrant
properties:
databaseName: string
grant: string
serviceName: string
userName: string
PrivateDatabaseUserGrant 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 PrivateDatabaseUserGrant resource accepts the following input properties:
- Database
Name string - Database name where add grant.
- Grant string
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- Service
Name string - The internal name of your private database.
- User
Name string - User name used to connect on your databases.
- Database
Name string - Database name where add grant.
- Grant string
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- Service
Name string - The internal name of your private database.
- User
Name string - User name used to connect on your databases.
- database
Name String - Database name where add grant.
- grant String
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- service
Name String - The internal name of your private database.
- user
Name String - User name used to connect on your databases.
- database
Name string - Database name where add grant.
- grant string
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- service
Name string - The internal name of your private database.
- user
Name string - User name used to connect on your databases.
- database_
name str - Database name where add grant.
- grant str
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- service_
name str - The internal name of your private database.
- user_
name str - User name used to connect on your databases.
- database
Name String - Database name where add grant.
- grant String
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- service
Name String - The internal name of your private database.
- user
Name String - User name used to connect on your databases.
Outputs
All input properties are implicitly available as output properties. Additionally, the PrivateDatabaseUserGrant 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 PrivateDatabaseUserGrant Resource
Get an existing PrivateDatabaseUserGrant 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?: PrivateDatabaseUserGrantState, opts?: CustomResourceOptions): PrivateDatabaseUserGrant
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
database_name: Optional[str] = None,
grant: Optional[str] = None,
service_name: Optional[str] = None,
user_name: Optional[str] = None) -> PrivateDatabaseUserGrant
func GetPrivateDatabaseUserGrant(ctx *Context, name string, id IDInput, state *PrivateDatabaseUserGrantState, opts ...ResourceOption) (*PrivateDatabaseUserGrant, error)
public static PrivateDatabaseUserGrant Get(string name, Input<string> id, PrivateDatabaseUserGrantState? state, CustomResourceOptions? opts = null)
public static PrivateDatabaseUserGrant get(String name, Output<String> id, PrivateDatabaseUserGrantState 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.
- Database
Name string - Database name where add grant.
- Grant string
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- Service
Name string - The internal name of your private database.
- User
Name string - User name used to connect on your databases.
- Database
Name string - Database name where add grant.
- Grant string
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- Service
Name string - The internal name of your private database.
- User
Name string - User name used to connect on your databases.
- database
Name String - Database name where add grant.
- grant String
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- service
Name String - The internal name of your private database.
- user
Name String - User name used to connect on your databases.
- database
Name string - Database name where add grant.
- grant string
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- service
Name string - The internal name of your private database.
- user
Name string - User name used to connect on your databases.
- database_
name str - Database name where add grant.
- grant str
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- service_
name str - The internal name of your private database.
- user_
name str - User name used to connect on your databases.
- database
Name String - Database name where add grant.
- grant String
- Database name where add grant. Values can be:
- admin
- none
- ro
- rw
- service
Name String - The internal name of your private database.
- user
Name String - User name used to connect on your databases.
Import
OVHcloud database user’s grant can be imported using the service_name
, the user_name
, the database_name
and the grant
, separated by “/” E.g.,
$ pulumi import ovh:Hosting/privateDatabaseUserGrant:PrivateDatabaseUserGrant user service_name/user_name/database_name/grant
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.