gcp.compute.DiskAsyncReplication

Explore with Pulumi AI

Starts and stops asynchronous persistent disk replication. For more information see the official documentation and the API.

Example Usage

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()
    {
        Type = "pd-ssd",
        Zone = "europe-west4-a",
        PhysicalBlockSizeBytes = 4096,
    });

    var secondary_disk = new Gcp.Compute.Disk("secondary-disk", new()
    {
        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/v6/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewDisk(ctx, "primary-disk", &compute.DiskArgs{
			Type:                   pulumi.String("pd-ssd"),
			Zone:                   pulumi.String("europe-west4-a"),
			PhysicalBlockSizeBytes: pulumi.Int(4096),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewDisk(ctx, "secondary-disk", &compute.DiskArgs{
			Type: pulumi.String("pd-ssd"),
			Zone: pulumi.String("europe-west3-a"),
			AsyncPrimaryDisk: &compute.DiskAsyncPrimaryDiskArgs{
				Disk: primary_disk.ID(),
			},
			PhysicalBlockSizeBytes: pulumi.Int(4096),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewDiskAsyncReplication(ctx, "replication", &compute.DiskAsyncReplicationArgs{
			PrimaryDisk: primary_disk.ID(),
			SecondaryDisk: &compute.DiskAsyncReplicationSecondaryDiskArgs{
				Disk: secondary_disk.ID(),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.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 primary_disk = new Disk("primary-disk", DiskArgs.builder()        
            .type("pd-ssd")
            .zone("europe-west4-a")
            .physicalBlockSizeBytes(4096)
            .build());

        var secondary_disk = new Disk("secondary-disk", DiskArgs.builder()        
            .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());

    }
}
import pulumi
import pulumi_gcp as gcp

primary_disk = gcp.compute.Disk("primary-disk",
    type="pd-ssd",
    zone="europe-west4-a",
    physical_block_size_bytes=4096)
secondary_disk = gcp.compute.Disk("secondary-disk",
    type="pd-ssd",
    zone="europe-west3-a",
    async_primary_disk=gcp.compute.DiskAsyncPrimaryDiskArgs(
        disk=primary_disk.id,
    ),
    physical_block_size_bytes=4096)
replication = gcp.compute.DiskAsyncReplication("replication",
    primary_disk=primary_disk.id,
    secondary_disk=gcp.compute.DiskAsyncReplicationSecondaryDiskArgs(
        disk=secondary_disk.id,
    ))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const primary_disk = new gcp.compute.Disk("primary-disk", {
    type: "pd-ssd",
    zone: "europe-west4-a",
    physicalBlockSizeBytes: 4096,
});
const secondary_disk = new gcp.compute.Disk("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,
    },
});
resources:
  primary-disk:
    type: gcp:compute:Disk
    properties:
      type: pd-ssd
      zone: europe-west4-a
      physicalBlockSizeBytes: 4096
  secondary-disk:
    type: gcp:compute:Disk
    properties:
      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}

Create DiskAsyncReplication Resource

new DiskAsyncReplication(name: string, args: DiskAsyncReplicationArgs, opts?: CustomResourceOptions);
@overload
def DiskAsyncReplication(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         primary_disk: Optional[str] = None,
                         secondary_disk: Optional[DiskAsyncReplicationSecondaryDiskArgs] = None)
@overload
def DiskAsyncReplication(resource_name: str,
                         args: DiskAsyncReplicationArgs,
                         opts: Optional[ResourceOptions] = None)
func NewDiskAsyncReplication(ctx *Context, name string, args DiskAsyncReplicationArgs, opts ...ResourceOption) (*DiskAsyncReplication, error)
public DiskAsyncReplication(string name, DiskAsyncReplicationArgs args, CustomResourceOptions? opts = null)
public DiskAsyncReplication(String name, DiskAsyncReplicationArgs args)
public DiskAsyncReplication(String name, DiskAsyncReplicationArgs args, CustomResourceOptions options)
type: gcp:compute:DiskAsyncReplication
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DiskAsyncReplicationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DiskAsyncReplicationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DiskAsyncReplicationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DiskAsyncReplicationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DiskAsyncReplicationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DiskAsyncReplication Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The DiskAsyncReplication resource accepts the following input properties:

PrimaryDisk string

The primary disk (source of replication).

SecondaryDisk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

PrimaryDisk string

The primary disk (source of replication).

SecondaryDisk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

primaryDisk String

The primary disk (source of replication).

secondaryDisk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

primaryDisk string

The primary disk (source of replication).

secondaryDisk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

primary_disk str

The primary disk (source of replication).

secondary_disk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

primaryDisk String

The primary disk (source of replication).

secondaryDisk Property Map

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

Outputs

All input properties are implicitly available as output properties. Additionally, the DiskAsyncReplication resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing DiskAsyncReplication Resource

Get an existing DiskAsyncReplication resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DiskAsyncReplicationState, opts?: CustomResourceOptions): DiskAsyncReplication
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        primary_disk: Optional[str] = None,
        secondary_disk: Optional[DiskAsyncReplicationSecondaryDiskArgs] = None) -> DiskAsyncReplication
func GetDiskAsyncReplication(ctx *Context, name string, id IDInput, state *DiskAsyncReplicationState, opts ...ResourceOption) (*DiskAsyncReplication, error)
public static DiskAsyncReplication Get(string name, Input<string> id, DiskAsyncReplicationState? state, CustomResourceOptions? opts = null)
public static DiskAsyncReplication get(String name, Output<String> id, DiskAsyncReplicationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
PrimaryDisk string

The primary disk (source of replication).

SecondaryDisk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

PrimaryDisk string

The primary disk (source of replication).

SecondaryDisk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

primaryDisk String

The primary disk (source of replication).

secondaryDisk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

primaryDisk string

The primary disk (source of replication).

secondaryDisk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

primary_disk str

The primary disk (source of replication).

secondary_disk DiskAsyncReplicationSecondaryDiskArgs

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

primaryDisk String

The primary disk (source of replication).

secondaryDisk Property Map

The secondary disk (target of replication). You can specify only one value. Structure is documented below.

The secondary_disk block includes:

Supporting Types

DiskAsyncReplicationSecondaryDisk

Disk string

The secondary disk.

State string

Output-only. Status of replication on the secondary disk.


Disk string

The secondary disk.

State string

Output-only. Status of replication on the secondary disk.


disk String

The secondary disk.

state String

Output-only. Status of replication on the secondary disk.


disk string

The secondary disk.

state string

Output-only. Status of replication on the secondary disk.


disk str

The secondary disk.

state str

Output-only. Status of replication on the secondary disk.


disk String

The secondary disk.

state String

Output-only. Status of replication on the secondary disk.


Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.