We recommend using Azure Native.
azure.cosmosdb.PostgresqlFirewallRule
Explore with Pulumi AI
Manages an Azure Cosmos DB for PostgreSQL Firewall Rule.
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 examplePostgresqlFirewallRule = new azure.cosmosdb.PostgresqlFirewallRule("example", {
name: "example-firewallrule",
clusterId: examplePostgresqlCluster.id,
startIpAddress: "10.0.17.62",
endIpAddress: "10.0.17.64",
});
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_firewall_rule = azure.cosmosdb.PostgresqlFirewallRule("example",
name="example-firewallrule",
cluster_id=example_postgresql_cluster.id,
start_ip_address="10.0.17.62",
end_ip_address="10.0.17.64")
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.NewPostgresqlFirewallRule(ctx, "example", &cosmosdb.PostgresqlFirewallRuleArgs{
Name: pulumi.String("example-firewallrule"),
ClusterId: examplePostgresqlCluster.ID(),
StartIpAddress: pulumi.String("10.0.17.62"),
EndIpAddress: pulumi.String("10.0.17.64"),
})
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 examplePostgresqlFirewallRule = new Azure.CosmosDB.PostgresqlFirewallRule("example", new()
{
Name = "example-firewallrule",
ClusterId = examplePostgresqlCluster.Id,
StartIpAddress = "10.0.17.62",
EndIpAddress = "10.0.17.64",
});
});
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.PostgresqlFirewallRule;
import com.pulumi.azure.cosmosdb.PostgresqlFirewallRuleArgs;
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 examplePostgresqlFirewallRule = new PostgresqlFirewallRule("examplePostgresqlFirewallRule", PostgresqlFirewallRuleArgs.builder()
.name("example-firewallrule")
.clusterId(examplePostgresqlCluster.id())
.startIpAddress("10.0.17.62")
.endIpAddress("10.0.17.64")
.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
examplePostgresqlFirewallRule:
type: azure:cosmosdb:PostgresqlFirewallRule
name: example
properties:
name: example-firewallrule
clusterId: ${examplePostgresqlCluster.id}
startIpAddress: 10.0.17.62
endIpAddress: 10.0.17.64
Create PostgresqlFirewallRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PostgresqlFirewallRule(name: string, args: PostgresqlFirewallRuleArgs, opts?: CustomResourceOptions);
@overload
def PostgresqlFirewallRule(resource_name: str,
args: PostgresqlFirewallRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PostgresqlFirewallRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
end_ip_address: Optional[str] = None,
start_ip_address: Optional[str] = None,
name: Optional[str] = None)
func NewPostgresqlFirewallRule(ctx *Context, name string, args PostgresqlFirewallRuleArgs, opts ...ResourceOption) (*PostgresqlFirewallRule, error)
public PostgresqlFirewallRule(string name, PostgresqlFirewallRuleArgs args, CustomResourceOptions? opts = null)
public PostgresqlFirewallRule(String name, PostgresqlFirewallRuleArgs args)
public PostgresqlFirewallRule(String name, PostgresqlFirewallRuleArgs args, CustomResourceOptions options)
type: azure:cosmosdb:PostgresqlFirewallRule
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 PostgresqlFirewallRuleArgs
- 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 PostgresqlFirewallRuleArgs
- 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 PostgresqlFirewallRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PostgresqlFirewallRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PostgresqlFirewallRuleArgs
- 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 postgresqlFirewallRuleResource = new Azure.CosmosDB.PostgresqlFirewallRule("postgresqlFirewallRuleResource", new()
{
ClusterId = "string",
EndIpAddress = "string",
StartIpAddress = "string",
Name = "string",
});
example, err := cosmosdb.NewPostgresqlFirewallRule(ctx, "postgresqlFirewallRuleResource", &cosmosdb.PostgresqlFirewallRuleArgs{
ClusterId: pulumi.String("string"),
EndIpAddress: pulumi.String("string"),
StartIpAddress: pulumi.String("string"),
Name: pulumi.String("string"),
})
var postgresqlFirewallRuleResource = new PostgresqlFirewallRule("postgresqlFirewallRuleResource", PostgresqlFirewallRuleArgs.builder()
.clusterId("string")
.endIpAddress("string")
.startIpAddress("string")
.name("string")
.build());
postgresql_firewall_rule_resource = azure.cosmosdb.PostgresqlFirewallRule("postgresqlFirewallRuleResource",
cluster_id="string",
end_ip_address="string",
start_ip_address="string",
name="string")
const postgresqlFirewallRuleResource = new azure.cosmosdb.PostgresqlFirewallRule("postgresqlFirewallRuleResource", {
clusterId: "string",
endIpAddress: "string",
startIpAddress: "string",
name: "string",
});
type: azure:cosmosdb:PostgresqlFirewallRule
properties:
clusterId: string
endIpAddress: string
name: string
startIpAddress: string
PostgresqlFirewallRule 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 PostgresqlFirewallRule resource accepts the following input properties:
- Cluster
Id string - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- End
Ip stringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- Start
Ip stringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- Name string
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- Cluster
Id string - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- End
Ip stringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- Start
Ip stringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- Name string
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- cluster
Id String - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- end
Ip StringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- start
Ip StringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- name String
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- cluster
Id string - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- end
Ip stringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- start
Ip stringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- name string
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. 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.
- end_
ip_ straddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- start_
ip_ straddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- name str
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- cluster
Id String - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- end
Ip StringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- start
Ip StringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- name String
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the PostgresqlFirewallRule 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 PostgresqlFirewallRule Resource
Get an existing PostgresqlFirewallRule 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?: PostgresqlFirewallRuleState, opts?: CustomResourceOptions): PostgresqlFirewallRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
end_ip_address: Optional[str] = None,
name: Optional[str] = None,
start_ip_address: Optional[str] = None) -> PostgresqlFirewallRule
func GetPostgresqlFirewallRule(ctx *Context, name string, id IDInput, state *PostgresqlFirewallRuleState, opts ...ResourceOption) (*PostgresqlFirewallRule, error)
public static PostgresqlFirewallRule Get(string name, Input<string> id, PostgresqlFirewallRuleState? state, CustomResourceOptions? opts = null)
public static PostgresqlFirewallRule get(String name, Output<String> id, PostgresqlFirewallRuleState 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.
- Cluster
Id string - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- End
Ip stringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- Name string
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- Start
Ip stringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- Cluster
Id string - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- End
Ip stringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- Name string
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- Start
Ip stringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- cluster
Id String - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- end
Ip StringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- name String
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- start
Ip StringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- cluster
Id string - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- end
Ip stringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- name string
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- start
Ip stringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- cluster_
id str - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- end_
ip_ straddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- name str
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- start_
ip_ straddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- cluster
Id String - The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
- end
Ip StringAddress - The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
- name String
- The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
- start
Ip StringAddress - The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
Import
Azure Cosmos DB for PostgreSQL Firewall Rules can be imported using the resource id
, e.g.
$ pulumi import azure:cosmosdb/postgresqlFirewallRule:PostgresqlFirewallRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/cluster1/firewallRules/firewallRule1
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.