Class RdsInstanceCrossBackupPolicy


  • public class RdsInstanceCrossBackupPolicy
    extends com.pulumi.resources.CustomResource
    Provides an RDS instance emote disaster recovery strategy policy resource and used to configure instance emote disaster recovery strategy policy. For information about RDS cross region backup settings and how to use them, see [What is cross region backup](https://www.alibabacloud.com/help/en/apsaradb-for-rds/latest/modify-cross-region-backup-settings). > **NOTE:** Available since v1.195.0. ## Example Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.rds.RdsFunctions; import com.pulumi.alicloud.rds.inputs.GetZonesArgs; import com.pulumi.alicloud.rds.inputs.GetInstanceClassesArgs; import com.pulumi.alicloud.rds.inputs.GetCrossRegionsArgs; import com.pulumi.alicloud.vpc.Network; import com.pulumi.alicloud.vpc.NetworkArgs; import com.pulumi.alicloud.vpc.Switch; import com.pulumi.alicloud.vpc.SwitchArgs; import com.pulumi.alicloud.rds.Instance; import com.pulumi.alicloud.rds.InstanceArgs; import com.pulumi.alicloud.rds.RdsInstanceCrossBackupPolicy; import com.pulumi.alicloud.rds.RdsInstanceCrossBackupPolicyArgs; 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 config = ctx.config(); final var name = config.get("name").orElse("tf-example"); final var defaultZones = RdsFunctions.getZones(GetZonesArgs.builder() .engine("MySQL") .engineVersion("8.0") .dbInstanceStorageType("local_ssd") .category("HighAvailability") .build()); final var defaultInstanceClasses = RdsFunctions.getInstanceClasses(GetInstanceClassesArgs.builder() .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0])) .engine("MySQL") .engineVersion("8.0") .dbInstanceStorageType("local_ssd") .category("HighAvailability") .build()); final var regions = RdsFunctions.getCrossRegions(); var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder() .vpcName(name) .cidrBlock("172.16.0.0/16") .build()); var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder() .vpcId(defaultNetwork.id()) .cidrBlock("172.16.0.0/24") .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0])) .vswitchName(name) .build()); var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder() .engine("MySQL") .engineVersion("8.0") .instanceType(defaultInstanceClasses.applyValue(getInstanceClassesResult -> getInstanceClassesResult.instanceClasses()[0].instanceClass())) .instanceStorage(defaultInstanceClasses.applyValue(getInstanceClassesResult -> getInstanceClassesResult.instanceClasses()[0].storageRange().min())) .instanceChargeType("Postpaid") .category("HighAvailability") .instanceName(name) .vswitchId(defaultSwitch.id()) .dbInstanceStorageType("local_ssd") .build()); var defaultRdsInstanceCrossBackupPolicy = new RdsInstanceCrossBackupPolicy("defaultRdsInstanceCrossBackupPolicy", RdsInstanceCrossBackupPolicyArgs.builder() .instanceId(defaultInstance.id()) .crossBackupRegion(regions.applyValue(getCrossRegionsResult -> getCrossRegionsResult.ids()[0])) .build()); } } ``` ## Import RDS remote disaster recovery policies can be imported using id or instance id, e.g. ```sh $ pulumi import alicloud:rds/rdsInstanceCrossBackupPolicy:RdsInstanceCrossBackupPolicy example "rm-12345678" ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> backupEnabled()  
      com.pulumi.core.Output<java.lang.String> backupEnabledTime()  
      com.pulumi.core.Output<java.lang.String> crossBackupRegion()  
      com.pulumi.core.Output<java.lang.String> crossBackupType()  
      com.pulumi.core.Output<java.lang.String> dbInstanceStatus()  
      static RdsInstanceCrossBackupPolicy get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, RdsInstanceCrossBackupPolicyState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> instanceId()  
      com.pulumi.core.Output<java.lang.String> lockMode()  
      com.pulumi.core.Output<java.lang.String> logBackupEnabled()  
      com.pulumi.core.Output<java.lang.String> logBackupEnabledTime()  
      com.pulumi.core.Output<java.lang.Integer> retention()  
      com.pulumi.core.Output<java.lang.String> retentType()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RdsInstanceCrossBackupPolicy

        public RdsInstanceCrossBackupPolicy​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • RdsInstanceCrossBackupPolicy

        public RdsInstanceCrossBackupPolicy​(java.lang.String name,
                                            RdsInstanceCrossBackupPolicyArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • RdsInstanceCrossBackupPolicy

        public RdsInstanceCrossBackupPolicy​(java.lang.String name,
                                            RdsInstanceCrossBackupPolicyArgs args,
                                            @Nullable
                                            com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • backupEnabled

        public com.pulumi.core.Output<java.lang.String> backupEnabled()
        Returns:
        The status of the overall cross-region backup switch on the instance. Valid values: - Disabled - Enable
      • backupEnabledTime

        public com.pulumi.core.Output<java.lang.String> backupEnabledTime()
        Returns:
        The time when cross-region backup was enabled on the instance. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
      • crossBackupRegion

        public com.pulumi.core.Output<java.lang.String> crossBackupRegion()
        Returns:
        The ID of the destination region where the cross-region backup files of the instance are stored.
      • crossBackupType

        public com.pulumi.core.Output<java.lang.String> crossBackupType()
        Returns:
        The policy that is used to save cross-region backups of the instance. Default value: 1. The default value 1 indicates that all cross-region backups are saved.
      • dbInstanceStatus

        public com.pulumi.core.Output<java.lang.String> dbInstanceStatus()
        Returns:
        The state of the instance. For more information, see Instance status.
      • instanceId

        public com.pulumi.core.Output<java.lang.String> instanceId()
        Returns:
        The ID of the instance.
      • lockMode

        public com.pulumi.core.Output<java.lang.String> lockMode()
        Returns:
        The lock status of the instance. Valid values: - Unlock: The instance is not locked. - ManualLock: The instance is manually locked. - LockByExpiration: The instance is locked upon expiration. - LockByRestoration: The instance is automatically locked before a rollback. - LockByDiskQuota: The instance is automatically locked because its storage space is exhausted. In this situation, the instance is inaccessible.
      • logBackupEnabled

        public com.pulumi.core.Output<java.lang.String> logBackupEnabled()
        Returns:
        The status of the cross-region log backup feature on the instance. Valid values: - Enable: Enables the feature. - Disabled: Disables the feature.
      • logBackupEnabledTime

        public com.pulumi.core.Output<java.lang.String> logBackupEnabledTime()
        Returns:
        The time when cross-region log backup was enabled on the instance. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
      • retentType

        public com.pulumi.core.Output<java.lang.String> retentType()
        Returns:
        The policy that is used to retain cross-region backups of the instance. Default value: 1. The default value 1 indicate that cross-region backups are retained based on the specified retention period.
      • retention

        public com.pulumi.core.Output<java.lang.Integer> retention()
        Returns:
        The number of days for which the cross-region backup files of the instance are retained. Valid values: 7 to 1825. Default value: 7.
      • get

        public static RdsInstanceCrossBackupPolicy get​(java.lang.String name,
                                                       com.pulumi.core.Output<java.lang.String> id,
                                                       @Nullable
                                                       RdsInstanceCrossBackupPolicyState state,
                                                       @Nullable
                                                       com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.