1. Packages
  2. RedisCloud
  3. API Docs
  4. getCloudAccount
Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs

rediscloud.getCloudAccount

Explore with Pulumi AI

rediscloud logo
Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs

    The Cloud Account data source allows access to the ID of a Cloud Account configuration. This ID can be used when creating Subscription resources.

    Example Usage

    The following example excludes the Redis Labs internal cloud account and returns only AWS related accounts.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rediscloud = Pulumi.Rediscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Rediscloud.GetCloudAccount.Invoke(new()
        {
            ExcludeInternalAccount = true,
            ProviderType = "AWS",
        });
    
    });
    
    package main
    
    import (
    	"github.com/RedisLabs/pulumi-rediscloud/sdk/go/rediscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := rediscloud.LookupCloudAccount(ctx, &rediscloud.LookupCloudAccountArgs{
    			ExcludeInternalAccount: pulumi.BoolRef(true),
    			ProviderType:           pulumi.StringRef("AWS"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rediscloud.RediscloudFunctions;
    import com.pulumi.rediscloud.inputs.GetCloudAccountArgs;
    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 example = RediscloudFunctions.getCloudAccount(GetCloudAccountArgs.builder()
                .excludeInternalAccount(true)
                .providerType("AWS")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_rediscloud as rediscloud
    
    example = rediscloud.get_cloud_account(exclude_internal_account=True,
        provider_type="AWS")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as rediscloud from "@pulumi/rediscloud";
    
    const example = rediscloud.getCloudAccount({
        excludeInternalAccount: true,
        providerType: "AWS",
    });
    
    variables:
      example:
        fn::invoke:
          Function: rediscloud:getCloudAccount
          Arguments:
            excludeInternalAccount: true
            providerType: AWS
    

    and returns the cloud account ID and access key ID.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rediscloud = Pulumi.Rediscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Rediscloud.GetCloudAccount.Invoke(new()
        {
            ExcludeInternalAccount = true,
            ProviderType = "AWS",
            Name = "test",
        });
    
        return new Dictionary<string, object?>
        {
            ["cloudAccountId"] = example.Apply(getCloudAccountResult => getCloudAccountResult.Id),
            ["cloudAccountAccessKeyId"] = example.Apply(getCloudAccountResult => getCloudAccountResult.AccessKeyId),
        };
    });
    
    package main
    
    import (
    	"github.com/RedisLabs/pulumi-rediscloud/sdk/go/rediscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := rediscloud.LookupCloudAccount(ctx, &rediscloud.LookupCloudAccountArgs{
    			ExcludeInternalAccount: pulumi.BoolRef(true),
    			ProviderType:           pulumi.StringRef("AWS"),
    			Name:                   pulumi.StringRef("test"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("cloudAccountId", example.Id)
    		ctx.Export("cloudAccountAccessKeyId", example.AccessKeyId)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rediscloud.RediscloudFunctions;
    import com.pulumi.rediscloud.inputs.GetCloudAccountArgs;
    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 example = RediscloudFunctions.getCloudAccount(GetCloudAccountArgs.builder()
                .excludeInternalAccount(true)
                .providerType("AWS")
                .name("test")
                .build());
    
            ctx.export("cloudAccountId", example.applyValue(getCloudAccountResult -> getCloudAccountResult.id()));
            ctx.export("cloudAccountAccessKeyId", example.applyValue(getCloudAccountResult -> getCloudAccountResult.accessKeyId()));
        }
    }
    
    import pulumi
    import pulumi_rediscloud as rediscloud
    
    example = rediscloud.get_cloud_account(exclude_internal_account=True,
        provider_type="AWS",
        name="test")
    pulumi.export("cloudAccountId", example.id)
    pulumi.export("cloudAccountAccessKeyId", example.access_key_id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as rediscloud from "@pulumi/rediscloud";
    
    const example = rediscloud.getCloudAccount({
        excludeInternalAccount: true,
        providerType: "AWS",
        name: "test",
    });
    export const cloudAccountId = example.then(example => example.id);
    export const cloudAccountAccessKeyId = example.then(example => example.accessKeyId);
    
    variables:
      example:
        fn::invoke:
          Function: rediscloud:getCloudAccount
          Arguments:
            excludeInternalAccount: true
            providerType: AWS
            name: test
    outputs:
      cloudAccountId: ${example.id}
      cloudAccountAccessKeyId: ${example.accessKeyId}
    

    Using getCloudAccount

    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 getCloudAccount(args: GetCloudAccountArgs, opts?: InvokeOptions): Promise<GetCloudAccountResult>
    function getCloudAccountOutput(args: GetCloudAccountOutputArgs, opts?: InvokeOptions): Output<GetCloudAccountResult>
    def get_cloud_account(exclude_internal_account: Optional[bool] = None,
                          name: Optional[str] = None,
                          provider_type: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetCloudAccountResult
    def get_cloud_account_output(exclude_internal_account: Optional[pulumi.Input[bool]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          provider_type: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetCloudAccountResult]
    func LookupCloudAccount(ctx *Context, args *LookupCloudAccountArgs, opts ...InvokeOption) (*LookupCloudAccountResult, error)
    func LookupCloudAccountOutput(ctx *Context, args *LookupCloudAccountOutputArgs, opts ...InvokeOption) LookupCloudAccountResultOutput

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

    public static class GetCloudAccount 
    {
        public static Task<GetCloudAccountResult> InvokeAsync(GetCloudAccountArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudAccountResult> Invoke(GetCloudAccountInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCloudAccountResult> getCloudAccount(GetCloudAccountArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: rediscloud:index/getCloudAccount:getCloudAccount
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ExcludeInternalAccount bool
    Whether to exclude the Redis Labs internal cloud account.
    Name string
    A meaningful name to identify the cloud account
    ProviderType string
    The cloud provider of the cloud account, (either AWS or GCP)
    ExcludeInternalAccount bool
    Whether to exclude the Redis Labs internal cloud account.
    Name string
    A meaningful name to identify the cloud account
    ProviderType string
    The cloud provider of the cloud account, (either AWS or GCP)
    excludeInternalAccount Boolean
    Whether to exclude the Redis Labs internal cloud account.
    name String
    A meaningful name to identify the cloud account
    providerType String
    The cloud provider of the cloud account, (either AWS or GCP)
    excludeInternalAccount boolean
    Whether to exclude the Redis Labs internal cloud account.
    name string
    A meaningful name to identify the cloud account
    providerType string
    The cloud provider of the cloud account, (either AWS or GCP)
    exclude_internal_account bool
    Whether to exclude the Redis Labs internal cloud account.
    name str
    A meaningful name to identify the cloud account
    provider_type str
    The cloud provider of the cloud account, (either AWS or GCP)
    excludeInternalAccount Boolean
    Whether to exclude the Redis Labs internal cloud account.
    name String
    A meaningful name to identify the cloud account
    providerType String
    The cloud provider of the cloud account, (either AWS or GCP)

    getCloudAccount Result

    The following output properties are available:

    AccessKeyId string
    The access key ID associated with the cloud account
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    ProviderType string
    ExcludeInternalAccount bool
    AccessKeyId string
    The access key ID associated with the cloud account
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    ProviderType string
    ExcludeInternalAccount bool
    accessKeyId String
    The access key ID associated with the cloud account
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    providerType String
    excludeInternalAccount Boolean
    accessKeyId string
    The access key ID associated with the cloud account
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    providerType string
    excludeInternalAccount boolean
    access_key_id str
    The access key ID associated with the cloud account
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    provider_type str
    exclude_internal_account bool
    accessKeyId String
    The access key ID associated with the cloud account
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    providerType String
    excludeInternalAccount Boolean

    Package Details

    Repository
    rediscloud RedisLabs/pulumi-rediscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rediscloud Terraform Provider.
    rediscloud logo
    Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs