ExportTask

class ExportTask : KotlinCustomResource

Resource for managing an AWS RDS (Relational Database) Export Task.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.ExportTask;
import com.pulumi.aws.rds.ExportTaskArgs;
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) {
var example = new ExportTask("example", ExportTaskArgs.builder()
.exportTaskIdentifier("example")
.sourceArn(aws_db_snapshot.example().db_snapshot_arn())
.s3BucketName(aws_s3_bucket.example().id())
.iamRoleArn(aws_iam_role.example().arn())
.kmsKeyId(aws_kms_key.example().arn())
.build());
}
}

Complete Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketV2;
import com.pulumi.aws.s3.BucketV2Args;
import com.pulumi.aws.s3.BucketAclV2;
import com.pulumi.aws.s3.BucketAclV2Args;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Policy;
import com.pulumi.aws.iam.PolicyArgs;
import com.pulumi.aws.iam.RolePolicyAttachment;
import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
import com.pulumi.aws.kms.Key;
import com.pulumi.aws.kms.KeyArgs;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import com.pulumi.aws.rds.Snapshot;
import com.pulumi.aws.rds.SnapshotArgs;
import com.pulumi.aws.rds.ExportTask;
import com.pulumi.aws.rds.ExportTaskArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
var exampleBucketV2 = new BucketV2("exampleBucketV2", BucketV2Args.builder()
.forceDestroy(true)
.build());
var exampleBucketAclV2 = new BucketAclV2("exampleBucketAclV2", BucketAclV2Args.builder()
.bucket(exampleBucketV2.id())
.acl("private")
.build());
var exampleRole = new Role("exampleRole", RoleArgs.builder()
.assumeRolePolicy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Action", "sts:AssumeRole"),
jsonProperty("Effect", "Allow"),
jsonProperty("Sid", ""),
jsonProperty("Principal", jsonObject(
jsonProperty("Service", "export.rds.amazonaws.com")
))
)))
)))
.build());
final var examplePolicyDocument = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(
GetPolicyDocumentStatementArgs.builder()
.actions("s3:ListAllMyBuckets")
.resources("*")
.build(),
GetPolicyDocumentStatementArgs.builder()
.actions(
"s3:GetBucketLocation",
"s3:ListBucket")
.resources(exampleBucketV2.arn())
.build(),
GetPolicyDocumentStatementArgs.builder()
.actions(
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject")
.resources(exampleBucketV2.arn().applyValue(arn -> String.format("%s/*", arn)))
.build())
.build());
var examplePolicy = new Policy("examplePolicy", PolicyArgs.builder()
.policy(examplePolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult).applyValue(examplePolicyDocument -> examplePolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json())))
.build());
var exampleRolePolicyAttachment = new RolePolicyAttachment("exampleRolePolicyAttachment", RolePolicyAttachmentArgs.builder()
.role(exampleRole.name())
.policyArn(examplePolicy.arn())
.build());
var exampleKey = new Key("exampleKey", KeyArgs.builder()
.deletionWindowInDays(10)
.build());
var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
.identifier("example")
.allocatedStorage(10)
.dbName("test")
.engine("mysql")
.engineVersion("5.7")
.instanceClass("db.t3.micro")
.username("foo")
.password("foobarbaz")
.parameterGroupName("default.mysql5.7")
.skipFinalSnapshot(true)
.build());
var exampleSnapshot = new Snapshot("exampleSnapshot", SnapshotArgs.builder()
.dbInstanceIdentifier(exampleInstance.identifier())
.dbSnapshotIdentifier("example")
.build());
var exampleExportTask = new ExportTask("exampleExportTask", ExportTaskArgs.builder()
.exportTaskIdentifier("example")
.sourceArn(exampleSnapshot.dbSnapshotArn())
.s3BucketName(exampleBucketV2.id())
.iamRoleArn(exampleRole.arn())
.kmsKeyId(exampleKey.arn())
.exportOnlies("database")
.s3Prefix("my_prefix/example")
.build());
}
}

Import

Using pulumi import, import a RDS (Relational Database) Export Task using the export_task_identifier. For example:

$ pulumi import aws:rds/exportTask:ExportTask example example

*/

Properties

Link copied to clipboard
val exportOnlies: Output<List<String>>?

Data to be exported from the snapshot. If this parameter is not provided, all the snapshot data is exported. Valid values are documented in the AWS StartExportTask API documentation.

Link copied to clipboard

Unique identifier for the snapshot export task.

Link copied to clipboard
val failureCause: Output<String>

Reason the export failed, if it failed.

Link copied to clipboard
val iamRoleArn: Output<String>

ARN of the IAM role to use for writing to the Amazon S3 bucket.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val kmsKeyId: Output<String>

ID of the Amazon Web Services KMS key to use to encrypt the snapshot.

Link copied to clipboard
val percentProgress: Output<Int>

Progress of the snapshot export task as a percentage.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val s3BucketName: Output<String>

Name of the Amazon S3 bucket to export the snapshot to.

Link copied to clipboard
val s3Prefix: Output<String>

Amazon S3 bucket prefix to use as the file name and path of the exported snapshot.

Link copied to clipboard
val snapshotTime: Output<String>

Time that the snapshot was created.

Link copied to clipboard
val sourceArn: Output<String>

Amazon Resource Name (ARN) of the snapshot to export. The following arguments are optional:

Link copied to clipboard
val sourceType: Output<String>

Type of source for the export.

Link copied to clipboard
val status: Output<String>

Status of the export task.

Link copied to clipboard
val taskEndTime: Output<String>

Time that the snapshot export task completed.

Link copied to clipboard
val taskStartTime: Output<String>

Time that the snapshot export task started.

Link copied to clipboard
Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val warningMessage: Output<String>

Warning about the snapshot export task, if any.