/
globalCluster.ts
225 lines (216 loc) · 10.1 KB
/
globalCluster.ts
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as utilities from "../utilities";
/**
* Manages an RDS Global Cluster, which is an Aurora global database spread across multiple regions. The global database contains a single primary cluster with read-write capability, and a read-only secondary cluster that receives data from the primary cluster through high-speed replication performed by the Aurora storage subsystem.
*
* More information about Aurora global databases can be found in the [Aurora User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database-creating).
*
* ## Example Usage
*
*
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const primary = new aws.Provider("primary", {
* region: "us-east-2",
* });
* const secondary = new aws.Provider("secondary", {
* region: "us-west-2",
* });
* const example = new aws.rds.GlobalCluster("example", {
* globalClusterIdentifier: "example",
* }, { provider: primary });
* const primaryCluster = new aws.rds.Cluster("primary", {
* // ... other configuration ...
* engineMode: "global",
* globalClusterIdentifier: example.id,
* }, { provider: primary });
* const primaryClusterInstance = new aws.rds.ClusterInstance("primary", {
* // ... other configuration ...
* clusterIdentifier: primaryCluster.id,
* }, { provider: primary });
* const secondaryCluster = new aws.rds.Cluster("secondary", {
* // ... other configuration ...
* engineMode: "global",
* globalClusterIdentifier: example.id,
* }, { provider: secondary, dependsOn: [primaryClusterInstance] });
* const secondaryClusterInstance = new aws.rds.ClusterInstance("secondary", {
* // ... other configuration ...
* clusterIdentifier: secondaryCluster.id,
* }, { provider: secondary });
* ```
*/
export class GlobalCluster extends pulumi.CustomResource {
/**
* Get an existing GlobalCluster resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: GlobalClusterState, opts?: pulumi.CustomResourceOptions): GlobalCluster {
return new GlobalCluster(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'aws:rds/globalCluster:GlobalCluster';
/**
* Returns true if the given object is an instance of GlobalCluster. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is GlobalCluster {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === GlobalCluster.__pulumiType;
}
/**
* RDS Global Cluster Amazon Resource Name (ARN)
*/
public /*out*/ readonly arn!: pulumi.Output<string>;
/**
* Name for an automatically created database on cluster creation.
*/
public readonly databaseName!: pulumi.Output<string | undefined>;
/**
* If the Global Cluster should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`.
*/
public readonly deletionProtection!: pulumi.Output<boolean | undefined>;
/**
* Name of the database engine to be used for this DB cluster. Valid values: `aurora`, `aurora-mysql`, `aurora-postgresql`. Defaults to `aurora`.
*/
public readonly engine!: pulumi.Output<string | undefined>;
/**
* Engine version of the Aurora global database.
* * **NOTE:** When the engine is set to `aurora-mysql`, an engine version compatible with global database is required. The earliest available version is `5.7.mysql_aurora.2.06.0`.
*/
public readonly engineVersion!: pulumi.Output<string>;
/**
* The global cluster identifier.
*/
public readonly globalClusterIdentifier!: pulumi.Output<string>;
/**
* AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
*/
public /*out*/ readonly globalClusterResourceId!: pulumi.Output<string>;
/**
* Specifies whether the DB cluster is encrypted. The default is `false`.
*/
public readonly storageEncrypted!: pulumi.Output<boolean | undefined>;
/**
* Create a GlobalCluster resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: GlobalClusterArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: GlobalClusterArgs | GlobalClusterState, opts?: pulumi.CustomResourceOptions) {
let inputs: pulumi.Inputs = {};
if (opts && opts.id) {
const state = argsOrState as GlobalClusterState | undefined;
inputs["arn"] = state ? state.arn : undefined;
inputs["databaseName"] = state ? state.databaseName : undefined;
inputs["deletionProtection"] = state ? state.deletionProtection : undefined;
inputs["engine"] = state ? state.engine : undefined;
inputs["engineVersion"] = state ? state.engineVersion : undefined;
inputs["globalClusterIdentifier"] = state ? state.globalClusterIdentifier : undefined;
inputs["globalClusterResourceId"] = state ? state.globalClusterResourceId : undefined;
inputs["storageEncrypted"] = state ? state.storageEncrypted : undefined;
} else {
const args = argsOrState as GlobalClusterArgs | undefined;
if (!args || args.globalClusterIdentifier === undefined) {
throw new Error("Missing required property 'globalClusterIdentifier'");
}
inputs["databaseName"] = args ? args.databaseName : undefined;
inputs["deletionProtection"] = args ? args.deletionProtection : undefined;
inputs["engine"] = args ? args.engine : undefined;
inputs["engineVersion"] = args ? args.engineVersion : undefined;
inputs["globalClusterIdentifier"] = args ? args.globalClusterIdentifier : undefined;
inputs["storageEncrypted"] = args ? args.storageEncrypted : undefined;
inputs["arn"] = undefined /*out*/;
inputs["globalClusterResourceId"] = undefined /*out*/;
}
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
super(GlobalCluster.__pulumiType, name, inputs, opts);
}
}
/**
* Input properties used for looking up and filtering GlobalCluster resources.
*/
export interface GlobalClusterState {
/**
* RDS Global Cluster Amazon Resource Name (ARN)
*/
readonly arn?: pulumi.Input<string>;
/**
* Name for an automatically created database on cluster creation.
*/
readonly databaseName?: pulumi.Input<string>;
/**
* If the Global Cluster should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`.
*/
readonly deletionProtection?: pulumi.Input<boolean>;
/**
* Name of the database engine to be used for this DB cluster. Valid values: `aurora`, `aurora-mysql`, `aurora-postgresql`. Defaults to `aurora`.
*/
readonly engine?: pulumi.Input<string>;
/**
* Engine version of the Aurora global database.
* * **NOTE:** When the engine is set to `aurora-mysql`, an engine version compatible with global database is required. The earliest available version is `5.7.mysql_aurora.2.06.0`.
*/
readonly engineVersion?: pulumi.Input<string>;
/**
* The global cluster identifier.
*/
readonly globalClusterIdentifier?: pulumi.Input<string>;
/**
* AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
*/
readonly globalClusterResourceId?: pulumi.Input<string>;
/**
* Specifies whether the DB cluster is encrypted. The default is `false`.
*/
readonly storageEncrypted?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a GlobalCluster resource.
*/
export interface GlobalClusterArgs {
/**
* Name for an automatically created database on cluster creation.
*/
readonly databaseName?: pulumi.Input<string>;
/**
* If the Global Cluster should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`.
*/
readonly deletionProtection?: pulumi.Input<boolean>;
/**
* Name of the database engine to be used for this DB cluster. Valid values: `aurora`, `aurora-mysql`, `aurora-postgresql`. Defaults to `aurora`.
*/
readonly engine?: pulumi.Input<string>;
/**
* Engine version of the Aurora global database.
* * **NOTE:** When the engine is set to `aurora-mysql`, an engine version compatible with global database is required. The earliest available version is `5.7.mysql_aurora.2.06.0`.
*/
readonly engineVersion?: pulumi.Input<string>;
/**
* The global cluster identifier.
*/
readonly globalClusterIdentifier: pulumi.Input<string>;
/**
* Specifies whether the DB cluster is encrypted. The default is `false`.
*/
readonly storageEncrypted?: pulumi.Input<boolean>;
}