/******************************************************************************* * Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * ***************************************************************************** * * AWS Tools for Windows (TM) PowerShell (TM) * */ using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Text; using Amazon.PowerShell.Common; using Amazon.Runtime; using Amazon.Neptune; using Amazon.Neptune.Model; namespace Amazon.PowerShell.Cmdlets.NPT { /// /// Creates a new DB instance. /// [Cmdlet("New", "NPTDBInstance", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType("Amazon.Neptune.Model.DBInstance")] [AWSCmdlet("Calls the Amazon Neptune CreateDBInstance API operation.", Operation = new[] {"CreateDBInstance"}, SelectReturnType = typeof(Amazon.Neptune.Model.CreateDBInstanceResponse))] [AWSCmdletOutput("Amazon.Neptune.Model.DBInstance or Amazon.Neptune.Model.CreateDBInstanceResponse", "This cmdlet returns an Amazon.Neptune.Model.DBInstance object.", "The service call response (type Amazon.Neptune.Model.CreateDBInstanceResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack." )] public partial class NewNPTDBInstanceCmdlet : AmazonNeptuneClientCmdlet, IExecutor { #region Parameter AllocatedStorage /// /// /// Not supported by Neptune. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? AllocatedStorage { get; set; } #endregion #region Parameter AutoMinorVersionUpgrade /// /// /// Indicates that minor engine upgrades are applied automatically to the DB instance /// during the maintenance window.Default: true /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? AutoMinorVersionUpgrade { get; set; } #endregion #region Parameter AvailabilityZone /// /// /// The EC2 Availability Zone that the DB instance is created inDefault: A random, system-chosen Availability Zone in the endpoint's Amazon Region. Example: us-east-1d Constraint: The AvailabilityZone parameter can't be specified if the MultiAZ parameter /// is set to true. The specified Availability Zone must be in the same Amazon /// Region as the current endpoint. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String AvailabilityZone { get; set; } #endregion #region Parameter BackupRetentionPeriod /// /// /// The number of days for which automated backups are retained.Not applicable. The retention period for automated backups is managed by the DB cluster. /// For more information, see CreateDBCluster.Default: 1Constraints: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? BackupRetentionPeriod { get; set; } #endregion #region Parameter CharacterSetName /// /// /// (Not supported by Neptune) /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String CharacterSetName { get; set; } #endregion #region Parameter CopyTagsToSnapshot /// /// /// True to copy all tags from the DB instance to snapshots of the DB instance, and otherwise /// false. The default is false. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? CopyTagsToSnapshot { get; set; } #endregion #region Parameter DBClusterIdentifier /// /// /// The identifier of the DB cluster that the instance will belong to.For information on creating a DB cluster, see CreateDBCluster.Type: String /// /// #if !MODULAR [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] #else [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] [System.Management.Automation.AllowEmptyString] [System.Management.Automation.AllowNull] #endif [Amazon.PowerShell.Common.AWSRequiredParameter] public System.String DBClusterIdentifier { get; set; } #endregion #region Parameter DBInstanceClass /// /// /// The compute and memory capacity of the DB instance, for example, db.m4.large. /// Not all DB instance classes are available in all Amazon Regions. /// /// #if !MODULAR [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] #else [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] [System.Management.Automation.AllowEmptyString] [System.Management.Automation.AllowNull] #endif [Amazon.PowerShell.Common.AWSRequiredParameter] public System.String DBInstanceClass { get; set; } #endregion #region Parameter DBInstanceIdentifier /// /// /// The DB instance identifier. This parameter is stored as a lowercase string.Constraints:Example: mydbinstance /// /// #if !MODULAR [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)] #else [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)] [System.Management.Automation.AllowEmptyString] [System.Management.Automation.AllowNull] #endif [Amazon.PowerShell.Common.AWSRequiredParameter] public System.String DBInstanceIdentifier { get; set; } #endregion #region Parameter DBName /// /// /// Not supported. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DBName { get; set; } #endregion #region Parameter DBParameterGroupName /// /// /// The name of the DB parameter group to associate with this DB instance. If this argument /// is omitted, the default DBParameterGroup for the specified engine is used.Constraints: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DBParameterGroupName { get; set; } #endregion #region Parameter DBSecurityGroup /// /// /// A list of DB security groups to associate with this DB instance.Default: The default DB security group for the database engine. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("DBSecurityGroups")] public System.String[] DBSecurityGroup { get; set; } #endregion #region Parameter DBSubnetGroupName /// /// /// A DB subnet group to associate with this DB instance.If there is no DB subnet group, then it is a non-VPC DB instance. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DBSubnetGroupName { get; set; } #endregion #region Parameter DeletionProtection /// /// /// A value that indicates whether the DB instance has deletion protection enabled. The /// database can't be deleted when deletion protection is enabled. By default, deletion /// protection is disabled. See Deleting /// a DB Instance.DB instances in a DB cluster can be deleted even when deletion protection is enabled /// in their parent DB cluster. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? DeletionProtection { get; set; } #endregion #region Parameter Domain /// /// /// Specify the Active Directory Domain to create the instance in. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Domain { get; set; } #endregion #region Parameter DomainIAMRoleName /// /// /// Specify the name of the IAM role to be used when making API calls to the Directory /// Service. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DomainIAMRoleName { get; set; } #endregion #region Parameter EnableCloudwatchLogsExport /// /// /// The list of log types that need to be enabled for exporting to CloudWatch Logs. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EnableCloudwatchLogsExports")] public System.String[] EnableCloudwatchLogsExport { get; set; } #endregion #region Parameter EnableIAMDatabaseAuthentication /// /// /// Not supported by Neptune (ignored). /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? EnableIAMDatabaseAuthentication { get; set; } #endregion #region Parameter EnablePerformanceInsight /// /// /// (Not supported by Neptune) /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EnablePerformanceInsights")] public System.Boolean? EnablePerformanceInsight { get; set; } #endregion #region Parameter Engine /// /// /// The name of the database engine to be used for this instance.Valid Values: neptune /// /// #if !MODULAR [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] #else [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] [System.Management.Automation.AllowEmptyString] [System.Management.Automation.AllowNull] #endif [Amazon.PowerShell.Common.AWSRequiredParameter] public System.String Engine { get; set; } #endregion #region Parameter EngineVersion /// /// /// The version number of the database engine to use. Currently, setting this parameter /// has no effect. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String EngineVersion { get; set; } #endregion #region Parameter Iops /// /// /// The amount of Provisioned IOPS (input/output operations per second) to be initially /// allocated for the DB instance. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? Iops { get; set; } #endregion #region Parameter KmsKeyId /// /// /// The Amazon KMS key identifier for an encrypted DB instance.The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. /// If you are creating a DB instance with the same Amazon account that owns the KMS encryption /// key used to encrypt the new DB instance, then you can use the KMS key alias instead /// of the ARN for the KM encryption key.Not applicable. The KMS key identifier is managed by the DB cluster. For more information, /// see CreateDBCluster.If the StorageEncrypted parameter is true, and you do not specify a value /// for the KmsKeyId parameter, then Amazon Neptune will use your default /// encryption key. Amazon KMS creates the default encryption key for your Amazon account. /// Your Amazon account has a different default encryption key for each Amazon Region. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String KmsKeyId { get; set; } #endregion #region Parameter LicenseModel /// /// /// License model information for this DB instance. Valid values: license-included | bring-your-own-license /// | general-public-license /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String LicenseModel { get; set; } #endregion #region Parameter MasterUsername /// /// /// Not supported by Neptune. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String MasterUsername { get; set; } #endregion #region Parameter MasterUserPassword /// /// /// Not supported by Neptune. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String MasterUserPassword { get; set; } #endregion #region Parameter MonitoringInterval /// /// /// The interval, in seconds, between points when Enhanced Monitoring metrics are collected /// for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. /// The default is 0.If MonitoringRoleArn is specified, then you must also set MonitoringInterval /// to a value other than 0.Valid Values: 0, 1, 5, 10, 15, 30, 60 /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? MonitoringInterval { get; set; } #endregion #region Parameter MonitoringRoleArn /// /// /// The ARN for the IAM role that permits Neptune to send enhanced monitoring metrics /// to Amazon CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess.If MonitoringInterval is set to a value other than 0, then you must supply /// a MonitoringRoleArn value. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String MonitoringRoleArn { get; set; } #endregion #region Parameter MultiAZ /// /// /// Specifies if the DB instance is a Multi-AZ deployment. You can't set the AvailabilityZone /// parameter if the MultiAZ parameter is set to true. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? MultiAZ { get; set; } #endregion #region Parameter OptionGroupName /// /// /// (Not supported by Neptune) /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String OptionGroupName { get; set; } #endregion #region Parameter PerformanceInsightsKMSKeyId /// /// /// (Not supported by Neptune) /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String PerformanceInsightsKMSKeyId { get; set; } #endregion #region Parameter Port /// /// /// The port number on which the database accepts connections.Not applicable. The port is managed by the DB cluster. For more information, see CreateDBCluster. Default: 8182Type: Integer /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? Port { get; set; } #endregion #region Parameter PreferredBackupWindow /// /// /// The daily time range during which automated backups are created.Not applicable. The daily time range for creating automated backups is managed by /// the DB cluster. For more information, see CreateDBCluster. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String PreferredBackupWindow { get; set; } #endregion #region Parameter PreferredMaintenanceWindow /// /// /// The time range each week during which system maintenance can occur, in Universal Coordinated /// Time (UTC). Format: ddd:hh24:mi-ddd:hh24:miThe default is a 30-minute window selected at random from an 8-hour block of time /// for each Amazon Region, occurring on a random day of the week.Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.Constraints: Minimum 30-minute window. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String PreferredMaintenanceWindow { get; set; } #endregion #region Parameter PromotionTier /// /// /// A value that specifies the order in which an Read Replica is promoted to the primary /// instance after a failure of the existing primary instance. Default: 1Valid Values: 0 - 15 /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? PromotionTier { get; set; } #endregion #region Parameter StorageEncrypted /// /// /// Specifies whether the DB instance is encrypted.Not applicable. The encryption for DB instances is managed by the DB cluster. For /// more information, see CreateDBCluster.Default: false /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? StorageEncrypted { get; set; } #endregion #region Parameter StorageType /// /// /// Specifies the storage type to be associated with the DB instance.Not applicable. Storage is managed by the DB Cluster. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String StorageType { get; set; } #endregion #region Parameter Tag /// /// /// The tags to assign to the new instance. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Tags")] public Amazon.Neptune.Model.Tag[] Tag { get; set; } #endregion #region Parameter TdeCredentialArn /// /// /// The ARN from the key store with which to associate the instance for TDE encryption. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String TdeCredentialArn { get; set; } #endregion #region Parameter TdeCredentialPassword /// /// /// The password for the given ARN from the key store in order to access the device. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String TdeCredentialPassword { get; set; } #endregion #region Parameter Timezone /// /// /// The time zone of the DB instance. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Timezone { get; set; } #endregion #region Parameter VpcSecurityGroupId /// /// /// A list of EC2 VPC security groups to associate with this DB instance.Not applicable. The associated list of EC2 VPC security groups is managed by the DB /// cluster. For more information, see CreateDBCluster.Default: The default EC2 VPC security group for the DB subnet group's VPC. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("VpcSecurityGroupIds")] public System.String[] VpcSecurityGroupId { get; set; } #endregion #region Parameter PubliclyAccessible /// /// /// This flag should no longer be used. /// /// This parameter is deprecated. /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [System.ObsoleteAttribute("This parameter is not supported")] public System.Boolean? PubliclyAccessible { get; set; } #endregion #region Parameter Select /// /// Use the -Select parameter to control the cmdlet output. The default value is 'DBInstance'. /// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.Neptune.Model.CreateDBInstanceResponse). /// Specifying the name of a property of type Amazon.Neptune.Model.CreateDBInstanceResponse will result in that property being returned. /// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value. /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public string Select { get; set; } = "DBInstance"; #endregion #region Parameter PassThru /// /// Changes the cmdlet behavior to return the value passed to the DBInstanceIdentifier parameter. /// The -PassThru parameter is deprecated, use -Select '^DBInstanceIdentifier' instead. This parameter will be removed in a future version. /// [System.Obsolete("The -PassThru parameter is deprecated, use -Select '^DBInstanceIdentifier' instead. This parameter will be removed in a future version.")] [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter PassThru { get; set; } #endregion #region Parameter Force /// /// This parameter overrides confirmation prompts to force /// the cmdlet to continue its operation. This parameter should always /// be used with caution. /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter Force { get; set; } #endregion protected override void ProcessRecord() { this._AWSSignerType = "v4"; base.ProcessRecord(); var resourceIdentifiersText = FormatParameterValuesForConfirmationMsg(nameof(this.DBInstanceIdentifier), MyInvocation.BoundParameters); if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "New-NPTDBInstance (CreateDBInstance)")) { return; } var context = new CmdletContext(); // allow for manipulation of parameters prior to loading into context PreExecutionContextLoad(context); #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute if (ParameterWasBound(nameof(this.Select))) { context.Select = CreateSelectDelegate(Select) ?? throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select)); if (this.PassThru.IsPresent) { throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select)); } } else if (this.PassThru.IsPresent) { context.Select = (response, cmdlet) => this.DBInstanceIdentifier; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute context.AllocatedStorage = this.AllocatedStorage; context.AutoMinorVersionUpgrade = this.AutoMinorVersionUpgrade; context.AvailabilityZone = this.AvailabilityZone; context.BackupRetentionPeriod = this.BackupRetentionPeriod; context.CharacterSetName = this.CharacterSetName; context.CopyTagsToSnapshot = this.CopyTagsToSnapshot; context.DBClusterIdentifier = this.DBClusterIdentifier; #if MODULAR if (this.DBClusterIdentifier == null && ParameterWasBound(nameof(this.DBClusterIdentifier))) { WriteWarning("You are passing $null as a value for parameter DBClusterIdentifier which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues."); } #endif context.DBInstanceClass = this.DBInstanceClass; #if MODULAR if (this.DBInstanceClass == null && ParameterWasBound(nameof(this.DBInstanceClass))) { WriteWarning("You are passing $null as a value for parameter DBInstanceClass which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues."); } #endif context.DBInstanceIdentifier = this.DBInstanceIdentifier; #if MODULAR if (this.DBInstanceIdentifier == null && ParameterWasBound(nameof(this.DBInstanceIdentifier))) { WriteWarning("You are passing $null as a value for parameter DBInstanceIdentifier which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues."); } #endif context.DBName = this.DBName; context.DBParameterGroupName = this.DBParameterGroupName; if (this.DBSecurityGroup != null) { context.DBSecurityGroup = new List(this.DBSecurityGroup); } context.DBSubnetGroupName = this.DBSubnetGroupName; context.DeletionProtection = this.DeletionProtection; context.Domain = this.Domain; context.DomainIAMRoleName = this.DomainIAMRoleName; if (this.EnableCloudwatchLogsExport != null) { context.EnableCloudwatchLogsExport = new List(this.EnableCloudwatchLogsExport); } context.EnableIAMDatabaseAuthentication = this.EnableIAMDatabaseAuthentication; context.EnablePerformanceInsight = this.EnablePerformanceInsight; context.Engine = this.Engine; #if MODULAR if (this.Engine == null && ParameterWasBound(nameof(this.Engine))) { WriteWarning("You are passing $null as a value for parameter Engine which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues."); } #endif context.EngineVersion = this.EngineVersion; context.Iops = this.Iops; context.KmsKeyId = this.KmsKeyId; context.LicenseModel = this.LicenseModel; context.MasterUsername = this.MasterUsername; context.MasterUserPassword = this.MasterUserPassword; context.MonitoringInterval = this.MonitoringInterval; context.MonitoringRoleArn = this.MonitoringRoleArn; context.MultiAZ = this.MultiAZ; context.OptionGroupName = this.OptionGroupName; context.PerformanceInsightsKMSKeyId = this.PerformanceInsightsKMSKeyId; context.Port = this.Port; context.PreferredBackupWindow = this.PreferredBackupWindow; context.PreferredMaintenanceWindow = this.PreferredMaintenanceWindow; context.PromotionTier = this.PromotionTier; #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute context.PubliclyAccessible = this.PubliclyAccessible; #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute context.StorageEncrypted = this.StorageEncrypted; context.StorageType = this.StorageType; if (this.Tag != null) { context.Tag = new List(this.Tag); } context.TdeCredentialArn = this.TdeCredentialArn; context.TdeCredentialPassword = this.TdeCredentialPassword; context.Timezone = this.Timezone; if (this.VpcSecurityGroupId != null) { context.VpcSecurityGroupId = new List(this.VpcSecurityGroupId); } // allow further manipulation of loaded context prior to processing PostExecutionContextLoad(context); var output = Execute(context) as CmdletOutput; ProcessOutput(output); } #region IExecutor Members public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Neptune.Model.CreateDBInstanceRequest(); if (cmdletContext.AllocatedStorage != null) { request.AllocatedStorage = cmdletContext.AllocatedStorage.Value; } if (cmdletContext.AutoMinorVersionUpgrade != null) { request.AutoMinorVersionUpgrade = cmdletContext.AutoMinorVersionUpgrade.Value; } if (cmdletContext.AvailabilityZone != null) { request.AvailabilityZone = cmdletContext.AvailabilityZone; } if (cmdletContext.BackupRetentionPeriod != null) { request.BackupRetentionPeriod = cmdletContext.BackupRetentionPeriod.Value; } if (cmdletContext.CharacterSetName != null) { request.CharacterSetName = cmdletContext.CharacterSetName; } if (cmdletContext.CopyTagsToSnapshot != null) { request.CopyTagsToSnapshot = cmdletContext.CopyTagsToSnapshot.Value; } if (cmdletContext.DBClusterIdentifier != null) { request.DBClusterIdentifier = cmdletContext.DBClusterIdentifier; } if (cmdletContext.DBInstanceClass != null) { request.DBInstanceClass = cmdletContext.DBInstanceClass; } if (cmdletContext.DBInstanceIdentifier != null) { request.DBInstanceIdentifier = cmdletContext.DBInstanceIdentifier; } if (cmdletContext.DBName != null) { request.DBName = cmdletContext.DBName; } if (cmdletContext.DBParameterGroupName != null) { request.DBParameterGroupName = cmdletContext.DBParameterGroupName; } if (cmdletContext.DBSecurityGroup != null) { request.DBSecurityGroups = cmdletContext.DBSecurityGroup; } if (cmdletContext.DBSubnetGroupName != null) { request.DBSubnetGroupName = cmdletContext.DBSubnetGroupName; } if (cmdletContext.DeletionProtection != null) { request.DeletionProtection = cmdletContext.DeletionProtection.Value; } if (cmdletContext.Domain != null) { request.Domain = cmdletContext.Domain; } if (cmdletContext.DomainIAMRoleName != null) { request.DomainIAMRoleName = cmdletContext.DomainIAMRoleName; } if (cmdletContext.EnableCloudwatchLogsExport != null) { request.EnableCloudwatchLogsExports = cmdletContext.EnableCloudwatchLogsExport; } if (cmdletContext.EnableIAMDatabaseAuthentication != null) { request.EnableIAMDatabaseAuthentication = cmdletContext.EnableIAMDatabaseAuthentication.Value; } if (cmdletContext.EnablePerformanceInsight != null) { request.EnablePerformanceInsights = cmdletContext.EnablePerformanceInsight.Value; } if (cmdletContext.Engine != null) { request.Engine = cmdletContext.Engine; } if (cmdletContext.EngineVersion != null) { request.EngineVersion = cmdletContext.EngineVersion; } if (cmdletContext.Iops != null) { request.Iops = cmdletContext.Iops.Value; } if (cmdletContext.KmsKeyId != null) { request.KmsKeyId = cmdletContext.KmsKeyId; } if (cmdletContext.LicenseModel != null) { request.LicenseModel = cmdletContext.LicenseModel; } if (cmdletContext.MasterUsername != null) { request.MasterUsername = cmdletContext.MasterUsername; } if (cmdletContext.MasterUserPassword != null) { request.MasterUserPassword = cmdletContext.MasterUserPassword; } if (cmdletContext.MonitoringInterval != null) { request.MonitoringInterval = cmdletContext.MonitoringInterval.Value; } if (cmdletContext.MonitoringRoleArn != null) { request.MonitoringRoleArn = cmdletContext.MonitoringRoleArn; } if (cmdletContext.MultiAZ != null) { request.MultiAZ = cmdletContext.MultiAZ.Value; } if (cmdletContext.OptionGroupName != null) { request.OptionGroupName = cmdletContext.OptionGroupName; } if (cmdletContext.PerformanceInsightsKMSKeyId != null) { request.PerformanceInsightsKMSKeyId = cmdletContext.PerformanceInsightsKMSKeyId; } if (cmdletContext.Port != null) { request.Port = cmdletContext.Port.Value; } if (cmdletContext.PreferredBackupWindow != null) { request.PreferredBackupWindow = cmdletContext.PreferredBackupWindow; } if (cmdletContext.PreferredMaintenanceWindow != null) { request.PreferredMaintenanceWindow = cmdletContext.PreferredMaintenanceWindow; } if (cmdletContext.PromotionTier != null) { request.PromotionTier = cmdletContext.PromotionTier.Value; } #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute if (cmdletContext.PubliclyAccessible != null) { request.PubliclyAccessible = cmdletContext.PubliclyAccessible.Value; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute if (cmdletContext.StorageEncrypted != null) { request.StorageEncrypted = cmdletContext.StorageEncrypted.Value; } if (cmdletContext.StorageType != null) { request.StorageType = cmdletContext.StorageType; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.TdeCredentialArn != null) { request.TdeCredentialArn = cmdletContext.TdeCredentialArn; } if (cmdletContext.TdeCredentialPassword != null) { request.TdeCredentialPassword = cmdletContext.TdeCredentialPassword; } if (cmdletContext.Timezone != null) { request.Timezone = cmdletContext.Timezone; } if (cmdletContext.VpcSecurityGroupId != null) { request.VpcSecurityGroupIds = cmdletContext.VpcSecurityGroupId; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return output; } public ExecutorContext CreateContext() { return new CmdletContext(); } #endregion #region AWS Service Operation Call private Amazon.Neptune.Model.CreateDBInstanceResponse CallAWSServiceOperation(IAmazonNeptune client, Amazon.Neptune.Model.CreateDBInstanceRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Neptune", "CreateDBInstance"); try { #if DESKTOP return client.CreateDBInstance(request); #elif CORECLR return client.CreateDBInstanceAsync(request).GetAwaiter().GetResult(); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } } #endregion internal partial class CmdletContext : ExecutorContext { public System.Int32? AllocatedStorage { get; set; } public System.Boolean? AutoMinorVersionUpgrade { get; set; } public System.String AvailabilityZone { get; set; } public System.Int32? BackupRetentionPeriod { get; set; } public System.String CharacterSetName { get; set; } public System.Boolean? CopyTagsToSnapshot { get; set; } public System.String DBClusterIdentifier { get; set; } public System.String DBInstanceClass { get; set; } public System.String DBInstanceIdentifier { get; set; } public System.String DBName { get; set; } public System.String DBParameterGroupName { get; set; } public List DBSecurityGroup { get; set; } public System.String DBSubnetGroupName { get; set; } public System.Boolean? DeletionProtection { get; set; } public System.String Domain { get; set; } public System.String DomainIAMRoleName { get; set; } public List EnableCloudwatchLogsExport { get; set; } public System.Boolean? EnableIAMDatabaseAuthentication { get; set; } public System.Boolean? EnablePerformanceInsight { get; set; } public System.String Engine { get; set; } public System.String EngineVersion { get; set; } public System.Int32? Iops { get; set; } public System.String KmsKeyId { get; set; } public System.String LicenseModel { get; set; } public System.String MasterUsername { get; set; } public System.String MasterUserPassword { get; set; } public System.Int32? MonitoringInterval { get; set; } public System.String MonitoringRoleArn { get; set; } public System.Boolean? MultiAZ { get; set; } public System.String OptionGroupName { get; set; } public System.String PerformanceInsightsKMSKeyId { get; set; } public System.Int32? Port { get; set; } public System.String PreferredBackupWindow { get; set; } public System.String PreferredMaintenanceWindow { get; set; } public System.Int32? PromotionTier { get; set; } [System.ObsoleteAttribute] public System.Boolean? PubliclyAccessible { get; set; } public System.Boolean? StorageEncrypted { get; set; } public System.String StorageType { get; set; } public List Tag { get; set; } public System.String TdeCredentialArn { get; set; } public System.String TdeCredentialPassword { get; set; } public System.String Timezone { get; set; } public List VpcSecurityGroupId { get; set; } public System.Func Select { get; set; } = (response, cmdlet) => response.DBInstance; } } }