Class SnapshotCopy


  • public class SnapshotCopy
    extends com.pulumi.resources.CustomResource
    Manages an RDS database instance snapshot copy. For managing RDS database cluster snapshots, see the `aws.rds.ClusterSnapshot` resource. ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     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.SnapshotCopy;
     import com.pulumi.aws.rds.SnapshotCopyArgs;
     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 Instance("example", InstanceArgs.builder()
                 .allocatedStorage(10)
                 .engine("mysql")
                 .engineVersion("5.6.21")
                 .instanceClass("db.t2.micro")
                 .dbName("baz")
                 .password("barbarbarbar")
                 .username("foo")
                 .maintenanceWindow("Fri:09:00-Fri:09:30")
                 .backupRetentionPeriod(0)
                 .parameterGroupName("default.mysql5.6")
                 .build());
     
             var exampleSnapshot = new Snapshot("exampleSnapshot", SnapshotArgs.builder()
                 .dbInstanceIdentifier(example.identifier())
                 .dbSnapshotIdentifier("testsnapshot1234")
                 .build());
     
             var exampleSnapshotCopy = new SnapshotCopy("exampleSnapshotCopy", SnapshotCopyArgs.builder()
                 .sourceDbSnapshotIdentifier(exampleSnapshot.dbSnapshotArn())
                 .targetDbSnapshotIdentifier("testsnapshot1234-copy")
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import `aws.rds.SnapshotCopy` using the snapshot identifier. For example: ```sh $ pulumi import aws:rds/snapshotCopy:SnapshotCopy example my-snapshot ```
    • 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.Integer> allocatedStorage()  
      com.pulumi.core.Output<java.lang.String> availabilityZone()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> copyTags()  
      com.pulumi.core.Output<java.lang.String> dbSnapshotArn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> destinationRegion()  
      com.pulumi.core.Output<java.lang.Boolean> encrypted()  
      com.pulumi.core.Output<java.lang.String> engine()  
      com.pulumi.core.Output<java.lang.String> engineVersion()  
      static SnapshotCopy get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, SnapshotCopyState 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.Integer> iops()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyId()  
      com.pulumi.core.Output<java.lang.String> licenseModel()  
      com.pulumi.core.Output<java.lang.String> optionGroupName()  
      com.pulumi.core.Output<java.lang.Integer> port()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> presignedUrl()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> sharedAccounts()  
      com.pulumi.core.Output<java.lang.String> snapshotType()  
      com.pulumi.core.Output<java.lang.String> sourceDbSnapshotIdentifier()  
      com.pulumi.core.Output<java.lang.String> sourceRegion()  
      com.pulumi.core.Output<java.lang.String> storageType()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> targetCustomAvailabilityZone()  
      com.pulumi.core.Output<java.lang.String> targetDbSnapshotIdentifier()  
      com.pulumi.core.Output<java.lang.String> vpcId()  
      • 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

      • SnapshotCopy

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

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

        public SnapshotCopy​(java.lang.String name,
                            SnapshotCopyArgs 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

      • allocatedStorage

        public com.pulumi.core.Output<java.lang.Integer> allocatedStorage()
        Returns:
        Allocated storage size in gigabytes (GB).
      • availabilityZone

        public com.pulumi.core.Output<java.lang.String> availabilityZone()
        Returns:
        Name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
      • copyTags

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> copyTags()
        Returns:
        Whether to copy existing tags. Defaults to `false`.
      • dbSnapshotArn

        public com.pulumi.core.Output<java.lang.String> dbSnapshotArn()
        Returns:
        ARN for the DB snapshot.
      • destinationRegion

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> destinationRegion()
        Returns:
        Destination Region to place snapshot copy.
      • encrypted

        public com.pulumi.core.Output<java.lang.Boolean> encrypted()
        Returns:
        Whether the DB snapshot is encrypted.
      • engine

        public com.pulumi.core.Output<java.lang.String> engine()
        Returns:
        Name of the database engine.
      • engineVersion

        public com.pulumi.core.Output<java.lang.String> engineVersion()
        Returns:
        Version of the database engine.
      • iops

        public com.pulumi.core.Output<java.lang.Integer> iops()
        Returns:
        Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.
      • kmsKeyId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyId()
        Returns:
        KMS key ID.
      • licenseModel

        public com.pulumi.core.Output<java.lang.String> licenseModel()
        Returns:
        License model information for the restored DB instance.
      • optionGroupName

        public com.pulumi.core.Output<java.lang.String> optionGroupName()
        Returns:
        Name of an option group to associate with the copy of the snapshot.
      • port

        public com.pulumi.core.Output<java.lang.Integer> port()
        Returns:
        Port that the database engine is listening on.
      • presignedUrl

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> presignedUrl()
        Returns:
        URL that contains a Signature Version 4 signed request.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • sharedAccounts

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> sharedAccounts()
        Returns:
        List of AWS Account IDs to share the snapshot with. Use `all` to make the snapshot public.
      • snapshotType

        public com.pulumi.core.Output<java.lang.String> snapshotType()
        Returns:
        Type of the DB snapshot.
      • sourceDbSnapshotIdentifier

        public com.pulumi.core.Output<java.lang.String> sourceDbSnapshotIdentifier()
        Returns:
        Snapshot identifier of the source snapshot.
      • sourceRegion

        public com.pulumi.core.Output<java.lang.String> sourceRegion()
        Returns:
        Region that the DB snapshot was created in or copied from.
      • storageType

        public com.pulumi.core.Output<java.lang.String> storageType()
        Returns:
        Storage type associated with DB snapshot.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • targetCustomAvailabilityZone

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> targetCustomAvailabilityZone()
        Returns:
        External custom Availability Zone.
      • targetDbSnapshotIdentifier

        public com.pulumi.core.Output<java.lang.String> targetDbSnapshotIdentifier()
        Returns:
        Identifier for the snapshot.
      • vpcId

        public com.pulumi.core.Output<java.lang.String> vpcId()
        Returns:
        Provides the VPC ID associated with the DB snapshot.
      • get

        public static SnapshotCopy get​(java.lang.String name,
                                       com.pulumi.core.Output<java.lang.String> id,
                                       @Nullable
                                       SnapshotCopyState 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.