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
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,
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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{
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
}
_, 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(),
},
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
})
}
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 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()
.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}
Create DiskAsyncReplication Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DiskAsyncReplication(name: string, args: DiskAsyncReplicationArgs, opts?: CustomResourceOptions);
@overload
def DiskAsyncReplication(resource_name: str,
args: DiskAsyncReplicationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DiskAsyncReplication(resource_name: str,
opts: Optional[ResourceOptions] = None,
primary_disk: Optional[str] = None,
secondary_disk: Optional[DiskAsyncReplicationSecondaryDiskArgs] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var diskAsyncReplicationResource = new Gcp.Compute.DiskAsyncReplication("diskAsyncReplicationResource", new()
{
PrimaryDisk = "string",
SecondaryDisk = new Gcp.Compute.Inputs.DiskAsyncReplicationSecondaryDiskArgs
{
Disk = "string",
State = "string",
},
});
example, err := compute.NewDiskAsyncReplication(ctx, "diskAsyncReplicationResource", &compute.DiskAsyncReplicationArgs{
PrimaryDisk: pulumi.String("string"),
SecondaryDisk: &compute.DiskAsyncReplicationSecondaryDiskArgs{
Disk: pulumi.String("string"),
State: pulumi.String("string"),
},
})
var diskAsyncReplicationResource = new DiskAsyncReplication("diskAsyncReplicationResource", DiskAsyncReplicationArgs.builder()
.primaryDisk("string")
.secondaryDisk(DiskAsyncReplicationSecondaryDiskArgs.builder()
.disk("string")
.state("string")
.build())
.build());
disk_async_replication_resource = gcp.compute.DiskAsyncReplication("diskAsyncReplicationResource",
primary_disk="string",
secondary_disk={
"disk": "string",
"state": "string",
})
const diskAsyncReplicationResource = new gcp.compute.DiskAsyncReplication("diskAsyncReplicationResource", {
primaryDisk: "string",
secondaryDisk: {
disk: "string",
state: "string",
},
});
type: gcp:compute:DiskAsyncReplication
properties:
primaryDisk: string
secondaryDisk:
disk: string
state: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The DiskAsyncReplication resource accepts the following input properties:
- Primary
Disk string - The primary disk (source of replication).
- Secondary
Disk DiskAsync Replication Secondary Disk The secondary disk (target of replication). You can specify only one value. Structure is documented below.
The
secondary_disk
block includes:
- Primary
Disk string - The primary disk (source of replication).
- Secondary
Disk DiskAsync Replication Secondary Disk Args The secondary disk (target of replication). You can specify only one value. Structure is documented below.
The
secondary_disk
block includes:
- primary
Disk String - The primary disk (source of replication).
- secondary
Disk DiskAsync Replication Secondary Disk The secondary disk (target of replication). You can specify only one value. Structure is documented below.
The
secondary_disk
block includes:
- primary
Disk string - The primary disk (source of replication).
- secondary
Disk DiskAsync Replication Secondary Disk 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 DiskAsync Replication Secondary Disk Args The secondary disk (target of replication). You can specify only one value. Structure is documented below.
The
secondary_disk
block includes:
- primary
Disk String - The primary disk (source of replication).
- secondary
Disk 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.
- Primary
Disk string - The primary disk (source of replication).
- Secondary
Disk DiskAsync Replication Secondary Disk The secondary disk (target of replication). You can specify only one value. Structure is documented below.
The
secondary_disk
block includes:
- Primary
Disk string - The primary disk (source of replication).
- Secondary
Disk DiskAsync Replication Secondary Disk Args The secondary disk (target of replication). You can specify only one value. Structure is documented below.
The
secondary_disk
block includes:
- primary
Disk String - The primary disk (source of replication).
- secondary
Disk DiskAsync Replication Secondary Disk The secondary disk (target of replication). You can specify only one value. Structure is documented below.
The
secondary_disk
block includes:
- primary
Disk string - The primary disk (source of replication).
- secondary
Disk DiskAsync Replication Secondary Disk 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 DiskAsync Replication Secondary Disk Args The secondary disk (target of replication). You can specify only one value. Structure is documented below.
The
secondary_disk
block includes:
- primary
Disk String - The primary disk (source of replication).
- secondary
Disk 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, DiskAsyncReplicationSecondaryDiskArgs
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.