DiskAsyncReplication class
Starts and stops asynchronous persistent disk replication. For more information see the official documentation and the API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const primary_disk = new gcp.compute.Disk("primary-disk", {
name: "primary-disk",
type: "pd-ssd",
zone: "europe-west4-a",
physicalBlockSizeBytes: 4096,
});
const secondary_disk = new gcp.compute.Disk("secondary-disk", {
name: "secondary-disk",
type: "pd-ssd",
zone: "europe-west3-a",
asyncPrimaryDisk: {
disk: primary_disk.id,
},
physicalBlockSizeBytes: 4096,
});
const replication = new gcp.compute.DiskAsyncReplication("replication", {
primaryDisk: primary_disk.id,
secondaryDisk: {
disk: secondary_disk.id,
},
});
import pulumi
import pulumi_gcp as gcp
primary_disk = gcp.compute.Disk("primary-disk",
name="primary-disk",
type="pd-ssd",
zone="europe-west4-a",
physical_block_size_bytes=4096)
secondary_disk = gcp.compute.Disk("secondary-disk",
name="secondary-disk",
type="pd-ssd",
zone="europe-west3-a",
async_primary_disk={
"disk": primary_disk.id,
},
physical_block_size_bytes=4096)
replication = gcp.compute.DiskAsyncReplication("replication",
primary_disk=primary_disk.id,
secondary_disk={
"disk": secondary_disk.id,
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var primary_disk = new Gcp.Compute.Disk("primary-disk", new()
{
Name = "primary-disk",
Type = "pd-ssd",
Zone = "europe-west4-a",
PhysicalBlockSizeBytes = 4096,
});
var secondary_disk = new Gcp.Compute.Disk("secondary-disk", new()
{
Name = "secondary-disk",
Type = "pd-ssd",
Zone = "europe-west3-a",
AsyncPrimaryDisk = new Gcp.Compute.Inputs.DiskAsyncPrimaryDiskArgs
{
Disk = primary_disk.Id,
},
PhysicalBlockSizeBytes = 4096,
});
var replication = new Gcp.Compute.DiskAsyncReplication("replication", new()
{
PrimaryDisk = primary_disk.Id,
SecondaryDisk = new Gcp.Compute.Inputs.DiskAsyncReplicationSecondaryDiskArgs
{
Disk = secondary_disk.Id,
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
primary_disk, err := compute.NewDisk(ctx, "primary-disk", &compute.DiskArgs{
Name: pulumi.String("primary-disk"),
Type: pulumi.String("pd-ssd"),
Zone: pulumi.String("europe-west4-a"),
PhysicalBlockSizeBytes: pulumi.Int(4096),
})
if err != nil {
return err
}
secondary_disk, err := compute.NewDisk(ctx, "secondary-disk", &compute.DiskArgs{
Name: pulumi.String("secondary-disk"),
Type: pulumi.String("pd-ssd"),
Zone: pulumi.String("europe-west3-a"),
AsyncPrimaryDisk: &compute.DiskAsyncPrimaryDiskArgs{
Disk: primary_disk.ID().ToIDOutput().ToStringOutput(),
},
PhysicalBlockSizeBytes: pulumi.Int(4096),
})
if err != nil {
return err
}
_, err = compute.NewDiskAsyncReplication(ctx, "replication", &compute.DiskAsyncReplicationArgs{
PrimaryDisk: primary_disk.ID().ToIDOutput().ToStringOutput(),
SecondaryDisk: &compute.DiskAsyncReplicationSecondaryDiskArgs{
Disk: secondary_disk.ID().ToIDOutput().ToStringOutput(),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_compute_disk" "primary-disk" {
name = "primary-disk"
type = "pd-ssd"
zone = "europe-west4-a"
physical_block_size_bytes = 4096
}
resource "gcp_compute_disk" "secondary-disk" {
name = "secondary-disk"
type = "pd-ssd"
zone = "europe-west3-a"
async_primary_disk = {
disk = gcp_compute_disk.primary-disk.id
}
physical_block_size_bytes = 4096
}
resource "gcp_compute_diskasyncreplication" "replication" {
primary_disk = gcp_compute_disk.primary-disk.id
secondary_disk = {
disk = gcp_compute_disk.secondary-disk.id
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.inputs.DiskAsyncPrimaryDiskArgs;
import com.pulumi.gcp.compute.DiskAsyncReplication;
import com.pulumi.gcp.compute.DiskAsyncReplicationArgs;
import com.pulumi.gcp.compute.inputs.DiskAsyncReplicationSecondaryDiskArgs;
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 primary_disk = new Disk("primary-disk", DiskArgs.builder()
.name("primary-disk")
.type("pd-ssd")
.zone("europe-west4-a")
.physicalBlockSizeBytes(4096)
.build());
var secondary_disk = new Disk("secondary-disk", DiskArgs.builder()
.name("secondary-disk")
.type("pd-ssd")
.zone("europe-west3-a")
.asyncPrimaryDisk(DiskAsyncPrimaryDiskArgs.builder()
.disk(primary_disk.id())
.build())
.physicalBlockSizeBytes(4096)
.build());
var replication = new DiskAsyncReplication("replication", DiskAsyncReplicationArgs.builder()
.primaryDisk(primary_disk.id())
.secondaryDisk(DiskAsyncReplicationSecondaryDiskArgs.builder()
.disk(secondary_disk.id())
.build())
.build());
}
}
resources:
primary-disk:
type: gcp:compute:Disk
properties:
name: primary-disk
type: pd-ssd
zone: europe-west4-a
physicalBlockSizeBytes: 4096
secondary-disk:
type: gcp:compute:Disk
properties:
name: secondary-disk
type: pd-ssd
zone: europe-west3-a
asyncPrimaryDisk:
disk: ${["primary-disk"].id}
physicalBlockSizeBytes: 4096
replication:
type: gcp:compute:DiskAsyncReplication
properties:
primaryDisk: ${["primary-disk"].id}
secondaryDisk:
disk: ${["secondary-disk"].id}
Constructors
- DiskAsyncReplication(String name, {DiskAsyncReplicationArgs? args, CustomResourceOptions? options})
-
Creates a new DiskAsyncReplication.
nameThe Pulumi resource name.argsArguments used to configure this DiskAsyncReplication. The set of arguments for DiskAsyncReplication.optionsResource options controlling this resource's behavior. - DiskAsyncReplication.reference(String urn)
- Creates a typed reference to an existing DiskAsyncReplication resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to "DELETE".
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- 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
-
primaryDisk
↔ Output<
String> -
The primary disk (source of replication).
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
secondaryDisk
↔ Output<
DiskAsyncReplicationSecondaryDisk> -
The secondary disk (target of replication). You can specify only one value. Structure is documented below.
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, {DiskAsyncReplicationState? state, CustomResourceOptions? options}) → DiskAsyncReplication -
Gets an existing DiskAsyncReplication resource's state with the given
nameandid.