1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. dms
  5. EnterpriseProxyAccess
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.dms.EnterpriseProxyAccess

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a DMS Enterprise Proxy Access resource.

    For information about DMS Enterprise Proxy Access and how to use it, see What is Proxy Access.

    NOTE: Available since v1.195.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const dmsEnterpriseUsersDs = alicloud.dms.getEnterpriseUsers({
        role: "USER",
        status: "NORMAL",
    });
    const ids = alicloud.dms.getEnterpriseProxies({});
    const _default = new alicloud.dms.EnterpriseProxyAccess("default", {
        proxyId: ids.then(ids => ids.proxies?.[0]?.id),
        userId: dmsEnterpriseUsersDs.then(dmsEnterpriseUsersDs => dmsEnterpriseUsersDs.users?.[0]?.userId),
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    dms_enterprise_users_ds = alicloud.dms.get_enterprise_users(role="USER",
        status="NORMAL")
    ids = alicloud.dms.get_enterprise_proxies()
    default = alicloud.dms.EnterpriseProxyAccess("default",
        proxy_id=ids.proxies[0].id,
        user_id=dms_enterprise_users_ds.users[0].user_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		dmsEnterpriseUsersDs, err := dms.GetEnterpriseUsers(ctx, &dms.GetEnterpriseUsersArgs{
    			Role:   pulumi.StringRef("USER"),
    			Status: pulumi.StringRef("NORMAL"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ids, err := dms.GetEnterpriseProxies(ctx, &dms.GetEnterpriseProxiesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = dms.NewEnterpriseProxyAccess(ctx, "default", &dms.EnterpriseProxyAccessArgs{
    			ProxyId: pulumi.String(ids.Proxies[0].Id),
    			UserId:  pulumi.String(dmsEnterpriseUsersDs.Users[0].UserId),
    		})
    		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 dmsEnterpriseUsersDs = AliCloud.Dms.GetEnterpriseUsers.Invoke(new()
        {
            Role = "USER",
            Status = "NORMAL",
        });
    
        var ids = AliCloud.Dms.GetEnterpriseProxies.Invoke();
    
        var @default = new AliCloud.Dms.EnterpriseProxyAccess("default", new()
        {
            ProxyId = ids.Apply(getEnterpriseProxiesResult => getEnterpriseProxiesResult.Proxies[0]?.Id),
            UserId = dmsEnterpriseUsersDs.Apply(getEnterpriseUsersResult => getEnterpriseUsersResult.Users[0]?.UserId),
        });
    
    });
    
    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.GetEnterpriseUsersArgs;
    import com.pulumi.alicloud.dms.inputs.GetEnterpriseProxiesArgs;
    import com.pulumi.alicloud.dms.EnterpriseProxyAccess;
    import com.pulumi.alicloud.dms.EnterpriseProxyAccessArgs;
    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 dmsEnterpriseUsersDs = DmsFunctions.getEnterpriseUsers(GetEnterpriseUsersArgs.builder()
                .role("USER")
                .status("NORMAL")
                .build());
    
            final var ids = DmsFunctions.getEnterpriseProxies();
    
            var default_ = new EnterpriseProxyAccess("default", EnterpriseProxyAccessArgs.builder()
                .proxyId(ids.applyValue(getEnterpriseProxiesResult -> getEnterpriseProxiesResult.proxies()[0].id()))
                .userId(dmsEnterpriseUsersDs.applyValue(getEnterpriseUsersResult -> getEnterpriseUsersResult.users()[0].userId()))
                .build());
    
        }
    }
    
    resources:
      default:
        type: alicloud:dms:EnterpriseProxyAccess
        properties:
          proxyId: ${ids.proxies[0].id}
          userId: ${dmsEnterpriseUsersDs.users[0].userId}
    variables:
      dmsEnterpriseUsersDs:
        fn::invoke:
          Function: alicloud:dms:getEnterpriseUsers
          Arguments:
            role: USER
            status: NORMAL
      ids:
        fn::invoke:
          Function: alicloud:dms:getEnterpriseProxies
          Arguments: {}
    

    Create EnterpriseProxyAccess Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new EnterpriseProxyAccess(name: string, args: EnterpriseProxyAccessArgs, opts?: CustomResourceOptions);
    @overload
    def EnterpriseProxyAccess(resource_name: str,
                              args: EnterpriseProxyAccessArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def EnterpriseProxyAccess(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              proxy_id: Optional[str] = None,
                              user_id: Optional[str] = None,
                              indep_account: Optional[str] = None,
                              indep_password: Optional[str] = None,
                              proxy_access_id: Optional[str] = None)
    func NewEnterpriseProxyAccess(ctx *Context, name string, args EnterpriseProxyAccessArgs, opts ...ResourceOption) (*EnterpriseProxyAccess, error)
    public EnterpriseProxyAccess(string name, EnterpriseProxyAccessArgs args, CustomResourceOptions? opts = null)
    public EnterpriseProxyAccess(String name, EnterpriseProxyAccessArgs args)
    public EnterpriseProxyAccess(String name, EnterpriseProxyAccessArgs args, CustomResourceOptions options)
    
    type: alicloud:dms:EnterpriseProxyAccess
    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 EnterpriseProxyAccessArgs
    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 EnterpriseProxyAccessArgs
    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 EnterpriseProxyAccessArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EnterpriseProxyAccessArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EnterpriseProxyAccessArgs
    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 enterpriseProxyAccessResource = new AliCloud.Dms.EnterpriseProxyAccess("enterpriseProxyAccessResource", new()
    {
        ProxyId = "string",
        UserId = "string",
        IndepAccount = "string",
        IndepPassword = "string",
        ProxyAccessId = "string",
    });
    
    example, err := dms.NewEnterpriseProxyAccess(ctx, "enterpriseProxyAccessResource", &dms.EnterpriseProxyAccessArgs{
    	ProxyId:       pulumi.String("string"),
    	UserId:        pulumi.String("string"),
    	IndepAccount:  pulumi.String("string"),
    	IndepPassword: pulumi.String("string"),
    	ProxyAccessId: pulumi.String("string"),
    })
    
    var enterpriseProxyAccessResource = new EnterpriseProxyAccess("enterpriseProxyAccessResource", EnterpriseProxyAccessArgs.builder()
        .proxyId("string")
        .userId("string")
        .indepAccount("string")
        .indepPassword("string")
        .proxyAccessId("string")
        .build());
    
    enterprise_proxy_access_resource = alicloud.dms.EnterpriseProxyAccess("enterpriseProxyAccessResource",
        proxy_id="string",
        user_id="string",
        indep_account="string",
        indep_password="string",
        proxy_access_id="string")
    
    const enterpriseProxyAccessResource = new alicloud.dms.EnterpriseProxyAccess("enterpriseProxyAccessResource", {
        proxyId: "string",
        userId: "string",
        indepAccount: "string",
        indepPassword: "string",
        proxyAccessId: "string",
    });
    
    type: alicloud:dms:EnterpriseProxyAccess
    properties:
        indepAccount: string
        indepPassword: string
        proxyAccessId: string
        proxyId: string
        userId: string
    

    EnterpriseProxyAccess 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 EnterpriseProxyAccess resource accepts the following input properties:

    ProxyId string
    The ID of the security agent.
    UserId string
    The user ID.
    IndepAccount string
    Database account.
    IndepPassword string
    Database password.
    ProxyAccessId string
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    ProxyId string
    The ID of the security agent.
    UserId string
    The user ID.
    IndepAccount string
    Database account.
    IndepPassword string
    Database password.
    ProxyAccessId string
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    proxyId String
    The ID of the security agent.
    userId String
    The user ID.
    indepAccount String
    Database account.
    indepPassword String
    Database password.
    proxyAccessId String
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    proxyId string
    The ID of the security agent.
    userId string
    The user ID.
    indepAccount string
    Database account.
    indepPassword string
    Database password.
    proxyAccessId string
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    proxy_id str
    The ID of the security agent.
    user_id str
    The user ID.
    indep_account str
    Database account.
    indep_password str
    Database password.
    proxy_access_id str
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    proxyId String
    The ID of the security agent.
    userId String
    The user ID.
    indepAccount String
    Database account.
    indepPassword String
    Database password.
    proxyAccessId String
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the EnterpriseProxyAccess resource produces the following output properties:

    AccessId string
    The authorized account of the security agent.
    AccessSecret string
    Secure access agent authorization password.
    CreateTime string
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceId string
    The ID of the instance.
    OriginInfo string
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    UserName string
    User nickname.
    UserUid string
    User UID.
    AccessId string
    The authorized account of the security agent.
    AccessSecret string
    Secure access agent authorization password.
    CreateTime string
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceId string
    The ID of the instance.
    OriginInfo string
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    UserName string
    User nickname.
    UserUid string
    User UID.
    accessId String
    The authorized account of the security agent.
    accessSecret String
    Secure access agent authorization password.
    createTime String
    id String
    The provider-assigned unique ID for this managed resource.
    instanceId String
    The ID of the instance.
    originInfo String
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    userName String
    User nickname.
    userUid String
    User UID.
    accessId string
    The authorized account of the security agent.
    accessSecret string
    Secure access agent authorization password.
    createTime string
    id string
    The provider-assigned unique ID for this managed resource.
    instanceId string
    The ID of the instance.
    originInfo string
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    userName string
    User nickname.
    userUid string
    User UID.
    access_id str
    The authorized account of the security agent.
    access_secret str
    Secure access agent authorization password.
    create_time str
    id str
    The provider-assigned unique ID for this managed resource.
    instance_id str
    The ID of the instance.
    origin_info str
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    user_name str
    User nickname.
    user_uid str
    User UID.
    accessId String
    The authorized account of the security agent.
    accessSecret String
    Secure access agent authorization password.
    createTime String
    id String
    The provider-assigned unique ID for this managed resource.
    instanceId String
    The ID of the instance.
    originInfo String
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    userName String
    User nickname.
    userUid String
    User UID.

    Look up Existing EnterpriseProxyAccess Resource

    Get an existing EnterpriseProxyAccess 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?: EnterpriseProxyAccessState, opts?: CustomResourceOptions): EnterpriseProxyAccess
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_id: Optional[str] = None,
            access_secret: Optional[str] = None,
            create_time: Optional[str] = None,
            indep_account: Optional[str] = None,
            indep_password: Optional[str] = None,
            instance_id: Optional[str] = None,
            origin_info: Optional[str] = None,
            proxy_access_id: Optional[str] = None,
            proxy_id: Optional[str] = None,
            user_id: Optional[str] = None,
            user_name: Optional[str] = None,
            user_uid: Optional[str] = None) -> EnterpriseProxyAccess
    func GetEnterpriseProxyAccess(ctx *Context, name string, id IDInput, state *EnterpriseProxyAccessState, opts ...ResourceOption) (*EnterpriseProxyAccess, error)
    public static EnterpriseProxyAccess Get(string name, Input<string> id, EnterpriseProxyAccessState? state, CustomResourceOptions? opts = null)
    public static EnterpriseProxyAccess get(String name, Output<String> id, EnterpriseProxyAccessState 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:
    AccessId string
    The authorized account of the security agent.
    AccessSecret string
    Secure access agent authorization password.
    CreateTime string
    IndepAccount string
    Database account.
    IndepPassword string
    Database password.
    InstanceId string
    The ID of the instance.
    OriginInfo string
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    ProxyAccessId string
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    ProxyId string
    The ID of the security agent.
    UserId string
    The user ID.
    UserName string
    User nickname.
    UserUid string
    User UID.
    AccessId string
    The authorized account of the security agent.
    AccessSecret string
    Secure access agent authorization password.
    CreateTime string
    IndepAccount string
    Database account.
    IndepPassword string
    Database password.
    InstanceId string
    The ID of the instance.
    OriginInfo string
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    ProxyAccessId string
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    ProxyId string
    The ID of the security agent.
    UserId string
    The user ID.
    UserName string
    User nickname.
    UserUid string
    User UID.
    accessId String
    The authorized account of the security agent.
    accessSecret String
    Secure access agent authorization password.
    createTime String
    indepAccount String
    Database account.
    indepPassword String
    Database password.
    instanceId String
    The ID of the instance.
    originInfo String
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    proxyAccessId String
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    proxyId String
    The ID of the security agent.
    userId String
    The user ID.
    userName String
    User nickname.
    userUid String
    User UID.
    accessId string
    The authorized account of the security agent.
    accessSecret string
    Secure access agent authorization password.
    createTime string
    indepAccount string
    Database account.
    indepPassword string
    Database password.
    instanceId string
    The ID of the instance.
    originInfo string
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    proxyAccessId string
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    proxyId string
    The ID of the security agent.
    userId string
    The user ID.
    userName string
    User nickname.
    userUid string
    User UID.
    access_id str
    The authorized account of the security agent.
    access_secret str
    Secure access agent authorization password.
    create_time str
    indep_account str
    Database account.
    indep_password str
    Database password.
    instance_id str
    The ID of the instance.
    origin_info str
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    proxy_access_id str
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    proxy_id str
    The ID of the security agent.
    user_id str
    The user ID.
    user_name str
    User nickname.
    user_uid str
    User UID.
    accessId String
    The authorized account of the security agent.
    accessSecret String
    Secure access agent authorization password.
    createTime String
    indepAccount String
    Database account.
    indepPassword String
    Database password.
    instanceId String
    The ID of the instance.
    originInfo String
    The source information of the security access agent permission is enabled, and the return value is as follows:

    • Owner Authorization: The UID of the owner in parentheses.
    • Work Order Authorization: The ticket number in parentheses is the number of the user to apply for permission.
    proxyAccessId String
    Security Protection authorization ID. After the target user is authorized by the security protection agent, the system automatically generates a security protection authorization ID, which is globally unique.
    proxyId String
    The ID of the security agent.
    userId String
    The user ID.
    userName String
    User nickname.
    userUid String
    User UID.

    Import

    DMS Enterprise Proxy Access can be imported using the id, e.g.

    $ pulumi import alicloud:dms/enterpriseProxyAccess:EnterpriseProxyAccess example <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.66.0 published on Friday, Nov 15, 2024 by Pulumi