TableExport class

Resource for managing an AWS DynamoDB Table Export. Terraform will wait until the Table export reaches a status of COMPLETED or FAILED.

See the AWS Documentation for more information on how this process works.

> TIP: Point-in-time Recovery must be enabled on the target DynamoDB Table.

> NOTE: Once a AWS DynamoDB Table Export has been created it is immutable. The AWS API does not delete this resource. When you run destroy the provider will remove the resource from the Terraform state, no exported data will be deleted.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.Bucket("example", {
    bucketPrefix: "example",
    forceDestroy: true,
});
const exampleTable = new aws.dynamodb.Table("example", {
    pointInTimeRecovery: {
        enabled: true,
    },
    attributes: [{
        name: "user_id",
        type: "S",
    }],
    name: "example-table-1",
    billingMode: "PAY_PER_REQUEST",
    hashKey: "user_id",
});
const exampleTableExport = new aws.dynamodb.TableExport("example", {
    tableArn: exampleTable.arn,
    s3Bucket: example.id,
});
import pulumi
import pulumi_aws as aws

example = aws.s3.Bucket("example",
    bucket_prefix="example",
    force_destroy=True)
example_table = aws.dynamodb.Table("example",
    point_in_time_recovery={
        "enabled": True,
    },
    attributes=[{
        "name": "user_id",
        "type": "S",
    }],
    name="example-table-1",
    billing_mode="PAY_PER_REQUEST",
    hash_key="user_id")
example_table_export = aws.dynamodb.TableExport("example",
    table_arn=example_table.arn,
    s3_bucket=example.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.S3.Bucket("example", new()
    {
        BucketPrefix = "example",
        ForceDestroy = true,
    });

    var exampleTable = new Aws.DynamoDB.Table("example", new()
    {
        PointInTimeRecovery = new Aws.DynamoDB.Inputs.TablePointInTimeRecoveryArgs
        {
            Enabled = true,
        },
        Attributes = new[]
        {
            new Aws.DynamoDB.Inputs.TableAttributeArgs
            {
                Name = "user_id",
                Type = "S",
            },
        },
        Name = "example-table-1",
        BillingMode = "PAY_PER_REQUEST",
        HashKey = "user_id",
    });

    var exampleTableExport = new Aws.DynamoDB.TableExport("example", new()
    {
        TableArn = exampleTable.Arn,
        S3Bucket = example.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/dynamodb"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
			BucketPrefix: pulumi.String("example"),
			ForceDestroy: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		exampleTable, err := dynamodb.NewTable(ctx, "example", &dynamodb.TableArgs{
			PointInTimeRecovery: &dynamodb.TablePointInTimeRecoveryArgs{
				Enabled: pulumi.Bool(true),
			},
			Attributes: dynamodb.TableAttributeArray{
				&dynamodb.TableAttributeArgs{
					Name: pulumi.String("user_id"),
					Type: pulumi.String("S"),
				},
			},
			Name:        pulumi.String("example-table-1"),
			BillingMode: pulumi.String("PAY_PER_REQUEST"),
			HashKey:     pulumi.String("user_id"),
		})
		if err != nil {
			return err
		}
		_, err = dynamodb.NewTableExport(ctx, "example", &dynamodb.TableExportArgs{
			TableArn: exampleTable.Arn,
			S3Bucket: example.ID().ToIDOutput().ToStringOutput(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_s3_bucket" "example" {
  bucket_prefix = "example"
  force_destroy = true
}
resource "aws_dynamodb_table" "example" {
  point_in_time_recovery = {
    enabled = true
  }
  attributes {
    name = "user_id"
    type = "S"
  }
  name         = "example-table-1"
  billing_mode = "PAY_PER_REQUEST"
  hash_key     = "user_id"
}
resource "aws_dynamodb_tableexport" "example" {
  table_arn = aws_dynamodb_table.example.arn
  s3_bucket = aws_s3_bucket.example.id
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.Bucket;
import com.pulumi.aws.s3.BucketArgs;
import com.pulumi.aws.dynamodb.Table;
import com.pulumi.aws.dynamodb.TableArgs;
import com.pulumi.aws.dynamodb.inputs.TablePointInTimeRecoveryArgs;
import com.pulumi.aws.dynamodb.inputs.TableAttributeArgs;
import com.pulumi.aws.dynamodb.TableExport;
import com.pulumi.aws.dynamodb.TableExportArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new Bucket("example", BucketArgs.builder()
            .bucketPrefix("example")
            .forceDestroy(true)
            .build());

        var exampleTable = new Table("exampleTable", TableArgs.builder()
            .pointInTimeRecovery(TablePointInTimeRecoveryArgs.builder()
                .enabled(true)
                .build())
            .attributes(TableAttributeArgs.builder()
                .name("user_id")
                .type("S")
                .build())
            .name("example-table-1")
            .billingMode("PAY_PER_REQUEST")
            .hashKey("user_id")
            .build());

        var exampleTableExport = new TableExport("exampleTableExport", TableExportArgs.builder()
            .tableArn(exampleTable.arn())
            .s3Bucket(example.id())
            .build());

    }
}
resources:
  example:
    type: aws:s3:Bucket
    properties:
      bucketPrefix: example
      forceDestroy: true
  exampleTable:
    type: aws:dynamodb:Table
    name: example
    properties:
      pointInTimeRecovery:
        enabled: true
      attributes:
        - name: user_id
          type: S
      name: example-table-1
      billingMode: PAY_PER_REQUEST
      hashKey: user_id
  exampleTableExport:
    type: aws:dynamodb:TableExport
    name: example
    properties:
      tableArn: ${exampleTable.arn}
      s3Bucket: ${example.id}

Example with export time

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.dynamodb.TableExport("example", {
    exportTime: "2023-04-02T11:30:13+01:00",
    s3Bucket: exampleAwsS3Bucket.id,
    tableArn: exampleAwsDynamodbTable.arn,
});
import pulumi
import pulumi_aws as aws

example = aws.dynamodb.TableExport("example",
    export_time="2023-04-02T11:30:13+01:00",
    s3_bucket=example_aws_s3_bucket["id"],
    table_arn=example_aws_dynamodb_table["arn"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.DynamoDB.TableExport("example", new()
    {
        ExportTime = "2023-04-02T11:30:13+01:00",
        S3Bucket = exampleAwsS3Bucket.Id,
        TableArn = exampleAwsDynamodbTable.Arn,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/dynamodb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dynamodb.NewTableExport(ctx, "example", &dynamodb.TableExportArgs{
			ExportTime: pulumi.String("2023-04-02T11:30:13+01:00"),
			S3Bucket:   pulumi.Any(exampleAwsS3Bucket.Id),
			TableArn:   pulumi.Any(exampleAwsDynamodbTable.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_dynamodb_tableexport" "example" {
  export_time = "2023-04-02T11:30:13+01:00"
  s3_bucket   = exampleAwsS3Bucket.id
  table_arn   = exampleAwsDynamodbTable.arn
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.dynamodb.TableExport;
import com.pulumi.aws.dynamodb.TableExportArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new TableExport("example", TableExportArgs.builder()
            .exportTime("2023-04-02T11:30:13+01:00")
            .s3Bucket(exampleAwsS3Bucket.id())
            .tableArn(exampleAwsDynamodbTable.arn())
            .build());

    }
}
resources:
  example:
    type: aws:dynamodb:TableExport
    properties:
      exportTime: 2023-04-02T11:30:13+01:00
      s3Bucket: ${exampleAwsS3Bucket.id}
      tableArn: ${exampleAwsDynamodbTable.arn}

Incremental export

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.dynamodb.TableExport("example", {
    incrementalExportSpecification: {
        exportFromTime: "2025-02-09T12:00:00+01:00",
        exportToTime: "2025-02-09T13:00:00+01:00",
    },
    exportType: "INCREMENTAL_EXPORT",
    s3Bucket: exampleAwsS3Bucket.id,
    tableArn: exampleAwsDynamodbTable.arn,
});
import pulumi
import pulumi_aws as aws

example = aws.dynamodb.TableExport("example",
    incremental_export_specification={
        "export_from_time": "2025-02-09T12:00:00+01:00",
        "export_to_time": "2025-02-09T13:00:00+01:00",
    },
    export_type="INCREMENTAL_EXPORT",
    s3_bucket=example_aws_s3_bucket["id"],
    table_arn=example_aws_dynamodb_table["arn"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.DynamoDB.TableExport("example", new()
    {
        IncrementalExportSpecification = new Aws.DynamoDB.Inputs.TableExportIncrementalExportSpecificationArgs
        {
            ExportFromTime = "2025-02-09T12:00:00+01:00",
            ExportToTime = "2025-02-09T13:00:00+01:00",
        },
        ExportType = "INCREMENTAL_EXPORT",
        S3Bucket = exampleAwsS3Bucket.Id,
        TableArn = exampleAwsDynamodbTable.Arn,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/dynamodb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dynamodb.NewTableExport(ctx, "example", &dynamodb.TableExportArgs{
			IncrementalExportSpecification: &dynamodb.TableExportIncrementalExportSpecificationArgs{
				ExportFromTime: pulumi.String("2025-02-09T12:00:00+01:00"),
				ExportToTime:   pulumi.String("2025-02-09T13:00:00+01:00"),
			},
			ExportType: pulumi.String("INCREMENTAL_EXPORT"),
			S3Bucket:   pulumi.Any(exampleAwsS3Bucket.Id),
			TableArn:   pulumi.Any(exampleAwsDynamodbTable.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_dynamodb_tableexport" "example" {
  incremental_export_specification = {
    export_from_time = "2025-02-09T12:00:00+01:00"
    export_to_time   = "2025-02-09T13:00:00+01:00"
  }
  export_type = "INCREMENTAL_EXPORT"
  s3_bucket   = exampleAwsS3Bucket.id
  table_arn   = exampleAwsDynamodbTable.arn
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.dynamodb.TableExport;
import com.pulumi.aws.dynamodb.TableExportArgs;
import com.pulumi.aws.dynamodb.inputs.TableExportIncrementalExportSpecificationArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new TableExport("example", TableExportArgs.builder()
            .incrementalExportSpecification(TableExportIncrementalExportSpecificationArgs.builder()
                .exportFromTime("2025-02-09T12:00:00+01:00")
                .exportToTime("2025-02-09T13:00:00+01:00")
                .build())
            .exportType("INCREMENTAL_EXPORT")
            .s3Bucket(exampleAwsS3Bucket.id())
            .tableArn(exampleAwsDynamodbTable.arn())
            .build());

    }
}
resources:
  example:
    type: aws:dynamodb:TableExport
    properties:
      incrementalExportSpecification:
        exportFromTime: 2025-02-09T12:00:00+01:00
        exportToTime: 2025-02-09T13:00:00+01:00
      exportType: INCREMENTAL_EXPORT
      s3Bucket: ${exampleAwsS3Bucket.id}
      tableArn: ${exampleAwsDynamodbTable.arn}

Import

Identity Schema

Required

  • arn (String) ARN of the DynamoDB table export.

Using pulumi import, import DynamoDB table exports using the arn. For example:

$ pulumi import aws:dynamodb/tableExport:TableExport example arn:aws:dynamodb:us-west-2:12345678911:table/my-table-1/export/01580735656614-2c2f422e

Constructors

TableExport(String name, {TableExportArgs? args, CustomResourceOptions? options})
Creates a new TableExport. name The Pulumi resource name. args Arguments used to configure this TableExport. The set of arguments for TableExport. options Resource options controlling this resource's behavior.
TableExport.reference(String urn)
Creates a typed reference to an existing TableExport resource.

Properties

arn ↔ Output<String>
ARN of the Table Export.
latefinal
billedSizeInBytes ↔ Output<int>
Billable size of the table export.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
endTime ↔ Output<String>
Time at which the export task completed.
latefinal
exportFormat ↔ Output<String?>
Format for the exported data. Valid values are: DYNAMODB_JSON, ION. See the AWS Documentation for more information on these export formats. Default is DYNAMODB_JSON.
latefinal
exportStatus ↔ Output<String>
Status of the export - export can be in one of the following states IN_PROGRESS, COMPLETED, or FAILED.
latefinal
exportTime ↔ Output<String>
Time in RFC3339 format from which to export table data. The table export will be a snapshot of the table's state at this point in time. Omitting this value will result in a snapshot from the current time.
latefinal
exportType ↔ Output<String>
Whether to execute as a full export or incremental export. Valid values are: FULL_EXPORT, INCREMENTAL_EXPORT. Defaults to FULL_EXPORT. If INCREMENTAL_EXPORT is provided, the incrementalExportSpecification argument must also be provided. incrementalExportSpecification - (Optional, Forces new resource) Parameters specific to an incremental export. See incrementalExportSpecification Block for details.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
incrementalExportSpecification ↔ Output<TableExportIncrementalExportSpecification?>
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
itemCount ↔ Output<int>
Number of items exported.
latefinal
manifestFilesS3Key ↔ Output<String>
Name of the manifest file for the export task. See the AWS Documentation for more information on this manifest file.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
s3Bucket ↔ Output<String>
Name of the Amazon S3 bucket to export the snapshot to. See the AWS Documentation for information on how configure this S3 bucket.
latefinal
s3BucketOwner ↔ Output<String>
ID of the AWS account that owns the bucket the export will be stored in.
latefinal
s3Prefix ↔ Output<String>
Amazon S3 bucket prefix to use as the file name and path of the exported snapshot.
latefinal
s3SseAlgorithm ↔ Output<String>
Type of encryption used on the bucket where export data will be stored. Valid values are: AES256, KMS.
latefinal
s3SseKmsKeyId ↔ Output<String?>
ID of the AWS KMS managed key used to encrypt the S3 bucket where export data will be stored (if applicable).
latefinal
startTime ↔ Output<String>
Time at which the export task began.
latefinal
tableArn ↔ Output<String>
ARN associated with the table to export.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {TableExportState? state, CustomResourceOptions? options}) → TableExport
Gets an existing TableExport resource's state with the given name and id.