1. Packages
  2. AWS
  3. API Docs
  4. dynamodb
  5. getTables
AWS v6.82.2 published on Thursday, Jun 12, 2025 by Pulumi

aws.dynamodb.getTables

Explore with Pulumi AI

aws logo
AWS v6.82.2 published on Thursday, Jun 12, 2025 by Pulumi

    Returns a list of all AWS DynamoDB table names in a region.

    Example Usage

    The following example retrieves a list of all DynamoDB table names in a region.

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const all = aws.dynamodb.getTables({});
    export const tableNames = all.then(all => all.names);
    
    import pulumi
    import pulumi_aws as aws
    
    all = aws.dynamodb.get_tables()
    pulumi.export("tableNames", all.names)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/dynamodb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all, err := dynamodb.GetTables(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("tableNames", all.Names)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Aws.DynamoDB.GetTables.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["tableNames"] = all.Apply(getTablesResult => getTablesResult.Names),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.dynamodb.DynamodbFunctions;
    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 all = DynamodbFunctions.getTables(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
    
            ctx.export("tableNames", all.names());
        }
    }
    
    variables:
      all:
        fn::invoke:
          function: aws:dynamodb:getTables
          arguments: {}
    outputs:
      tableNames: ${all.names}
    

    Using getTables

    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 getTables(opts?: InvokeOptions): Promise<GetTablesResult>
    function getTablesOutput(opts?: InvokeOptions): Output<GetTablesResult>
    def get_tables(opts: Optional[InvokeOptions] = None) -> GetTablesResult
    def get_tables_output(opts: Optional[InvokeOptions] = None) -> Output[GetTablesResult]
    func GetTables(ctx *Context, opts ...InvokeOption) (*GetTablesResult, error)
    func GetTablesOutput(ctx *Context, opts ...InvokeOption) GetTablesResultOutput

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

    public static class GetTables 
    {
        public static Task<GetTablesResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetTablesResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTablesResult> getTables(InvokeOptions options)
    public static Output<GetTablesResult> getTables(InvokeOptions options)
    
    fn::invoke:
      function: aws:dynamodb/getTables:getTables
      arguments:
        # arguments dictionary

    getTables Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Names List<string>
    A list of all the DynamoDB table names found.
    Id string
    The provider-assigned unique ID for this managed resource.
    Names []string
    A list of all the DynamoDB table names found.
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    A list of all the DynamoDB table names found.
    id string
    The provider-assigned unique ID for this managed resource.
    names string[]
    A list of all the DynamoDB table names found.
    id str
    The provider-assigned unique ID for this managed resource.
    names Sequence[str]
    A list of all the DynamoDB table names found.
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    A list of all the DynamoDB table names found.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.82.2 published on Thursday, Jun 12, 2025 by Pulumi