1. Packages
  2. Azure Classic
  3. API Docs
  4. cosmosdb
  5. PostgresqlRole

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.cosmosdb.PostgresqlRole

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Manages an Azure Cosmos DB for PostgreSQL Role.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const examplePostgresqlCluster = new azure.cosmosdb.PostgresqlCluster("example", {
        name: "examplecluster",
        resourceGroupName: example.name,
        location: example.location,
        administratorLoginPassword: "H@Sh1CoR3!",
        coordinatorStorageQuotaInMb: 131072,
        coordinatorVcoreCount: 2,
        nodeCount: 0,
    });
    const examplePostgresqlRole = new azure.cosmosdb.PostgresqlRole("example", {
        name: "examplerole",
        clusterId: examplePostgresqlCluster.id,
        password: "H@Sh1CoR3!",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("example",
        name="examplecluster",
        resource_group_name=example.name,
        location=example.location,
        administrator_login_password="H@Sh1CoR3!",
        coordinator_storage_quota_in_mb=131072,
        coordinator_vcore_count=2,
        node_count=0)
    example_postgresql_role = azure.cosmosdb.PostgresqlRole("example",
        name="examplerole",
        cluster_id=example_postgresql_cluster.id,
        password="H@Sh1CoR3!")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		examplePostgresqlCluster, err := cosmosdb.NewPostgresqlCluster(ctx, "example", &cosmosdb.PostgresqlClusterArgs{
    			Name:                        pulumi.String("examplecluster"),
    			ResourceGroupName:           example.Name,
    			Location:                    example.Location,
    			AdministratorLoginPassword:  pulumi.String("H@Sh1CoR3!"),
    			CoordinatorStorageQuotaInMb: pulumi.Int(131072),
    			CoordinatorVcoreCount:       pulumi.Int(2),
    			NodeCount:                   pulumi.Int(0),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cosmosdb.NewPostgresqlRole(ctx, "example", &cosmosdb.PostgresqlRoleArgs{
    			Name:      pulumi.String("examplerole"),
    			ClusterId: examplePostgresqlCluster.ID(),
    			Password:  pulumi.String("H@Sh1CoR3!"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var examplePostgresqlCluster = new Azure.CosmosDB.PostgresqlCluster("example", new()
        {
            Name = "examplecluster",
            ResourceGroupName = example.Name,
            Location = example.Location,
            AdministratorLoginPassword = "H@Sh1CoR3!",
            CoordinatorStorageQuotaInMb = 131072,
            CoordinatorVcoreCount = 2,
            NodeCount = 0,
        });
    
        var examplePostgresqlRole = new Azure.CosmosDB.PostgresqlRole("example", new()
        {
            Name = "examplerole",
            ClusterId = examplePostgresqlCluster.Id,
            Password = "H@Sh1CoR3!",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.cosmosdb.PostgresqlCluster;
    import com.pulumi.azure.cosmosdb.PostgresqlClusterArgs;
    import com.pulumi.azure.cosmosdb.PostgresqlRole;
    import com.pulumi.azure.cosmosdb.PostgresqlRoleArgs;
    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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var examplePostgresqlCluster = new PostgresqlCluster("examplePostgresqlCluster", PostgresqlClusterArgs.builder()
                .name("examplecluster")
                .resourceGroupName(example.name())
                .location(example.location())
                .administratorLoginPassword("H@Sh1CoR3!")
                .coordinatorStorageQuotaInMb(131072)
                .coordinatorVcoreCount(2)
                .nodeCount(0)
                .build());
    
            var examplePostgresqlRole = new PostgresqlRole("examplePostgresqlRole", PostgresqlRoleArgs.builder()
                .name("examplerole")
                .clusterId(examplePostgresqlCluster.id())
                .password("H@Sh1CoR3!")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      examplePostgresqlCluster:
        type: azure:cosmosdb:PostgresqlCluster
        name: example
        properties:
          name: examplecluster
          resourceGroupName: ${example.name}
          location: ${example.location}
          administratorLoginPassword: H@Sh1CoR3!
          coordinatorStorageQuotaInMb: 131072
          coordinatorVcoreCount: 2
          nodeCount: 0
      examplePostgresqlRole:
        type: azure:cosmosdb:PostgresqlRole
        name: example
        properties:
          name: examplerole
          clusterId: ${examplePostgresqlCluster.id}
          password: H@Sh1CoR3!
    

    Create PostgresqlRole Resource

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

    Constructor syntax

    new PostgresqlRole(name: string, args: PostgresqlRoleArgs, opts?: CustomResourceOptions);
    @overload
    def PostgresqlRole(resource_name: str,
                       args: PostgresqlRoleArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def PostgresqlRole(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       cluster_id: Optional[str] = None,
                       password: Optional[str] = None,
                       name: Optional[str] = None)
    func NewPostgresqlRole(ctx *Context, name string, args PostgresqlRoleArgs, opts ...ResourceOption) (*PostgresqlRole, error)
    public PostgresqlRole(string name, PostgresqlRoleArgs args, CustomResourceOptions? opts = null)
    public PostgresqlRole(String name, PostgresqlRoleArgs args)
    public PostgresqlRole(String name, PostgresqlRoleArgs args, CustomResourceOptions options)
    
    type: azure:cosmosdb:PostgresqlRole
    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 PostgresqlRoleArgs
    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 PostgresqlRoleArgs
    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 PostgresqlRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PostgresqlRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PostgresqlRoleArgs
    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 postgresqlRoleResource = new Azure.CosmosDB.PostgresqlRole("postgresqlRoleResource", new()
    {
        ClusterId = "string",
        Password = "string",
        Name = "string",
    });
    
    example, err := cosmosdb.NewPostgresqlRole(ctx, "postgresqlRoleResource", &cosmosdb.PostgresqlRoleArgs{
    	ClusterId: pulumi.String("string"),
    	Password:  pulumi.String("string"),
    	Name:      pulumi.String("string"),
    })
    
    var postgresqlRoleResource = new PostgresqlRole("postgresqlRoleResource", PostgresqlRoleArgs.builder()
        .clusterId("string")
        .password("string")
        .name("string")
        .build());
    
    postgresql_role_resource = azure.cosmosdb.PostgresqlRole("postgresqlRoleResource",
        cluster_id="string",
        password="string",
        name="string")
    
    const postgresqlRoleResource = new azure.cosmosdb.PostgresqlRole("postgresqlRoleResource", {
        clusterId: "string",
        password: "string",
        name: "string",
    });
    
    type: azure:cosmosdb:PostgresqlRole
    properties:
        clusterId: string
        name: string
        password: string
    

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

    ClusterId string
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    Password string
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    Name string
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    ClusterId string
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    Password string
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    Name string
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    clusterId String
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    password String
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    name String
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    clusterId string
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    password string
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    name string
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    cluster_id str
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    password str
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    name str
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    clusterId String
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    password String
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    name String
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.

    Outputs

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

    Get an existing PostgresqlRole 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?: PostgresqlRoleState, opts?: CustomResourceOptions): PostgresqlRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            name: Optional[str] = None,
            password: Optional[str] = None) -> PostgresqlRole
    func GetPostgresqlRole(ctx *Context, name string, id IDInput, state *PostgresqlRoleState, opts ...ResourceOption) (*PostgresqlRole, error)
    public static PostgresqlRole Get(string name, Input<string> id, PostgresqlRoleState? state, CustomResourceOptions? opts = null)
    public static PostgresqlRole get(String name, Output<String> id, PostgresqlRoleState 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 resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    Name string
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    Password string
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    ClusterId string
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    Name string
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    Password string
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    clusterId String
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    name String
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    password String
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    clusterId string
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    name string
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    password string
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    cluster_id str
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    name str
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    password str
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    clusterId String
    The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
    name String
    The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
    password String
    The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.

    Import

    Azure Cosmos DB for PostgreSQL Roles can be imported using the resource id, e.g.

    $ pulumi import azure:cosmosdb/postgresqlRole:PostgresqlRole example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/cluster1/roles/role1
    

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

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi