alicloud.dms.EnterpriseAuthorityTemplate
Explore with Pulumi AI
Provides a DMS Enterprise Authority Template resource.
For information about DMS Enterprise Authority Template and how to use it, see What is Authority Template.
NOTE: Available since v1.212.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const default = alicloud.dms.getUserTenants({
status: "ACTIVE",
});
const defaultEnterpriseAuthorityTemplate = new alicloud.dms.EnterpriseAuthorityTemplate("default", {
tid: _default.then(_default => _default.ids?.[0]),
authorityTemplateName: name,
description: name,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.dms.get_user_tenants(status="ACTIVE")
default_enterprise_authority_template = alicloud.dms.EnterpriseAuthorityTemplate("default",
tid=default.ids[0],
authority_template_name=name,
description=name)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dms"
"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, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := dms.GetUserTenants(ctx, &dms.GetUserTenantsArgs{
Status: pulumi.StringRef("ACTIVE"),
}, nil)
if err != nil {
return err
}
_, err = dms.NewEnterpriseAuthorityTemplate(ctx, "default", &dms.EnterpriseAuthorityTemplateArgs{
Tid: pulumi.String(_default.Ids[0]),
AuthorityTemplateName: pulumi.String(name),
Description: pulumi.String(name),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = AliCloud.Dms.GetUserTenants.Invoke(new()
{
Status = "ACTIVE",
});
var defaultEnterpriseAuthorityTemplate = new AliCloud.Dms.EnterpriseAuthorityTemplate("default", new()
{
Tid = @default.Apply(@default => @default.Apply(getUserTenantsResult => getUserTenantsResult.Ids[0])),
AuthorityTemplateName = name,
Description = name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dms.DmsFunctions;
import com.pulumi.alicloud.dms.inputs.GetUserTenantsArgs;
import com.pulumi.alicloud.dms.EnterpriseAuthorityTemplate;
import com.pulumi.alicloud.dms.EnterpriseAuthorityTemplateArgs;
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 name = config.get("name").orElse("terraform-example");
final var default = DmsFunctions.getUserTenants(GetUserTenantsArgs.builder()
.status("ACTIVE")
.build());
var defaultEnterpriseAuthorityTemplate = new EnterpriseAuthorityTemplate("defaultEnterpriseAuthorityTemplate", EnterpriseAuthorityTemplateArgs.builder()
.tid(default_.ids()[0])
.authorityTemplateName(name)
.description(name)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultEnterpriseAuthorityTemplate:
type: alicloud:dms:EnterpriseAuthorityTemplate
name: default
properties:
tid: ${default.ids[0]}
authorityTemplateName: ${name}
description: ${name}
variables:
default:
fn::invoke:
Function: alicloud:dms:getUserTenants
Arguments:
status: ACTIVE
Create EnterpriseAuthorityTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EnterpriseAuthorityTemplate(name: string, args: EnterpriseAuthorityTemplateArgs, opts?: CustomResourceOptions);
@overload
def EnterpriseAuthorityTemplate(resource_name: str,
args: EnterpriseAuthorityTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EnterpriseAuthorityTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
authority_template_name: Optional[str] = None,
tid: Optional[int] = None,
description: Optional[str] = None)
func NewEnterpriseAuthorityTemplate(ctx *Context, name string, args EnterpriseAuthorityTemplateArgs, opts ...ResourceOption) (*EnterpriseAuthorityTemplate, error)
public EnterpriseAuthorityTemplate(string name, EnterpriseAuthorityTemplateArgs args, CustomResourceOptions? opts = null)
public EnterpriseAuthorityTemplate(String name, EnterpriseAuthorityTemplateArgs args)
public EnterpriseAuthorityTemplate(String name, EnterpriseAuthorityTemplateArgs args, CustomResourceOptions options)
type: alicloud:dms:EnterpriseAuthorityTemplate
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 EnterpriseAuthorityTemplateArgs
- 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 EnterpriseAuthorityTemplateArgs
- 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 EnterpriseAuthorityTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnterpriseAuthorityTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EnterpriseAuthorityTemplateArgs
- 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 enterpriseAuthorityTemplateResource = new AliCloud.Dms.EnterpriseAuthorityTemplate("enterpriseAuthorityTemplateResource", new()
{
AuthorityTemplateName = "string",
Tid = 0,
Description = "string",
});
example, err := dms.NewEnterpriseAuthorityTemplate(ctx, "enterpriseAuthorityTemplateResource", &dms.EnterpriseAuthorityTemplateArgs{
AuthorityTemplateName: pulumi.String("string"),
Tid: pulumi.Int(0),
Description: pulumi.String("string"),
})
var enterpriseAuthorityTemplateResource = new EnterpriseAuthorityTemplate("enterpriseAuthorityTemplateResource", EnterpriseAuthorityTemplateArgs.builder()
.authorityTemplateName("string")
.tid(0)
.description("string")
.build());
enterprise_authority_template_resource = alicloud.dms.EnterpriseAuthorityTemplate("enterpriseAuthorityTemplateResource",
authority_template_name="string",
tid=0,
description="string")
const enterpriseAuthorityTemplateResource = new alicloud.dms.EnterpriseAuthorityTemplate("enterpriseAuthorityTemplateResource", {
authorityTemplateName: "string",
tid: 0,
description: "string",
});
type: alicloud:dms:EnterpriseAuthorityTemplate
properties:
authorityTemplateName: string
description: string
tid: 0
EnterpriseAuthorityTemplate 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 EnterpriseAuthorityTemplate resource accepts the following input properties:
- string
- Permission Template name.
- Tid int
- Tenant ID.
- Description string
- Permission template description information.
- string
- Permission Template name.
- Tid int
- Tenant ID.
- Description string
- Permission template description information.
- String
- Permission Template name.
- tid Integer
- Tenant ID.
- description String
- Permission template description information.
- string
- Permission Template name.
- tid number
- Tenant ID.
- description string
- Permission template description information.
- str
- Permission Template name.
- tid int
- Tenant ID.
- description str
- Permission template description information.
- String
- Permission Template name.
- tid Number
- Tenant ID.
- description String
- Permission template description information.
Outputs
All input properties are implicitly available as output properties. Additionally, the EnterpriseAuthorityTemplate resource produces the following output properties:
- int
- Permission template ID.
- Create
Time string - The creation time of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- int
- Permission template ID.
- Create
Time string - The creation time of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Integer
- Permission template ID.
- create
Time String - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- number
- Permission template ID.
- create
Time string - The creation time of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- int
- Permission template ID.
- create_
time str - The creation time of the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- Number
- Permission template ID.
- create
Time String - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing EnterpriseAuthorityTemplate Resource
Get an existing EnterpriseAuthorityTemplate 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?: EnterpriseAuthorityTemplateState, opts?: CustomResourceOptions): EnterpriseAuthorityTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
authority_template_id: Optional[int] = None,
authority_template_name: Optional[str] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
tid: Optional[int] = None) -> EnterpriseAuthorityTemplate
func GetEnterpriseAuthorityTemplate(ctx *Context, name string, id IDInput, state *EnterpriseAuthorityTemplateState, opts ...ResourceOption) (*EnterpriseAuthorityTemplate, error)
public static EnterpriseAuthorityTemplate Get(string name, Input<string> id, EnterpriseAuthorityTemplateState? state, CustomResourceOptions? opts = null)
public static EnterpriseAuthorityTemplate get(String name, Output<String> id, EnterpriseAuthorityTemplateState 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.
- int
- Permission template ID.
- string
- Permission Template name.
- Create
Time string - The creation time of the resource.
- Description string
- Permission template description information.
- Tid int
- Tenant ID.
- int
- Permission template ID.
- string
- Permission Template name.
- Create
Time string - The creation time of the resource.
- Description string
- Permission template description information.
- Tid int
- Tenant ID.
- Integer
- Permission template ID.
- String
- Permission Template name.
- create
Time String - The creation time of the resource.
- description String
- Permission template description information.
- tid Integer
- Tenant ID.
- number
- Permission template ID.
- string
- Permission Template name.
- create
Time string - The creation time of the resource.
- description string
- Permission template description information.
- tid number
- Tenant ID.
- int
- Permission template ID.
- str
- Permission Template name.
- create_
time str - The creation time of the resource.
- description str
- Permission template description information.
- tid int
- Tenant ID.
- Number
- Permission template ID.
- String
- Permission Template name.
- create
Time String - The creation time of the resource.
- description String
- Permission template description information.
- tid Number
- Tenant ID.
Import
DMS Enterprise Authority Template can be imported using the id, e.g.
$ pulumi import alicloud:dms/enterpriseAuthorityTemplate:EnterpriseAuthorityTemplate example <tid>:<authority_template_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.