We recommend using Azure Native.
azure.cosmosdb.SqlDedicatedGateway
Explore with Pulumi AI
Manages a SQL Dedicated Gateway within a Cosmos DB Account.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resource-group",
location: "West Europe",
});
const exampleAccount = new azure.cosmosdb.Account("example", {
name: "example-ca",
location: example.location,
resourceGroupName: example.name,
offerType: "Standard",
kind: "GlobalDocumentDB",
consistencyPolicy: {
consistencyLevel: "BoundedStaleness",
},
geoLocations: [{
location: example.location,
failoverPriority: 0,
}],
});
const exampleSqlDedicatedGateway = new azure.cosmosdb.SqlDedicatedGateway("example", {
cosmosdbAccountId: exampleAccount.id,
instanceCount: 1,
instanceSize: "Cosmos.D4s",
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resource-group",
location="West Europe")
example_account = azure.cosmosdb.Account("example",
name="example-ca",
location=example.location,
resource_group_name=example.name,
offer_type="Standard",
kind="GlobalDocumentDB",
consistency_policy={
"consistency_level": "BoundedStaleness",
},
geo_locations=[{
"location": example.location,
"failover_priority": 0,
}])
example_sql_dedicated_gateway = azure.cosmosdb.SqlDedicatedGateway("example",
cosmosdb_account_id=example_account.id,
instance_count=1,
instance_size="Cosmos.D4s")
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-resource-group"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
Name: pulumi.String("example-ca"),
Location: example.Location,
ResourceGroupName: example.Name,
OfferType: pulumi.String("Standard"),
Kind: pulumi.String("GlobalDocumentDB"),
ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
ConsistencyLevel: pulumi.String("BoundedStaleness"),
},
GeoLocations: cosmosdb.AccountGeoLocationArray{
&cosmosdb.AccountGeoLocationArgs{
Location: example.Location,
FailoverPriority: pulumi.Int(0),
},
},
})
if err != nil {
return err
}
_, err = cosmosdb.NewSqlDedicatedGateway(ctx, "example", &cosmosdb.SqlDedicatedGatewayArgs{
CosmosdbAccountId: exampleAccount.ID(),
InstanceCount: pulumi.Int(1),
InstanceSize: pulumi.String("Cosmos.D4s"),
})
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-resource-group",
Location = "West Europe",
});
var exampleAccount = new Azure.CosmosDB.Account("example", new()
{
Name = "example-ca",
Location = example.Location,
ResourceGroupName = example.Name,
OfferType = "Standard",
Kind = "GlobalDocumentDB",
ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs
{
ConsistencyLevel = "BoundedStaleness",
},
GeoLocations = new[]
{
new Azure.CosmosDB.Inputs.AccountGeoLocationArgs
{
Location = example.Location,
FailoverPriority = 0,
},
},
});
var exampleSqlDedicatedGateway = new Azure.CosmosDB.SqlDedicatedGateway("example", new()
{
CosmosdbAccountId = exampleAccount.Id,
InstanceCount = 1,
InstanceSize = "Cosmos.D4s",
});
});
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.Account;
import com.pulumi.azure.cosmosdb.AccountArgs;
import com.pulumi.azure.cosmosdb.inputs.AccountConsistencyPolicyArgs;
import com.pulumi.azure.cosmosdb.inputs.AccountGeoLocationArgs;
import com.pulumi.azure.cosmosdb.SqlDedicatedGateway;
import com.pulumi.azure.cosmosdb.SqlDedicatedGatewayArgs;
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-resource-group")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("example-ca")
.location(example.location())
.resourceGroupName(example.name())
.offerType("Standard")
.kind("GlobalDocumentDB")
.consistencyPolicy(AccountConsistencyPolicyArgs.builder()
.consistencyLevel("BoundedStaleness")
.build())
.geoLocations(AccountGeoLocationArgs.builder()
.location(example.location())
.failoverPriority(0)
.build())
.build());
var exampleSqlDedicatedGateway = new SqlDedicatedGateway("exampleSqlDedicatedGateway", SqlDedicatedGatewayArgs.builder()
.cosmosdbAccountId(exampleAccount.id())
.instanceCount(1)
.instanceSize("Cosmos.D4s")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resource-group
location: West Europe
exampleAccount:
type: azure:cosmosdb:Account
name: example
properties:
name: example-ca
location: ${example.location}
resourceGroupName: ${example.name}
offerType: Standard
kind: GlobalDocumentDB
consistencyPolicy:
consistencyLevel: BoundedStaleness
geoLocations:
- location: ${example.location}
failoverPriority: 0
exampleSqlDedicatedGateway:
type: azure:cosmosdb:SqlDedicatedGateway
name: example
properties:
cosmosdbAccountId: ${exampleAccount.id}
instanceCount: 1
instanceSize: Cosmos.D4s
Create SqlDedicatedGateway Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SqlDedicatedGateway(name: string, args: SqlDedicatedGatewayArgs, opts?: CustomResourceOptions);
@overload
def SqlDedicatedGateway(resource_name: str,
args: SqlDedicatedGatewayArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SqlDedicatedGateway(resource_name: str,
opts: Optional[ResourceOptions] = None,
cosmosdb_account_id: Optional[str] = None,
instance_count: Optional[int] = None,
instance_size: Optional[str] = None)
func NewSqlDedicatedGateway(ctx *Context, name string, args SqlDedicatedGatewayArgs, opts ...ResourceOption) (*SqlDedicatedGateway, error)
public SqlDedicatedGateway(string name, SqlDedicatedGatewayArgs args, CustomResourceOptions? opts = null)
public SqlDedicatedGateway(String name, SqlDedicatedGatewayArgs args)
public SqlDedicatedGateway(String name, SqlDedicatedGatewayArgs args, CustomResourceOptions options)
type: azure:cosmosdb:SqlDedicatedGateway
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 SqlDedicatedGatewayArgs
- 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 SqlDedicatedGatewayArgs
- 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 SqlDedicatedGatewayArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SqlDedicatedGatewayArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SqlDedicatedGatewayArgs
- 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 sqlDedicatedGatewayResource = new Azure.CosmosDB.SqlDedicatedGateway("sqlDedicatedGatewayResource", new()
{
CosmosdbAccountId = "string",
InstanceCount = 0,
InstanceSize = "string",
});
example, err := cosmosdb.NewSqlDedicatedGateway(ctx, "sqlDedicatedGatewayResource", &cosmosdb.SqlDedicatedGatewayArgs{
CosmosdbAccountId: pulumi.String("string"),
InstanceCount: pulumi.Int(0),
InstanceSize: pulumi.String("string"),
})
var sqlDedicatedGatewayResource = new SqlDedicatedGateway("sqlDedicatedGatewayResource", SqlDedicatedGatewayArgs.builder()
.cosmosdbAccountId("string")
.instanceCount(0)
.instanceSize("string")
.build());
sql_dedicated_gateway_resource = azure.cosmosdb.SqlDedicatedGateway("sqlDedicatedGatewayResource",
cosmosdb_account_id="string",
instance_count=0,
instance_size="string")
const sqlDedicatedGatewayResource = new azure.cosmosdb.SqlDedicatedGateway("sqlDedicatedGatewayResource", {
cosmosdbAccountId: "string",
instanceCount: 0,
instanceSize: "string",
});
type: azure:cosmosdb:SqlDedicatedGateway
properties:
cosmosdbAccountId: string
instanceCount: 0
instanceSize: string
SqlDedicatedGateway 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 SqlDedicatedGateway resource accepts the following input properties:
- Cosmosdb
Account stringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- Instance
Count int - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - Instance
Size string - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- Cosmosdb
Account stringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- Instance
Count int - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - Instance
Size string - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- cosmosdb
Account StringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- instance
Count Integer - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - instance
Size String - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- cosmosdb
Account stringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- instance
Count number - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - instance
Size string - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- cosmosdb_
account_ strid - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- instance_
count int - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - instance_
size str - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- cosmosdb
Account StringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- instance
Count Number - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - instance
Size String - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
Outputs
All input properties are implicitly available as output properties. Additionally, the SqlDedicatedGateway 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 SqlDedicatedGateway Resource
Get an existing SqlDedicatedGateway 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?: SqlDedicatedGatewayState, opts?: CustomResourceOptions): SqlDedicatedGateway
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cosmosdb_account_id: Optional[str] = None,
instance_count: Optional[int] = None,
instance_size: Optional[str] = None) -> SqlDedicatedGateway
func GetSqlDedicatedGateway(ctx *Context, name string, id IDInput, state *SqlDedicatedGatewayState, opts ...ResourceOption) (*SqlDedicatedGateway, error)
public static SqlDedicatedGateway Get(string name, Input<string> id, SqlDedicatedGatewayState? state, CustomResourceOptions? opts = null)
public static SqlDedicatedGateway get(String name, Output<String> id, SqlDedicatedGatewayState 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.
- Cosmosdb
Account stringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- Instance
Count int - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - Instance
Size string - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- Cosmosdb
Account stringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- Instance
Count int - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - Instance
Size string - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- cosmosdb
Account StringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- instance
Count Integer - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - instance
Size String - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- cosmosdb
Account stringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- instance
Count number - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - instance
Size string - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- cosmosdb_
account_ strid - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- instance_
count int - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - instance_
size str - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
- cosmosdb
Account StringId - The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
- instance
Count Number - The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between
1
and5
. - instance
Size String - The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are
Cosmos.D4s
,Cosmos.D8s
andCosmos.D16s
.
Import
CosmosDB SQL Dedicated Gateways can be imported using the resource id
, e.g.
$ pulumi import azure:cosmosdb/sqlDedicatedGateway:SqlDedicatedGateway example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DocumentDB/databaseAccounts/account1/services/SqlDedicatedGateway
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.