1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ram
  5. getAccountAlias
Alibaba Cloud v3.69.0 published on Monday, Dec 9, 2024 by Pulumi

alicloud.ram.getAccountAlias

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.69.0 published on Monday, Dec 9, 2024 by Pulumi

    This data source provides an alias for the Alibaba Cloud account.

    NOTE: Available since v1.0.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const aliasDs = alicloud.ram.getAccountAlias({
        outputFile: "alias.txt",
    });
    export const accountAlias = aliasDs.then(aliasDs => aliasDs.accountAlias);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    alias_ds = alicloud.ram.get_account_alias(output_file="alias.txt")
    pulumi.export("accountAlias", alias_ds.account_alias)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		aliasDs, err := ram.LookupAccountAlias(ctx, &ram.LookupAccountAliasArgs{
    			OutputFile: pulumi.StringRef("alias.txt"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("accountAlias", aliasDs.AccountAlias)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var aliasDs = AliCloud.Ram.GetAccountAlias.Invoke(new()
        {
            OutputFile = "alias.txt",
        });
    
        return new Dictionary<string, object?>
        {
            ["accountAlias"] = aliasDs.Apply(getAccountAliasResult => getAccountAliasResult.AccountAlias),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ram.RamFunctions;
    import com.pulumi.alicloud.ram.inputs.GetAccountAliasArgs;
    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 aliasDs = RamFunctions.getAccountAlias(GetAccountAliasArgs.builder()
                .outputFile("alias.txt")
                .build());
    
            ctx.export("accountAlias", aliasDs.applyValue(getAccountAliasResult -> getAccountAliasResult.accountAlias()));
        }
    }
    
    variables:
      aliasDs:
        fn::invoke:
          Function: alicloud:ram:getAccountAlias
          Arguments:
            outputFile: alias.txt
    outputs:
      accountAlias: ${aliasDs.accountAlias}
    

    Using getAccountAlias

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getAccountAlias(args: GetAccountAliasArgs, opts?: InvokeOptions): Promise<GetAccountAliasResult>
    function getAccountAliasOutput(args: GetAccountAliasOutputArgs, opts?: InvokeOptions): Output<GetAccountAliasResult>
    def get_account_alias(output_file: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetAccountAliasResult
    def get_account_alias_output(output_file: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetAccountAliasResult]
    func LookupAccountAlias(ctx *Context, args *LookupAccountAliasArgs, opts ...InvokeOption) (*LookupAccountAliasResult, error)
    func LookupAccountAliasOutput(ctx *Context, args *LookupAccountAliasOutputArgs, opts ...InvokeOption) LookupAccountAliasResultOutput

    > Note: This function is named LookupAccountAlias in the Go SDK.

    public static class GetAccountAlias 
    {
        public static Task<GetAccountAliasResult> InvokeAsync(GetAccountAliasArgs args, InvokeOptions? opts = null)
        public static Output<GetAccountAliasResult> Invoke(GetAccountAliasInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccountAliasResult> getAccountAlias(GetAccountAliasArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ram/getAccountAlias:getAccountAlias
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OutputFile string
    File name where to save data source results (after running pulumi preview).
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    outputFile String
    File name where to save data source results (after running pulumi preview).
    outputFile string
    File name where to save data source results (after running pulumi preview).
    output_file str
    File name where to save data source results (after running pulumi preview).
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getAccountAlias Result

    The following output properties are available:

    AccountAlias string
    Alias of the account.
    Id string
    The provider-assigned unique ID for this managed resource.
    OutputFile string
    AccountAlias string
    Alias of the account.
    Id string
    The provider-assigned unique ID for this managed resource.
    OutputFile string
    accountAlias String
    Alias of the account.
    id String
    The provider-assigned unique ID for this managed resource.
    outputFile String
    accountAlias string
    Alias of the account.
    id string
    The provider-assigned unique ID for this managed resource.
    outputFile string
    account_alias str
    Alias of the account.
    id str
    The provider-assigned unique ID for this managed resource.
    output_file str
    accountAlias String
    Alias of the account.
    id String
    The provider-assigned unique ID for this managed resource.
    outputFile String

    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.69.0 published on Monday, Dec 9, 2024 by Pulumi