/
getReplicationRecoveryPlan.go
170 lines (148 loc) · 6.76 KB
/
getReplicationRecoveryPlan.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package siterecovery
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information about an Azure Site Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// vault, err := recoveryservices.LookupVault(ctx, &recoveryservices.LookupVaultArgs{
// Name: "tfex-recovery_vault",
// ResourceGroupName: "tfex-resource_group",
// }, nil)
// if err != nil {
// return err
// }
// _, err = siterecovery.LookupReplicationRecoveryPlan(ctx, &siterecovery.LookupReplicationRecoveryPlanArgs{
// Name: "example-recovery-plan",
// RecoveryVaultId: vault.Id,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupReplicationRecoveryPlan(ctx *pulumi.Context, args *LookupReplicationRecoveryPlanArgs, opts ...pulumi.InvokeOption) (*LookupReplicationRecoveryPlanResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupReplicationRecoveryPlanResult
err := ctx.Invoke("azure:siterecovery/getReplicationRecoveryPlan:getReplicationRecoveryPlan", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getReplicationRecoveryPlan.
type LookupReplicationRecoveryPlanArgs struct {
// The name of the Replication Plan.
Name string `pulumi:"name"`
// The ID of the vault that should be updated.
RecoveryVaultId string `pulumi:"recoveryVaultId"`
}
// A collection of values returned by getReplicationRecoveryPlan.
type LookupReplicationRecoveryPlanResult struct {
AzureToAzureSettings []GetReplicationRecoveryPlanAzureToAzureSetting `pulumi:"azureToAzureSettings"`
FailoverDeploymentModel string `pulumi:"failoverDeploymentModel"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Name of the Action.
Name string `pulumi:"name"`
// `recoveryGroup` block defined as below.
// ---
RecoveryGroups []GetReplicationRecoveryPlanRecoveryGroup `pulumi:"recoveryGroups"`
RecoveryVaultId string `pulumi:"recoveryVaultId"`
// The ID of source fabric to be recovered from.
SourceRecoveryFabricId string `pulumi:"sourceRecoveryFabricId"`
// The ID of target fabric to recover.
TargetRecoveryFabricId string `pulumi:"targetRecoveryFabricId"`
}
func LookupReplicationRecoveryPlanOutput(ctx *pulumi.Context, args LookupReplicationRecoveryPlanOutputArgs, opts ...pulumi.InvokeOption) LookupReplicationRecoveryPlanResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupReplicationRecoveryPlanResult, error) {
args := v.(LookupReplicationRecoveryPlanArgs)
r, err := LookupReplicationRecoveryPlan(ctx, &args, opts...)
var s LookupReplicationRecoveryPlanResult
if r != nil {
s = *r
}
return s, err
}).(LookupReplicationRecoveryPlanResultOutput)
}
// A collection of arguments for invoking getReplicationRecoveryPlan.
type LookupReplicationRecoveryPlanOutputArgs struct {
// The name of the Replication Plan.
Name pulumi.StringInput `pulumi:"name"`
// The ID of the vault that should be updated.
RecoveryVaultId pulumi.StringInput `pulumi:"recoveryVaultId"`
}
func (LookupReplicationRecoveryPlanOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupReplicationRecoveryPlanArgs)(nil)).Elem()
}
// A collection of values returned by getReplicationRecoveryPlan.
type LookupReplicationRecoveryPlanResultOutput struct{ *pulumi.OutputState }
func (LookupReplicationRecoveryPlanResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupReplicationRecoveryPlanResult)(nil)).Elem()
}
func (o LookupReplicationRecoveryPlanResultOutput) ToLookupReplicationRecoveryPlanResultOutput() LookupReplicationRecoveryPlanResultOutput {
return o
}
func (o LookupReplicationRecoveryPlanResultOutput) ToLookupReplicationRecoveryPlanResultOutputWithContext(ctx context.Context) LookupReplicationRecoveryPlanResultOutput {
return o
}
func (o LookupReplicationRecoveryPlanResultOutput) AzureToAzureSettings() GetReplicationRecoveryPlanAzureToAzureSettingArrayOutput {
return o.ApplyT(func(v LookupReplicationRecoveryPlanResult) []GetReplicationRecoveryPlanAzureToAzureSetting {
return v.AzureToAzureSettings
}).(GetReplicationRecoveryPlanAzureToAzureSettingArrayOutput)
}
func (o LookupReplicationRecoveryPlanResultOutput) FailoverDeploymentModel() pulumi.StringOutput {
return o.ApplyT(func(v LookupReplicationRecoveryPlanResult) string { return v.FailoverDeploymentModel }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupReplicationRecoveryPlanResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupReplicationRecoveryPlanResult) string { return v.Id }).(pulumi.StringOutput)
}
// Name of the Action.
func (o LookupReplicationRecoveryPlanResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupReplicationRecoveryPlanResult) string { return v.Name }).(pulumi.StringOutput)
}
// `recoveryGroup` block defined as below.
// ---
func (o LookupReplicationRecoveryPlanResultOutput) RecoveryGroups() GetReplicationRecoveryPlanRecoveryGroupArrayOutput {
return o.ApplyT(func(v LookupReplicationRecoveryPlanResult) []GetReplicationRecoveryPlanRecoveryGroup {
return v.RecoveryGroups
}).(GetReplicationRecoveryPlanRecoveryGroupArrayOutput)
}
func (o LookupReplicationRecoveryPlanResultOutput) RecoveryVaultId() pulumi.StringOutput {
return o.ApplyT(func(v LookupReplicationRecoveryPlanResult) string { return v.RecoveryVaultId }).(pulumi.StringOutput)
}
// The ID of source fabric to be recovered from.
func (o LookupReplicationRecoveryPlanResultOutput) SourceRecoveryFabricId() pulumi.StringOutput {
return o.ApplyT(func(v LookupReplicationRecoveryPlanResult) string { return v.SourceRecoveryFabricId }).(pulumi.StringOutput)
}
// The ID of target fabric to recover.
func (o LookupReplicationRecoveryPlanResultOutput) TargetRecoveryFabricId() pulumi.StringOutput {
return o.ApplyT(func(v LookupReplicationRecoveryPlanResult) string { return v.TargetRecoveryFabricId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupReplicationRecoveryPlanResultOutput{})
}