1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package neptune
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/neptune/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Creates a new DB instance.
15func (c *Client) CreateDBInstance(ctx context.Context, params *CreateDBInstanceInput, optFns ...func(*Options)) (*CreateDBInstanceOutput, error) {
16	if params == nil {
17		params = &CreateDBInstanceInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "CreateDBInstance", params, optFns, addOperationCreateDBInstanceMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*CreateDBInstanceOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30type CreateDBInstanceInput struct {
31
32	// The compute and memory capacity of the DB instance, for example, db.m4.large.
33	// Not all DB instance classes are available in all AWS Regions.
34	//
35	// This member is required.
36	DBInstanceClass *string
37
38	// The DB instance identifier. This parameter is stored as a lowercase string.
39	// Constraints:
40	//
41	// * Must contain from 1 to 63 letters, numbers, or hyphens.
42	//
43	// * First
44	// character must be a letter.
45	//
46	// * Cannot end with a hyphen or contain two
47	// consecutive hyphens.
48	//
49	// Example: mydbinstance
50	//
51	// This member is required.
52	DBInstanceIdentifier *string
53
54	// The name of the database engine to be used for this instance. Valid Values:
55	// neptune
56	//
57	// This member is required.
58	Engine *string
59
60	// The amount of storage (in gibibytes) to allocate for the DB instance. Type:
61	// Integer Not applicable. Neptune cluster volumes automatically grow as the amount
62	// of data in your database increases, though you are only charged for the space
63	// that you use in a Neptune cluster volume.
64	AllocatedStorage *int32
65
66	// Indicates that minor engine upgrades are applied automatically to the DB
67	// instance during the maintenance window. Default: true
68	AutoMinorVersionUpgrade *bool
69
70	// The EC2 Availability Zone that the DB instance is created in Default: A random,
71	// system-chosen Availability Zone in the endpoint's AWS Region. Example:
72	// us-east-1d Constraint: The AvailabilityZone parameter can't be specified if the
73	// MultiAZ parameter is set to true. The specified Availability Zone must be in the
74	// same AWS Region as the current endpoint.
75	AvailabilityZone *string
76
77	// The number of days for which automated backups are retained. Not applicable. The
78	// retention period for automated backups is managed by the DB cluster. For more
79	// information, see CreateDBCluster. Default: 1 Constraints:
80	//
81	// * Must be a value
82	// from 0 to 35
83	//
84	// * Cannot be set to 0 if the DB instance is a source to Read
85	// Replicas
86	BackupRetentionPeriod *int32
87
88	// (Not supported by Neptune)
89	CharacterSetName *string
90
91	// True to copy all tags from the DB instance to snapshots of the DB instance, and
92	// otherwise false. The default is false.
93	CopyTagsToSnapshot *bool
94
95	// The identifier of the DB cluster that the instance will belong to. For
96	// information on creating a DB cluster, see CreateDBCluster. Type: String
97	DBClusterIdentifier *string
98
99	// Not supported.
100	DBName *string
101
102	// The name of the DB parameter group to associate with this DB instance. If this
103	// argument is omitted, the default DBParameterGroup for the specified engine is
104	// used. Constraints:
105	//
106	// * Must be 1 to 255 letters, numbers, or hyphens.
107	//
108	// * First
109	// character must be a letter
110	//
111	// * Cannot end with a hyphen or contain two
112	// consecutive hyphens
113	DBParameterGroupName *string
114
115	// A list of DB security groups to associate with this DB instance. Default: The
116	// default DB security group for the database engine.
117	DBSecurityGroups []string
118
119	// A DB subnet group to associate with this DB instance. If there is no DB subnet
120	// group, then it is a non-VPC DB instance.
121	DBSubnetGroupName *string
122
123	// A value that indicates whether the DB instance has deletion protection enabled.
124	// The database can't be deleted when deletion protection is enabled. By default,
125	// deletion protection is disabled. See Deleting a DB Instance
126	// (https://docs.aws.amazon.com/neptune/latest/userguide/manage-console-instances-delete.html).
127	// DB instances in a DB cluster can be deleted even when deletion protection is
128	// enabled in their parent DB cluster.
129	DeletionProtection *bool
130
131	// Specify the Active Directory Domain to create the instance in.
132	Domain *string
133
134	// Specify the name of the IAM role to be used when making API calls to the
135	// Directory Service.
136	DomainIAMRoleName *string
137
138	// The list of log types that need to be enabled for exporting to CloudWatch Logs.
139	EnableCloudwatchLogsExports []string
140
141	// True to enable AWS Identity and Access Management (IAM) authentication for
142	// Neptune. Default: false
143	EnableIAMDatabaseAuthentication *bool
144
145	// (Not supported by Neptune)
146	EnablePerformanceInsights *bool
147
148	// The version number of the database engine to use. Currently, setting this
149	// parameter has no effect.
150	EngineVersion *string
151
152	// The amount of Provisioned IOPS (input/output operations per second) to be
153	// initially allocated for the DB instance.
154	Iops *int32
155
156	// The AWS KMS key identifier for an encrypted DB instance. The KMS key identifier
157	// is the Amazon Resource Name (ARN) for the KMS encryption key. If you are
158	// creating a DB instance with the same AWS account that owns the KMS encryption
159	// key used to encrypt the new DB instance, then you can use the KMS key alias
160	// instead of the ARN for the KM encryption key. Not applicable. The KMS key
161	// identifier is managed by the DB cluster. For more information, see
162	// CreateDBCluster. If the StorageEncrypted parameter is true, and you do not
163	// specify a value for the KmsKeyId parameter, then Amazon Neptune will use your
164	// default encryption key. AWS KMS creates the default encryption key for your AWS
165	// account. Your AWS account has a different default encryption key for each AWS
166	// Region.
167	KmsKeyId *string
168
169	// License model information for this DB instance. Valid values: license-included |
170	// bring-your-own-license | general-public-license
171	LicenseModel *string
172
173	// The password for the master user. The password can include any printable ASCII
174	// character except "/", """, or "@". Not used.
175	MasterUserPassword *string
176
177	// The name for the master user. Not used.
178	MasterUsername *string
179
180	// The interval, in seconds, between points when Enhanced Monitoring metrics are
181	// collected for the DB instance. To disable collecting Enhanced Monitoring
182	// metrics, specify 0. The default is 0. If MonitoringRoleArn is specified, then
183	// you must also set MonitoringInterval to a value other than 0. Valid Values: 0,
184	// 1, 5, 10, 15, 30, 60
185	MonitoringInterval *int32
186
187	// The ARN for the IAM role that permits Neptune to send enhanced monitoring
188	// metrics to Amazon CloudWatch Logs. For example,
189	// arn:aws:iam:123456789012:role/emaccess. If MonitoringInterval is set to a value
190	// other than 0, then you must supply a MonitoringRoleArn value.
191	MonitoringRoleArn *string
192
193	// Specifies if the DB instance is a Multi-AZ deployment. You can't set the
194	// AvailabilityZone parameter if the MultiAZ parameter is set to true.
195	MultiAZ *bool
196
197	// (Not supported by Neptune)
198	OptionGroupName *string
199
200	// (Not supported by Neptune)
201	PerformanceInsightsKMSKeyId *string
202
203	// The port number on which the database accepts connections. Not applicable. The
204	// port is managed by the DB cluster. For more information, see CreateDBCluster.
205	// Default: 8182 Type: Integer
206	Port *int32
207
208	// The daily time range during which automated backups are created. Not applicable.
209	// The daily time range for creating automated backups is managed by the DB
210	// cluster. For more information, see CreateDBCluster.
211	PreferredBackupWindow *string
212
213	// The time range each week during which system maintenance can occur, in Universal
214	// Coordinated Time (UTC). Format: ddd:hh24:mi-ddd:hh24:mi The default is a
215	// 30-minute window selected at random from an 8-hour block of time for each AWS
216	// Region, occurring on a random day of the week. Valid Days: Mon, Tue, Wed, Thu,
217	// Fri, Sat, Sun. Constraints: Minimum 30-minute window.
218	PreferredMaintenanceWindow *string
219
220	// A value that specifies the order in which an Read Replica is promoted to the
221	// primary instance after a failure of the existing primary instance. Default: 1
222	// Valid Values: 0 - 15
223	PromotionTier *int32
224
225	// This flag should no longer be used.
226	//
227	// Deprecated: This member has been deprecated.
228	PubliclyAccessible *bool
229
230	// Specifies whether the DB instance is encrypted. Not applicable. The encryption
231	// for DB instances is managed by the DB cluster. For more information, see
232	// CreateDBCluster. Default: false
233	StorageEncrypted *bool
234
235	// Specifies the storage type to be associated with the DB instance. Not
236	// applicable. Storage is managed by the DB Cluster.
237	StorageType *string
238
239	// The tags to assign to the new instance.
240	Tags []types.Tag
241
242	// The ARN from the key store with which to associate the instance for TDE
243	// encryption.
244	TdeCredentialArn *string
245
246	// The password for the given ARN from the key store in order to access the device.
247	TdeCredentialPassword *string
248
249	// The time zone of the DB instance.
250	Timezone *string
251
252	// A list of EC2 VPC security groups to associate with this DB instance. Not
253	// applicable. The associated list of EC2 VPC security groups is managed by the DB
254	// cluster. For more information, see CreateDBCluster. Default: The default EC2 VPC
255	// security group for the DB subnet group's VPC.
256	VpcSecurityGroupIds []string
257}
258
259type CreateDBInstanceOutput struct {
260
261	// Contains the details of an Amazon Neptune DB instance. This data type is used as
262	// a response element in the DescribeDBInstances action.
263	DBInstance *types.DBInstance
264
265	// Metadata pertaining to the operation's result.
266	ResultMetadata middleware.Metadata
267}
268
269func addOperationCreateDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {
270	err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBInstance{}, middleware.After)
271	if err != nil {
272		return err
273	}
274	err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBInstance{}, middleware.After)
275	if err != nil {
276		return err
277	}
278	if err = addSetLoggerMiddleware(stack, options); err != nil {
279		return err
280	}
281	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
282		return err
283	}
284	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
285		return err
286	}
287	if err = addResolveEndpointMiddleware(stack, options); err != nil {
288		return err
289	}
290	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
291		return err
292	}
293	if err = addRetryMiddlewares(stack, options); err != nil {
294		return err
295	}
296	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
297		return err
298	}
299	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
300		return err
301	}
302	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
303		return err
304	}
305	if err = addClientUserAgent(stack); err != nil {
306		return err
307	}
308	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
309		return err
310	}
311	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
312		return err
313	}
314	if err = addOpCreateDBInstanceValidationMiddleware(stack); err != nil {
315		return err
316	}
317	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBInstance(options.Region), middleware.Before); err != nil {
318		return err
319	}
320	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
321		return err
322	}
323	if err = addResponseErrorMiddleware(stack); err != nil {
324		return err
325	}
326	if err = addRequestResponseLogging(stack, options); err != nil {
327		return err
328	}
329	return nil
330}
331
332func newServiceMetadataMiddleware_opCreateDBInstance(region string) *awsmiddleware.RegisterServiceMetadata {
333	return &awsmiddleware.RegisterServiceMetadata{
334		Region:        region,
335		ServiceID:     ServiceID,
336		SigningName:   "rds",
337		OperationName: "CreateDBInstance",
338	}
339}
340