1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dms
  5. EnterpriseAuthorityTemplate
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.dms.EnterpriseAuthorityTemplate

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

    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 defaultUserTenants = alicloud.dms.getUserTenants({
        status: "ACTIVE",
    });
    const defaultEnterpriseAuthorityTemplate = new alicloud.dms.EnterpriseAuthorityTemplate("defaultEnterpriseAuthorityTemplate", {
        tid: defaultUserTenants.then(defaultUserTenants => defaultUserTenants.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_user_tenants = alicloud.dms.get_user_tenants(status="ACTIVE")
    default_enterprise_authority_template = alicloud.dms.EnterpriseAuthorityTemplate("defaultEnterpriseAuthorityTemplate",
        tid=default_user_tenants.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
    		}
    		defaultUserTenants, err := dms.GetUserTenants(ctx, &dms.GetUserTenantsArgs{
    			Status: pulumi.StringRef("ACTIVE"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = dms.NewEnterpriseAuthorityTemplate(ctx, "defaultEnterpriseAuthorityTemplate", &dms.EnterpriseAuthorityTemplateArgs{
    			Tid:                   pulumi.String(defaultUserTenants.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 defaultUserTenants = AliCloud.Dms.GetUserTenants.Invoke(new()
        {
            Status = "ACTIVE",
        });
    
        var defaultEnterpriseAuthorityTemplate = new AliCloud.Dms.EnterpriseAuthorityTemplate("defaultEnterpriseAuthorityTemplate", new()
        {
            Tid = defaultUserTenants.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 defaultUserTenants = DmsFunctions.getUserTenants(GetUserTenantsArgs.builder()
                .status("ACTIVE")
                .build());
    
            var defaultEnterpriseAuthorityTemplate = new EnterpriseAuthorityTemplate("defaultEnterpriseAuthorityTemplate", EnterpriseAuthorityTemplateArgs.builder()        
                .tid(defaultUserTenants.applyValue(getUserTenantsResult -> getUserTenantsResult.ids()[0]))
                .authorityTemplateName(name)
                .description(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultEnterpriseAuthorityTemplate:
        type: alicloud:dms:EnterpriseAuthorityTemplate
        properties:
          tid: ${defaultUserTenants.ids[0]}
          authorityTemplateName: ${name}
          description: ${name}
    variables:
      defaultUserTenants:
        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.

    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:

    AuthorityTemplateName string
    Permission Template name.
    Tid int
    Tenant ID.
    Description string
    Permission template description information.
    AuthorityTemplateName string
    Permission Template name.
    Tid int
    Tenant ID.
    Description string
    Permission template description information.
    authorityTemplateName String
    Permission Template name.
    tid Integer
    Tenant ID.
    description String
    Permission template description information.
    authorityTemplateName string
    Permission Template name.
    tid number
    Tenant ID.
    description string
    Permission template description information.
    authority_template_name str
    Permission Template name.
    tid int
    Tenant ID.
    description str
    Permission template description information.
    authorityTemplateName 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:

    AuthorityTemplateId int
    Permission template ID.
    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    AuthorityTemplateId int
    Permission template ID.
    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    authorityTemplateId Integer
    Permission template ID.
    createTime String
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    authorityTemplateId number
    Permission template ID.
    createTime string
    The creation time of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    authority_template_id int
    Permission template ID.
    create_time str
    The creation time of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    authorityTemplateId Number
    Permission template ID.
    createTime 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.
    The following state arguments are supported:
    AuthorityTemplateId int
    Permission template ID.
    AuthorityTemplateName string
    Permission Template name.
    CreateTime string
    The creation time of the resource.
    Description string
    Permission template description information.
    Tid int
    Tenant ID.
    AuthorityTemplateId int
    Permission template ID.
    AuthorityTemplateName string
    Permission Template name.
    CreateTime string
    The creation time of the resource.
    Description string
    Permission template description information.
    Tid int
    Tenant ID.
    authorityTemplateId Integer
    Permission template ID.
    authorityTemplateName String
    Permission Template name.
    createTime String
    The creation time of the resource.
    description String
    Permission template description information.
    tid Integer
    Tenant ID.
    authorityTemplateId number
    Permission template ID.
    authorityTemplateName string
    Permission Template name.
    createTime string
    The creation time of the resource.
    description string
    Permission template description information.
    tid number
    Tenant ID.
    authority_template_id int
    Permission template ID.
    authority_template_name str
    Permission Template name.
    create_time str
    The creation time of the resource.
    description str
    Permission template description information.
    tid int
    Tenant ID.
    authorityTemplateId Number
    Permission template ID.
    authorityTemplateName String
    Permission Template name.
    createTime 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.
    alicloud logo
    Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi