opentelekomcloud.DmsUserPermissionV1
Explore with Pulumi AI
Up-to-date reference of API arguments for DMS user permissions you can get at documentation portal
Manages a DMS topic permissions for users for the OpenTelekomCloud DMS Service Instances (Kafka Premium/Platinum).
~> Topic permission management is supported only when SASL is enabled for the Kafka instance.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const config = new pulumi.Config();
const instanceId = config.requireObject("instanceId");
const user1 = new opentelekomcloud.DmsUserV2("user1", {
instanceId: instance_id,
username: "Test-user",
password: "Dmstest@123",
});
const user2 = new opentelekomcloud.DmsUserV2("user2", {
instanceId: instance_id,
username: "Test-user2",
password: "Dmstest@123",
});
const perm1 = new opentelekomcloud.DmsUserPermissionV1("perm1", {
instanceId: opentelekomcloud_dms_instance_v2.instance_1.id,
topicName: "test-topic",
policies: [
{
username: user1.dmsUserV2Id,
accessPolicy: "all",
},
{
username: user2.dmsUserV2Id,
accessPolicy: "sub",
},
],
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
config = pulumi.Config()
instance_id = config.require_object("instanceId")
user1 = opentelekomcloud.DmsUserV2("user1",
instance_id=instance_id,
username="Test-user",
password="Dmstest@123")
user2 = opentelekomcloud.DmsUserV2("user2",
instance_id=instance_id,
username="Test-user2",
password="Dmstest@123")
perm1 = opentelekomcloud.DmsUserPermissionV1("perm1",
instance_id=opentelekomcloud_dms_instance_v2["instance_1"]["id"],
topic_name="test-topic",
policies=[
{
"username": user1.dms_user_v2_id,
"access_policy": "all",
},
{
"username": user2.dms_user_v2_id,
"access_policy": "sub",
},
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
instanceId := cfg.RequireObject("instanceId")
user1, err := opentelekomcloud.NewDmsUserV2(ctx, "user1", &opentelekomcloud.DmsUserV2Args{
InstanceId: pulumi.Any(instance_id),
Username: pulumi.String("Test-user"),
Password: pulumi.String("Dmstest@123"),
})
if err != nil {
return err
}
user2, err := opentelekomcloud.NewDmsUserV2(ctx, "user2", &opentelekomcloud.DmsUserV2Args{
InstanceId: pulumi.Any(instance_id),
Username: pulumi.String("Test-user2"),
Password: pulumi.String("Dmstest@123"),
})
if err != nil {
return err
}
_, err = opentelekomcloud.NewDmsUserPermissionV1(ctx, "perm1", &opentelekomcloud.DmsUserPermissionV1Args{
InstanceId: pulumi.Any(opentelekomcloud_dms_instance_v2.Instance_1.Id),
TopicName: pulumi.String("test-topic"),
Policies: opentelekomcloud.DmsUserPermissionV1PolicyArray{
&opentelekomcloud.DmsUserPermissionV1PolicyArgs{
Username: user1.DmsUserV2Id,
AccessPolicy: pulumi.String("all"),
},
&opentelekomcloud.DmsUserPermissionV1PolicyArgs{
Username: user2.DmsUserV2Id,
AccessPolicy: pulumi.String("sub"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var instanceId = config.RequireObject<dynamic>("instanceId");
var user1 = new Opentelekomcloud.DmsUserV2("user1", new()
{
InstanceId = instance_id,
Username = "Test-user",
Password = "Dmstest@123",
});
var user2 = new Opentelekomcloud.DmsUserV2("user2", new()
{
InstanceId = instance_id,
Username = "Test-user2",
Password = "Dmstest@123",
});
var perm1 = new Opentelekomcloud.DmsUserPermissionV1("perm1", new()
{
InstanceId = opentelekomcloud_dms_instance_v2.Instance_1.Id,
TopicName = "test-topic",
Policies = new[]
{
new Opentelekomcloud.Inputs.DmsUserPermissionV1PolicyArgs
{
Username = user1.DmsUserV2Id,
AccessPolicy = "all",
},
new Opentelekomcloud.Inputs.DmsUserPermissionV1PolicyArgs
{
Username = user2.DmsUserV2Id,
AccessPolicy = "sub",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.DmsUserV2;
import com.pulumi.opentelekomcloud.DmsUserV2Args;
import com.pulumi.opentelekomcloud.DmsUserPermissionV1;
import com.pulumi.opentelekomcloud.DmsUserPermissionV1Args;
import com.pulumi.opentelekomcloud.inputs.DmsUserPermissionV1PolicyArgs;
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 config = ctx.config();
final var instanceId = config.get("instanceId");
var user1 = new DmsUserV2("user1", DmsUserV2Args.builder()
.instanceId(instance_id)
.username("Test-user")
.password("Dmstest@123")
.build());
var user2 = new DmsUserV2("user2", DmsUserV2Args.builder()
.instanceId(instance_id)
.username("Test-user2")
.password("Dmstest@123")
.build());
var perm1 = new DmsUserPermissionV1("perm1", DmsUserPermissionV1Args.builder()
.instanceId(opentelekomcloud_dms_instance_v2.instance_1().id())
.topicName("test-topic")
.policies(
DmsUserPermissionV1PolicyArgs.builder()
.username(user1.dmsUserV2Id())
.accessPolicy("all")
.build(),
DmsUserPermissionV1PolicyArgs.builder()
.username(user2.dmsUserV2Id())
.accessPolicy("sub")
.build())
.build());
}
}
configuration:
instanceId:
type: dynamic
resources:
user1:
type: opentelekomcloud:DmsUserV2
properties:
instanceId: ${instance_id}
username: Test-user
password: Dmstest@123
user2:
type: opentelekomcloud:DmsUserV2
properties:
instanceId: ${instance_id}
username: Test-user2
password: Dmstest@123
perm1:
type: opentelekomcloud:DmsUserPermissionV1
properties:
instanceId: ${opentelekomcloud_dms_instance_v2.instance_1.id}
topicName: test-topic
policies:
- username: ${user1.dmsUserV2Id}
accessPolicy: all
- username: ${user2.dmsUserV2Id}
accessPolicy: sub
Create DmsUserPermissionV1 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DmsUserPermissionV1(name: string, args: DmsUserPermissionV1Args, opts?: CustomResourceOptions);
@overload
def DmsUserPermissionV1(resource_name: str,
args: DmsUserPermissionV1Args,
opts: Optional[ResourceOptions] = None)
@overload
def DmsUserPermissionV1(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
policies: Optional[Sequence[DmsUserPermissionV1PolicyArgs]] = None,
topic_name: Optional[str] = None,
dms_user_permission_v1_id: Optional[str] = None)
func NewDmsUserPermissionV1(ctx *Context, name string, args DmsUserPermissionV1Args, opts ...ResourceOption) (*DmsUserPermissionV1, error)
public DmsUserPermissionV1(string name, DmsUserPermissionV1Args args, CustomResourceOptions? opts = null)
public DmsUserPermissionV1(String name, DmsUserPermissionV1Args args)
public DmsUserPermissionV1(String name, DmsUserPermissionV1Args args, CustomResourceOptions options)
type: opentelekomcloud:DmsUserPermissionV1
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 DmsUserPermissionV1Args
- 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 DmsUserPermissionV1Args
- 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 DmsUserPermissionV1Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DmsUserPermissionV1Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DmsUserPermissionV1Args
- 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 dmsUserPermissionV1Resource = new Opentelekomcloud.DmsUserPermissionV1("dmsUserPermissionV1Resource", new()
{
InstanceId = "string",
Policies = new[]
{
new Opentelekomcloud.Inputs.DmsUserPermissionV1PolicyArgs
{
AccessPolicy = "string",
Username = "string",
Owner = false,
},
},
TopicName = "string",
DmsUserPermissionV1Id = "string",
});
example, err := opentelekomcloud.NewDmsUserPermissionV1(ctx, "dmsUserPermissionV1Resource", &opentelekomcloud.DmsUserPermissionV1Args{
InstanceId: pulumi.String("string"),
Policies: opentelekomcloud.DmsUserPermissionV1PolicyArray{
&opentelekomcloud.DmsUserPermissionV1PolicyArgs{
AccessPolicy: pulumi.String("string"),
Username: pulumi.String("string"),
Owner: pulumi.Bool(false),
},
},
TopicName: pulumi.String("string"),
DmsUserPermissionV1Id: pulumi.String("string"),
})
var dmsUserPermissionV1Resource = new DmsUserPermissionV1("dmsUserPermissionV1Resource", DmsUserPermissionV1Args.builder()
.instanceId("string")
.policies(DmsUserPermissionV1PolicyArgs.builder()
.accessPolicy("string")
.username("string")
.owner(false)
.build())
.topicName("string")
.dmsUserPermissionV1Id("string")
.build());
dms_user_permission_v1_resource = opentelekomcloud.DmsUserPermissionV1("dmsUserPermissionV1Resource",
instance_id="string",
policies=[{
"access_policy": "string",
"username": "string",
"owner": False,
}],
topic_name="string",
dms_user_permission_v1_id="string")
const dmsUserPermissionV1Resource = new opentelekomcloud.DmsUserPermissionV1("dmsUserPermissionV1Resource", {
instanceId: "string",
policies: [{
accessPolicy: "string",
username: "string",
owner: false,
}],
topicName: "string",
dmsUserPermissionV1Id: "string",
});
type: opentelekomcloud:DmsUserPermissionV1
properties:
dmsUserPermissionV1Id: string
instanceId: string
policies:
- accessPolicy: string
owner: false
username: string
topicName: string
DmsUserPermissionV1 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 DmsUserPermissionV1 resource accepts the following input properties:
- Instance
Id string - Indicates the ID of primary DMS instance.
- Policies
List<Dms
User Permission V1Policy> - Indicates policy configuration for the topic. Supported fields:
- Topic
Name string - Indicates the name of a topic.
- Dms
User stringPermission V1Id
- Instance
Id string - Indicates the ID of primary DMS instance.
- Policies
[]Dms
User Permission V1Policy Args - Indicates policy configuration for the topic. Supported fields:
- Topic
Name string - Indicates the name of a topic.
- Dms
User stringPermission V1Id
- instance
Id String - Indicates the ID of primary DMS instance.
- policies
List<Dms
User Permission V1Policy> - Indicates policy configuration for the topic. Supported fields:
- topic
Name String - Indicates the name of a topic.
- dms
User StringPermission V1Id
- instance
Id string - Indicates the ID of primary DMS instance.
- policies
Dms
User Permission V1Policy[] - Indicates policy configuration for the topic. Supported fields:
- topic
Name string - Indicates the name of a topic.
- dms
User stringPermission V1Id
- instance_
id str - Indicates the ID of primary DMS instance.
- policies
Sequence[Dms
User Permission V1Policy Args] - Indicates policy configuration for the topic. Supported fields:
- topic_
name str - Indicates the name of a topic.
- dms_
user_ strpermission_ v1_ id
- instance
Id String - Indicates the ID of primary DMS instance.
- policies List<Property Map>
- Indicates policy configuration for the topic. Supported fields:
- topic
Name String - Indicates the name of a topic.
- dms
User StringPermission V1Id
Outputs
All input properties are implicitly available as output properties. Additionally, the DmsUserPermissionV1 resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- topic_
type float - Indicates topic type.
0
: common topic;1
: system (internal) topic.
Look up Existing DmsUserPermissionV1 Resource
Get an existing DmsUserPermissionV1 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?: DmsUserPermissionV1State, opts?: CustomResourceOptions): DmsUserPermissionV1
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dms_user_permission_v1_id: Optional[str] = None,
instance_id: Optional[str] = None,
policies: Optional[Sequence[DmsUserPermissionV1PolicyArgs]] = None,
topic_name: Optional[str] = None,
topic_type: Optional[float] = None) -> DmsUserPermissionV1
func GetDmsUserPermissionV1(ctx *Context, name string, id IDInput, state *DmsUserPermissionV1State, opts ...ResourceOption) (*DmsUserPermissionV1, error)
public static DmsUserPermissionV1 Get(string name, Input<string> id, DmsUserPermissionV1State? state, CustomResourceOptions? opts = null)
public static DmsUserPermissionV1 get(String name, Output<String> id, DmsUserPermissionV1State state, CustomResourceOptions options)
resources: _: type: opentelekomcloud:DmsUserPermissionV1 get: id: ${id}
- 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.
- Dms
User stringPermission V1Id - Instance
Id string - Indicates the ID of primary DMS instance.
- Policies
List<Dms
User Permission V1Policy> - Indicates policy configuration for the topic. Supported fields:
- Topic
Name string - Indicates the name of a topic.
- Topic
Type double - Indicates topic type.
0
: common topic;1
: system (internal) topic.
- Dms
User stringPermission V1Id - Instance
Id string - Indicates the ID of primary DMS instance.
- Policies
[]Dms
User Permission V1Policy Args - Indicates policy configuration for the topic. Supported fields:
- Topic
Name string - Indicates the name of a topic.
- Topic
Type float64 - Indicates topic type.
0
: common topic;1
: system (internal) topic.
- dms
User StringPermission V1Id - instance
Id String - Indicates the ID of primary DMS instance.
- policies
List<Dms
User Permission V1Policy> - Indicates policy configuration for the topic. Supported fields:
- topic
Name String - Indicates the name of a topic.
- topic
Type Double - Indicates topic type.
0
: common topic;1
: system (internal) topic.
- dms
User stringPermission V1Id - instance
Id string - Indicates the ID of primary DMS instance.
- policies
Dms
User Permission V1Policy[] - Indicates policy configuration for the topic. Supported fields:
- topic
Name string - Indicates the name of a topic.
- topic
Type number - Indicates topic type.
0
: common topic;1
: system (internal) topic.
- dms_
user_ strpermission_ v1_ id - instance_
id str - Indicates the ID of primary DMS instance.
- policies
Sequence[Dms
User Permission V1Policy Args] - Indicates policy configuration for the topic. Supported fields:
- topic_
name str - Indicates the name of a topic.
- topic_
type float - Indicates topic type.
0
: common topic;1
: system (internal) topic.
- dms
User StringPermission V1Id - instance
Id String - Indicates the ID of primary DMS instance.
- policies List<Property Map>
- Indicates policy configuration for the topic. Supported fields:
- topic
Name String - Indicates the name of a topic.
- topic
Type Number - Indicates topic type.
0
: common topic;1
: system (internal) topic.
Supporting Types
DmsUserPermissionV1Policy, DmsUserPermissionV1PolicyArgs
- Access
Policy string - Permission type. Possible values:
- Username string
- DMS instance user name.
- Owner bool
- Indicates whether the user is the one selected during topic creation.
- Access
Policy string - Permission type. Possible values:
- Username string
- DMS instance user name.
- Owner bool
- Indicates whether the user is the one selected during topic creation.
- access
Policy String - Permission type. Possible values:
- username String
- DMS instance user name.
- owner Boolean
- Indicates whether the user is the one selected during topic creation.
- access
Policy string - Permission type. Possible values:
- username string
- DMS instance user name.
- owner boolean
- Indicates whether the user is the one selected during topic creation.
- access_
policy str - Permission type. Possible values:
- username str
- DMS instance user name.
- owner bool
- Indicates whether the user is the one selected during topic creation.
- access
Policy String - Permission type. Possible values:
- username String
- DMS instance user name.
- owner Boolean
- Indicates whether the user is the one selected during topic creation.
Package Details
- Repository
- opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
- License
- Notes
- This Pulumi package is based on the
opentelekomcloud
Terraform Provider.