Class BackupResource

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.backup.BackupResource
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-22T22:42:47.856Z") @Stability(Stable) public class BackupResource extends software.amazon.jsii.JsiiObject
A resource to backup.

Example:

 BackupPlan plan;
 Vpc vpc;
 ITable myTable = Table.fromTableName(this, "Table", "myTableName");
 DatabaseInstance myDatabaseInstance = DatabaseInstance.Builder.create(this, "DatabaseInstance")
         .engine(DatabaseInstanceEngine.mysql(MySqlInstanceEngineProps.builder().version(MysqlEngineVersion.VER_8_0_26).build()))
         .vpc(vpc)
         .build();
 DatabaseCluster myDatabaseCluster = DatabaseCluster.Builder.create(this, "DatabaseCluster")
         .engine(DatabaseClusterEngine.auroraMysql(AuroraMysqlClusterEngineProps.builder().version(AuroraMysqlEngineVersion.VER_2_08_1).build()))
         .credentials(Credentials.fromGeneratedSecret("clusteradmin"))
         .instanceProps(InstanceProps.builder()
                 .vpc(vpc)
                 .build())
         .build();
 ServerlessCluster myServerlessCluster = ServerlessCluster.Builder.create(this, "ServerlessCluster")
         .engine(DatabaseClusterEngine.AURORA_POSTGRESQL)
         .parameterGroup(ParameterGroup.fromParameterGroupName(this, "ParameterGroup", "default.aurora-postgresql11"))
         .vpc(vpc)
         .build();
 Construct myCoolConstruct = new Construct(this, "MyCoolConstruct");
 plan.addSelection("Selection", BackupSelectionOptions.builder()
         .resources(List.of(BackupResource.fromDynamoDbTable(myTable), BackupResource.fromRdsDatabaseInstance(myDatabaseInstance), BackupResource.fromRdsDatabaseCluster(myDatabaseCluster), BackupResource.fromRdsServerlessCluster(myServerlessCluster), BackupResource.fromTag("stage", "prod"), BackupResource.fromConstruct(myCoolConstruct)))
         .build());
 
  • Constructor Details

    • BackupResource

      protected BackupResource(software.amazon.jsii.JsiiObjectRef objRef)
    • BackupResource

      protected BackupResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • BackupResource

      @Stability(Stable) public BackupResource(@Nullable String resource, @Nullable TagCondition tagCondition, @Nullable software.constructs.Construct construct)
      Parameters:
      resource -
      tagCondition -
      construct -
    • BackupResource

      @Stability(Stable) public BackupResource(@Nullable String resource, @Nullable TagCondition tagCondition)
      Parameters:
      resource -
      tagCondition -
    • BackupResource

      @Stability(Stable) public BackupResource(@Nullable String resource)
      Parameters:
      resource -
    • BackupResource

      @Stability(Stable) public BackupResource()
  • Method Details

    • fromArn

      @Stability(Stable) @NotNull public static BackupResource fromArn(@NotNull String arn)
      A list of ARNs or match patterns such as arn:aws:ec2:us-east-1:123456789012:volume/*.

      Parameters:
      arn - This parameter is required.
    • fromConstruct

      @Stability(Stable) @NotNull public static BackupResource fromConstruct(@NotNull software.constructs.Construct construct)
      Adds all supported resources in a construct.

      Parameters:
      construct - The construct containing resources to backup. This parameter is required.
    • fromDynamoDbTable

      @Stability(Stable) @NotNull public static BackupResource fromDynamoDbTable(@NotNull ITable table)
      A DynamoDB table.

      Parameters:
      table - This parameter is required.
    • fromEc2Instance

      @Stability(Stable) @NotNull public static BackupResource fromEc2Instance(@NotNull IInstance instance)
      An EC2 instance.

      Parameters:
      instance - This parameter is required.
    • fromEfsFileSystem

      @Stability(Stable) @NotNull public static BackupResource fromEfsFileSystem(@NotNull IFileSystem fileSystem)
      An EFS file system.

      Parameters:
      fileSystem - This parameter is required.
    • fromRdsDatabaseCluster

      @Stability(Stable) @NotNull public static BackupResource fromRdsDatabaseCluster(@NotNull IDatabaseCluster cluster)
      A RDS database cluter.

      Parameters:
      cluster - This parameter is required.
    • fromRdsDatabaseInstance

      @Stability(Stable) @NotNull public static BackupResource fromRdsDatabaseInstance(@NotNull IDatabaseInstance instance)
      A RDS database instance.

      Parameters:
      instance - This parameter is required.
    • fromRdsServerlessCluster

      @Stability(Stable) @NotNull public static BackupResource fromRdsServerlessCluster(@NotNull IServerlessCluster cluster)
      An Aurora database instance.

      Parameters:
      cluster - This parameter is required.
    • fromTag

      @Stability(Stable) @NotNull public static BackupResource fromTag(@NotNull String key, @NotNull String value, @Nullable TagOperation operation)
      A tag condition.

      Parameters:
      key - This parameter is required.
      value - This parameter is required.
      operation -
    • fromTag

      @Stability(Stable) @NotNull public static BackupResource fromTag(@NotNull String key, @NotNull String value)
      A tag condition.

      Parameters:
      key - This parameter is required.
      value - This parameter is required.
    • getConstruct

      @Stability(Stable) @Nullable public software.constructs.Construct getConstruct()
      A construct.
    • getResource

      @Stability(Stable) @Nullable public String getResource()
      A resource.
    • getTagCondition

      @Stability(Stable) @Nullable public TagCondition getTagCondition()
      A condition on a tag.