/******************************************************************************* * 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.RDS; using Amazon.RDS.Model; namespace Amazon.PowerShell.Cmdlets.RDS { /// /// Creates a new DB instance. /// /// /// /// The new DB instance can be an RDS DB instance, or it can be a DB instance in an Aurora /// DB cluster. For an Aurora DB cluster, you can call this operation multiple times to /// add more than one DB instance to the cluster. /// /// For more information about creating an RDS DB instance, see /// Creating an Amazon RDS DB instance in the Amazon RDS User Guide. /// /// For more information about creating a DB instance in an Aurora DB cluster, see /// Creating an Amazon Aurora DB cluster in the Amazon Aurora User Guide. /// /// [Cmdlet("New", "RDSDBInstance", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType("Amazon.RDS.Model.DBInstance")] [AWSCmdlet("Calls the Amazon Relational Database Service CreateDBInstance API operation.", Operation = new[] {"CreateDBInstance"}, SelectReturnType = typeof(Amazon.RDS.Model.CreateDBInstanceResponse))] [AWSCmdletOutput("Amazon.RDS.Model.DBInstance or Amazon.RDS.Model.CreateDBInstanceResponse", "This cmdlet returns an Amazon.RDS.Model.DBInstance object.", "The service call response (type Amazon.RDS.Model.CreateDBInstanceResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack." )] public partial class NewRDSDBInstanceCmdlet : AmazonRDSClientCmdlet, IExecutor { #region Parameter AllocatedStorage /// /// /// The amount of storage in gibibytes (GiB) to allocate for the DB instance.This setting doesn't apply to Amazon Aurora DB instances. Aurora cluster volumes automatically /// grow as the amount of data in your database increases, though you are only charged /// for the space that you use in an Aurora cluster volume.
Amazon RDS Custom
Constraints to the amount of storage for each storage type are the following:
  • General Purpose (SSD) storage (gp2, gp3): Must be an integer from 40 to 65536 for /// RDS Custom for Oracle, 16384 for RDS Custom for SQL Server.
  • Provisioned IOPS storage (io1): Must be an integer from 40 to 65536 for RDS Custom /// for Oracle, 16384 for RDS Custom for SQL Server.
RDS for MariaDB
Constraints to the amount of storage for each storage type are the following:
  • General Purpose (SSD) storage (gp2, gp3): Must be an integer from 20 to 65536.
  • Provisioned IOPS storage (io1): Must be an integer from 100 to 65536.
  • Magnetic storage (standard): Must be an integer from 5 to 3072.
RDS for MySQL
Constraints to the amount of storage for each storage type are the following:
  • General Purpose (SSD) storage (gp2, gp3): Must be an integer from 20 to 65536.
  • Provisioned IOPS storage (io1): Must be an integer from 100 to 65536.
  • Magnetic storage (standard): Must be an integer from 5 to 3072.
RDS for Oracle
Constraints to the amount of storage for each storage type are the following:
  • General Purpose (SSD) storage (gp2, gp3): Must be an integer from 20 to 65536.
  • Provisioned IOPS storage (io1): Must be an integer from 100 to 65536.
  • Magnetic storage (standard): Must be an integer from 10 to 3072.
RDS for PostgreSQL
Constraints to the amount of storage for each storage type are the following:
  • General Purpose (SSD) storage (gp2, gp3): Must be an integer from 20 to 65536.
  • Provisioned IOPS storage (io1): Must be an integer from 100 to 65536.
  • Magnetic storage (standard): Must be an integer from 5 to 3072.
RDS for SQL Server
Constraints to the amount of storage for each storage type are the following:
  • General Purpose (SSD) storage (gp2, gp3):
    • Enterprise and Standard editions: Must be an integer from 20 to 16384.
    • Web and Express editions: Must be an integer from 20 to 16384.
  • Provisioned IOPS storage (io1):
    • Enterprise and Standard editions: Must be an integer from 100 to 16384.
    • Web and Express editions: Must be an integer from 100 to 16384.
  • Magnetic storage (standard):
    • Enterprise and Standard editions: Must be an integer from 20 to 1024.
    • Web and Express editions: Must be an integer from 20 to 1024.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? AllocatedStorage { get; set; } #endregion #region Parameter AutoMinorVersionUpgrade /// /// /// Specifies whether minor engine upgrades are applied automatically to the DB instance /// during the maintenance window. By default, minor engine upgrades are applied automatically.If you create an RDS Custom DB instance, you must set AutoMinorVersionUpgrade /// to false. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? AutoMinorVersionUpgrade { get; set; } #endregion #region Parameter AvailabilityZone /// /// /// The Availability Zone (AZ) where the database will be created. For information on /// Amazon Web Services Regions and Availability Zones, see Regions /// and Availability Zones.For Amazon Aurora, each Aurora DB cluster hosts copies of its storage in three separate /// Availability Zones. Specify one of these Availability Zones. Aurora automatically /// chooses an appropriate Availability Zone if you don't specify one.Default: A random, system-chosen Availability Zone in the endpoint's Amazon Web Services /// Region.Constraints:Example: us-east-1d /// /// [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. Setting this parameter /// to a positive number enables backups. Setting this parameter to 0 disables /// automated backups.This setting doesn't apply to Amazon Aurora DB instances. The retention period for /// automated backups is managed by the DB cluster.Default: 1Constraints: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? BackupRetentionPeriod { get; set; } #endregion #region Parameter BackupTarget /// /// /// The location for storing automated backups and manual snapshots.Valie Values:Default: regionFor more information, see Working /// with Amazon RDS on Amazon Web Services Outposts in the Amazon RDS User Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String BackupTarget { get; set; } #endregion #region Parameter CACertificateIdentifier /// /// /// The CA certificate identifier to use for the DB instance's server certificate.This setting doesn't apply to RDS Custom DB instances.For more information, see Using /// SSL/TLS to encrypt a connection to a DB instance in the Amazon RDS User Guide /// and /// Using SSL/TLS to encrypt a connection to a DB cluster in the Amazon Aurora /// User Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String CACertificateIdentifier { get; set; } #endregion #region Parameter CharacterSetName /// /// /// For supported engines, the character set (CharacterSet) to associate /// the DB instance with.This setting doesn't apply to the following DB instances: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String CharacterSetName { get; set; } #endregion #region Parameter CopyTagsToSnapshot /// /// /// Specifies whether to copy tags from the DB instance to snapshots of the DB instance. /// By default, tags are not copied.This setting doesn't apply to Amazon Aurora DB instances. Copying tags to snapshots /// is managed by the DB cluster. Setting this value for an Aurora DB instance has no /// effect on the DB cluster setting. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? CopyTagsToSnapshot { get; set; } #endregion #region Parameter CustomIamInstanceProfile /// /// /// The instance profile associated with the underlying Amazon EC2 instance of an RDS /// Custom DB instance.This setting is required for RDS Custom.Constraints:For the list of permissions required for the IAM role, see /// Configure IAM and your VPC in the Amazon RDS User Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String CustomIamInstanceProfile { get; set; } #endregion #region Parameter DBClusterIdentifier /// /// /// The identifier of the DB cluster that this DB instance will belong to.This setting doesn't apply to RDS Custom DB instances. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DBClusterIdentifier { get; set; } #endregion #region Parameter DBInstanceClass /// /// /// The compute and memory capacity of the DB instance, for example db.m5.large. /// Not all DB instance classes are available in all Amazon Web Services Regions, or for /// all database engines. For the full list of DB instance classes, and availability for /// your engine, see DB /// instance classes in the Amazon RDS User Guide or Aurora /// DB instance classes in the Amazon Aurora User Guide. /// /// #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 identifier for this DB instance. This parameter is stored as a lowercase string.Constraints:Example: mydbinstance /// /// #if !MODULAR [System.Management.Automation.Parameter(Position = 1, ValueFromPipelineByPropertyName = true)] #else [System.Management.Automation.Parameter(Position = 1, ValueFromPipelineByPropertyName = 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 /// /// /// The meaning of this parameter differs according to the database engine you use.MySQLThe name of the database to create when the DB instance is created. If this parameter /// isn't specified, no database is created in the DB instance.Constraints:MariaDBThe name of the database to create when the DB instance is created. If this parameter /// isn't specified, no database is created in the DB instance.Constraints:PostgreSQLThe name of the database to create when the DB instance is created. If this parameter /// isn't specified, a database named postgres is created in the DB instance.Constraints:OracleThe Oracle System ID (SID) of the created DB instance. If you don't specify a value, /// the default value is ORCL. You can't specify the string null, /// or any other reserved word, for DBName.Default: ORCLConstraints:Amazon RDS Custom for OracleThe Oracle System ID (SID) of the created RDS Custom DB instance. If you don't specify /// a value, the default value is ORCL for non-CDBs and RDSCDB /// for CDBs.Default: ORCLConstraints:Amazon RDS Custom for SQL ServerNot applicable. Must be null.SQL ServerNot applicable. Must be null.Amazon Aurora MySQLThe name of the database to create when the primary DB instance of the Aurora MySQL /// DB cluster is created. If this parameter isn't specified for an Aurora MySQL DB cluster, /// no database is created in the DB cluster.Constraints:Amazon Aurora PostgreSQLThe name of the database to create when the primary DB instance of the Aurora PostgreSQL /// DB cluster is created. If this parameter isn't specified for an Aurora PostgreSQL /// DB cluster, a database named postgres is created in the DB cluster.Constraints: /// /// [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = 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 you don't /// specify a value, then Amazon RDS uses the default DB parameter group for the specified /// DB engine and version.This setting doesn't apply to RDS Custom DB instances.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.This setting applies to the legacy EC2-Classic platform, which is no longer used to /// create new DB instances. Use the VpcSecurityGroupIds setting instead. /// /// [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.Constraints:Example: mydbsubnetgroup /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DBSubnetGroupName { get; set; } #endregion #region Parameter DBSystemId /// /// /// The Oracle system identifier (SID), which is the name of the Oracle database instance /// that manages your database files. In this context, the term "Oracle database instance" /// refers exclusively to the system global area (SGA) and Oracle background processes. /// If you don't specify a SID, the value defaults to RDSCDB. The Oracle /// SID is also the name of your CDB. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DBSystemId { get; set; } #endregion #region Parameter DeletionProtection /// /// /// Specifies whether the DB instance has deletion protection enabled. The database can't /// be deleted when deletion protection is enabled. By default, deletion protection isn't /// enabled. For more information, see /// Deleting a DB Instance.This setting doesn't apply to Amazon Aurora DB instances. You can enable or disable /// deletion protection for the DB cluster. For more information, see CreateDBCluster. /// DB instances in a DB cluster can be deleted even when deletion protection is enabled /// for the DB cluster. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? DeletionProtection { get; set; } #endregion #region Parameter Domain /// /// /// The Active Directory directory ID to create the DB instance in. Currently, only Microsoft /// SQL Server, MySQL, Oracle, and PostgreSQL DB instances can be created in an Active /// Directory Domain.For more information, see /// Kerberos Authentication in the Amazon RDS User Guide.This setting doesn't apply to the following DB instances: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Domain { get; set; } #endregion #region Parameter DomainAuthSecretArn /// /// /// The ARN for the Secrets Manager secret with the credentials for the user joining the /// domain.Example: arn:aws:secretsmanager:region:account-number:secret:myselfmanagedADtestsecret-123456 /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DomainAuthSecretArn { get; set; } #endregion #region Parameter DomainDnsIp /// /// /// The IPv4 DNS IP addresses of your primary and secondary Active Directory domain controllers.Constraints:Example: 123.124.125.126,234.235.236.237 /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("DomainDnsIps")] public System.String[] DomainDnsIp { get; set; } #endregion #region Parameter DomainFqdn /// /// /// The fully qualified domain name (FQDN) of an Active Directory domain.Constraints:Example: mymanagedADtest.mymanagedAD.mydomain /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DomainFqdn { get; set; } #endregion #region Parameter DomainIAMRoleName /// /// /// The name of the IAM role to use when making API calls to the Directory Service.This setting doesn't apply to the following DB instances: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DomainIAMRoleName { get; set; } #endregion #region Parameter DomainOu /// /// /// The Active Directory organizational unit for your DB instance to join.Constraints:Example: OU=mymanagedADtestOU,DC=mymanagedADtest,DC=mymanagedAD,DC=mydomain /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DomainOu { get; set; } #endregion #region Parameter EnableCloudwatchLogsExport /// /// /// The list of log types that need to be enabled for exporting to CloudWatch Logs. For /// more information, see /// Publishing Database Logs to Amazon CloudWatch Logs in the Amazon RDS User Guide.This setting doesn't apply to the following DB instances:The following values are valid for each DB engine: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EnableCloudwatchLogsExports")] public System.String[] EnableCloudwatchLogsExport { get; set; } #endregion #region Parameter EnableCustomerOwnedIp /// /// /// Specifies whether to enable a customer-owned IP address (CoIP) for an RDS on Outposts /// DB instance.A CoIP provides local or external connectivity to resources in your Outpost /// subnets through your on-premises network. For some use cases, a CoIP can provide lower /// latency for connections to the DB instance from outside of its virtual private cloud /// (VPC) on your local network.For more information about RDS on Outposts, see Working /// with Amazon RDS on Amazon Web Services Outposts in the Amazon RDS User Guide.For more information about CoIPs, see Customer-owned /// IP addresses in the Amazon Web Services Outposts User Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? EnableCustomerOwnedIp { get; set; } #endregion #region Parameter EnableIAMDatabaseAuthentication /// /// /// Specifies whether to enable mapping of Amazon Web Services Identity and Access Management /// (IAM) accounts to database accounts. By default, mapping isn't enabled.For more information, see /// IAM Database Authentication for MySQL and PostgreSQL in the Amazon RDS User /// Guide.This setting doesn't apply to the following DB instances: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? EnableIAMDatabaseAuthentication { get; set; } #endregion #region Parameter EnablePerformanceInsight /// /// /// Specifies whether to enable Performance Insights for the DB instance. For more information, /// see Using /// Amazon Performance Insights in the Amazon RDS User Guide.This setting doesn't apply to RDS Custom DB instances. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EnablePerformanceInsights")] public System.Boolean? EnablePerformanceInsight { get; set; } #endregion #region Parameter Engine /// /// /// The database engine to use for this DB instance.Not every database engine is available in every Amazon Web Services Region.Valid Values: /// /// #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.This setting doesn't apply to Amazon Aurora DB instances. The version number of the /// database engine the DB instance uses is managed by the DB cluster.For a list of valid engine versions, use the DescribeDBEngineVersions /// operation.The following are the database engines and links to information about the major and /// minor versions that are available with Amazon RDS. Not every database engine is available /// for every Amazon Web Services Region.
Amazon RDS Custom for Oracle
A custom engine version (CEV) that you have previously created. This setting is required /// for RDS Custom for Oracle. The CEV name has the following format: 19.customized_string. /// A valid CEV name is 19.my_cev1. For more information, see /// Creating an RDS Custom for Oracle DB instance in the Amazon RDS User Guide.
Amazon RDS Custom for SQL Server
See RDS /// Custom for SQL Server general requirements in the Amazon RDS User Guide.
RDS for MariaDB
For information, see MariaDB /// on Amazon RDS versions in the Amazon RDS User Guide.
RDS for Microsoft SQL Server
For information, see Microsoft /// SQL Server versions on Amazon RDS in the Amazon RDS User Guide.
RDS for MySQL
For information, see MySQL /// on Amazon RDS versions in the Amazon RDS User Guide.
RDS for Oracle
For information, see Oracle /// Database Engine release notes in the Amazon RDS User Guide.
RDS for PostgreSQL
For information, see Amazon /// RDS for PostgreSQL versions and extensions in the Amazon RDS User Guide.
///
///
[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 initially allocate /// for the DB instance. For information about valid IOPS values, see Amazon /// RDS DB instance storage in the Amazon RDS User Guide.This setting doesn't apply to Amazon Aurora DB instances. Storage is managed by the /// DB cluster.Constraints: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? Iops { get; set; } #endregion #region Parameter KmsKeyId /// /// /// The Amazon Web Services KMS key identifier for an encrypted DB instance.The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias /// name for the KMS key. To use a KMS key in a different Amazon Web Services account, /// specify the key ARN or alias ARN.This setting doesn't apply to Amazon Aurora DB instances. The Amazon Web Services /// KMS key identifier is managed by the DB cluster. For more information, see CreateDBCluster.If StorageEncrypted is enabled, and you do not specify a value for the /// KmsKeyId parameter, then Amazon RDS uses your default KMS key. There /// is a default KMS key for your Amazon Web Services account. Your Amazon Web Services /// account has a different default KMS key for each Amazon Web Services Region.For Amazon RDS Custom, a KMS key is required for DB instances. For most RDS engines, /// if you leave this parameter empty while enabling StorageEncrypted, the /// engine uses the default KMS key. However, RDS Custom doesn't use the default key when /// this parameter is empty. You must explicitly specify a key. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String KmsKeyId { get; set; } #endregion #region Parameter LicenseModel /// /// /// The license model information for this DB instance.This setting doesn't apply to Amazon Aurora or RDS Custom DB instances.Valid Values: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String LicenseModel { get; set; } #endregion #region Parameter ManageMasterUserPassword /// /// /// Specifies whether to manage the master user password with Amazon Web Services Secrets /// Manager.For more information, see Password /// management with Amazon Web Services Secrets Manager in the Amazon RDS User /// Guide.Constraints: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? ManageMasterUserPassword { get; set; } #endregion #region Parameter MasterUsername /// /// /// The name for the master user.This setting doesn't apply to Amazon Aurora DB instances. The name for the master /// user is managed by the DB cluster.This setting is required for RDS DB instances.Constraints: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String MasterUsername { get; set; } #endregion #region Parameter MasterUserPassword /// /// /// The password for the master user.This setting doesn't apply to Amazon Aurora DB instances. The password for the master /// user is managed by the DB cluster.Constraints:Length Constraints: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String MasterUserPassword { get; set; } #endregion #region Parameter MasterUserSecretKmsKeyId /// /// /// The Amazon Web Services KMS key identifier to encrypt a secret that is automatically /// generated and managed in Amazon Web Services Secrets Manager.This setting is valid only if the master user password is managed by RDS in Amazon /// Web Services Secrets Manager for the DB instance.The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias /// name for the KMS key. To use a KMS key in a different Amazon Web Services account, /// specify the key ARN or alias ARN.If you don't specify MasterUserSecretKmsKeyId, then the aws/secretsmanager /// KMS key is used to encrypt the secret. If the secret is in a different Amazon Web /// Services account, then you can't use the aws/secretsmanager KMS key to /// encrypt the secret, and you must use a customer managed KMS key.There is a default KMS key for your Amazon Web Services account. Your Amazon Web Services /// account has a different default KMS key for each Amazon Web Services Region. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String MasterUserSecretKmsKeyId { get; set; } #endregion #region Parameter MaxAllocatedStorage /// /// /// The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale the /// storage of the DB instance.For more information about this setting, including limitations that apply to it, see /// /// Managing capacity automatically with Amazon RDS storage autoscaling in the Amazon /// RDS User Guide.This setting doesn't apply to the following DB instances: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? MaxAllocatedStorage { get; set; } #endregion #region Parameter MonitoringInterval /// /// /// The interval, in seconds, between points when Enhanced Monitoring metrics are collected /// for the DB instance. To disable collection of Enhanced Monitoring metrics, specify /// 0.If MonitoringRoleArn is specified, then you must set MonitoringInterval /// to a value other than 0.This setting doesn't apply to RDS Custom DB instances.Valid Values: 0 | 1 | 5 | 10 | 15 | 30 | 60Default: 0 /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? MonitoringInterval { get; set; } #endregion #region Parameter MonitoringRoleArn /// /// /// The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to Amazon /// CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess. /// For information on creating a monitoring role, see Setting /// Up and Enabling Enhanced Monitoring in the Amazon RDS User Guide.If MonitoringInterval is set to a value other than 0, then /// you must supply a MonitoringRoleArn value.This setting doesn't apply to RDS Custom DB instances. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String MonitoringRoleArn { get; set; } #endregion #region Parameter MultiAZ /// /// /// Specifies whether the DB instance is a Multi-AZ deployment. You can't set the AvailabilityZone /// parameter if the DB instance is a Multi-AZ deployment.This setting doesn't apply to the following DB instances: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? MultiAZ { get; set; } #endregion #region Parameter NcharCharacterSetName /// /// /// The name of the NCHAR character set for the Oracle DB instance.This setting doesn't apply to RDS Custom DB instances. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String NcharCharacterSetName { get; set; } #endregion #region Parameter NetworkType /// /// /// The network type of the DB instance.The network type is determined by the DBSubnetGroup specified for the /// DB instance. A DBSubnetGroup can support only the IPv4 protocol or the /// IPv4 and the IPv6 protocols (DUAL).For more information, see /// Working with a DB instance in a VPC in the Amazon RDS User Guide.Valid Values: IPV4 | DUAL /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String NetworkType { get; set; } #endregion #region Parameter OptionGroupName /// /// /// The option group to associate the DB instance with.Permanent options, such as the TDE option for Oracle Advanced Security TDE, can't /// be removed from an option group. Also, that option group can't be removed from a DB /// instance after it is associated with a DB instance.This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String OptionGroupName { get; set; } #endregion #region Parameter PerformanceInsightsKMSKeyId /// /// /// The Amazon Web Services KMS key identifier for encryption of Performance Insights /// data.The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias /// name for the KMS key.If you don't specify a value for PerformanceInsightsKMSKeyId, then Amazon /// RDS uses your default KMS key. There is a default KMS key for your Amazon Web Services /// account. Your Amazon Web Services account has a different default KMS key for each /// Amazon Web Services Region.This setting doesn't apply to RDS Custom DB instances. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String PerformanceInsightsKMSKeyId { get; set; } #endregion #region Parameter PerformanceInsightsRetentionPeriod /// /// /// The number of days to retain Performance Insights data.This setting doesn't apply to RDS Custom DB instances.Valid Values:Default: 7 daysIf you specify a retention period that isn't valid, such as 94, Amazon /// RDS returns an error. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? PerformanceInsightsRetentionPeriod { get; set; } #endregion #region Parameter Port /// /// /// The port number on which the database accepts connections.This setting doesn't apply to Aurora DB instances. The port number is managed by the /// cluster.Valid Values: 1150-65535Default:Constraints: /// /// [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 if automated backups /// are enabled, using the BackupRetentionPeriod parameter. The default is /// a 30-minute window selected at random from an 8-hour block of time for each Amazon /// Web Services Region. For more information, see Backup /// window in the Amazon RDS User Guide.This setting doesn't apply to Amazon Aurora DB instances. The daily time range for /// creating automated backups is managed by the DB cluster.Constraints: /// /// [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. For more information, /// see Amazon /// RDS Maintenance Window in the Amazon RDS User Guide.The default is a 30-minute window selected at random from an 8-hour block of time /// for each Amazon Web Services Region, occurring on a random day of the week.Constraints: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String PreferredMaintenanceWindow { get; set; } #endregion #region Parameter ProcessorFeature /// /// /// The number of CPU cores and the number of threads per core for the DB instance class /// of the DB instance.This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ProcessorFeatures")] public Amazon.RDS.Model.ProcessorFeature[] ProcessorFeature { get; set; } #endregion #region Parameter PromotionTier /// /// /// The order of priority in which an Aurora Replica is promoted to the primary instance /// after a failure of the existing primary instance. For more information, see /// Fault Tolerance for an Aurora DB Cluster in the Amazon Aurora User Guide.This setting doesn't apply to RDS Custom DB instances.Default: 1Valid Values: 0 - 15 /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? PromotionTier { get; set; } #endregion #region Parameter PubliclyAccessible /// /// /// Specifies whether the DB instance is publicly accessible.When the DB instance is publicly accessible, its Domain Name System (DNS) endpoint /// resolves to the private IP address from within the DB instance's virtual private cloud /// (VPC). It resolves to the public IP address from outside of the DB instance's VPC. /// Access to the DB instance is ultimately controlled by the security group it uses. /// That public access is not permitted if the security group assigned to the DB instance /// doesn't permit it.When the DB instance isn't publicly accessible, it is an internal DB instance with /// a DNS name that resolves to a private IP address.Default: The default behavior varies depending on whether DBSubnetGroupName /// is specified.If DBSubnetGroupName isn't specified, and PubliclyAccessible /// isn't specified, the following applies:If DBSubnetGroupName is specified, and PubliclyAccessible /// isn't specified, the following applies: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? PubliclyAccessible { get; set; } #endregion #region Parameter StorageEncrypted /// /// /// Specifes whether the DB instance is encrypted. By default, it isn't encrypted.For RDS Custom DB instances, either enable this setting or leave it unset. Otherwise, /// Amazon RDS reports an error.This setting doesn't apply to Amazon Aurora DB instances. The encryption for DB instances /// is managed by the DB cluster. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? StorageEncrypted { get; set; } #endregion #region Parameter StorageThroughput /// /// /// The storage throughput value for the DB instance.This setting applies only to the gp3 storage type.This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? StorageThroughput { get; set; } #endregion #region Parameter StorageType /// /// /// The storage type to associate with the DB instance.If you specify io1 or gp3, you must also include a value /// for the Iops parameter.This setting doesn't apply to Amazon Aurora DB instances. Storage is managed by the /// DB cluster.Valid Values: gp2 | gp3 | io1 | standardDefault: io1, if the Iops parameter is specified. Otherwise, /// gp2. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String StorageType { get; set; } #endregion #region Parameter Tag /// /// /// Tags to assign to the DB instance. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Tags")] public Amazon.RDS.Model.Tag[] Tag { get; set; } #endregion #region Parameter TdeCredentialArn /// /// /// The ARN from the key store with which to associate the instance for TDE encryption.This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. /// /// [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.This setting doesn't apply to RDS Custom DB instances. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String TdeCredentialPassword { get; set; } #endregion #region Parameter Timezone /// /// /// The time zone of the DB instance. The time zone parameter is currently supported only /// by Microsoft /// SQL Server. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Timezone { get; set; } #endregion #region Parameter VpcSecurityGroupId /// /// /// A list of Amazon EC2 VPC security groups to associate with this DB instance.This setting doesn't apply to Amazon Aurora DB instances. The associated list of EC2 /// VPC security groups is managed by the DB cluster.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 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.RDS.Model.CreateDBInstanceResponse). /// Specifying the name of a property of type Amazon.RDS.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 DBName parameter. /// The -PassThru parameter is deprecated, use -Select '^DBName' instead. This parameter will be removed in a future version. /// [System.Obsolete("The -PassThru parameter is deprecated, use -Select '^DBName' 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.DBName), MyInvocation.BoundParameters); if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "New-RDSDBInstance (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.DBName; } #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.BackupTarget = this.BackupTarget; context.CACertificateIdentifier = this.CACertificateIdentifier; context.CharacterSetName = this.CharacterSetName; context.CopyTagsToSnapshot = this.CopyTagsToSnapshot; context.CustomIamInstanceProfile = this.CustomIamInstanceProfile; context.DBClusterIdentifier = this.DBClusterIdentifier; 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.DBSystemId = this.DBSystemId; context.DeletionProtection = this.DeletionProtection; context.Domain = this.Domain; context.DomainAuthSecretArn = this.DomainAuthSecretArn; if (this.DomainDnsIp != null) { context.DomainDnsIp = new List(this.DomainDnsIp); } context.DomainFqdn = this.DomainFqdn; context.DomainIAMRoleName = this.DomainIAMRoleName; context.DomainOu = this.DomainOu; if (this.EnableCloudwatchLogsExport != null) { context.EnableCloudwatchLogsExport = new List(this.EnableCloudwatchLogsExport); } context.EnableCustomerOwnedIp = this.EnableCustomerOwnedIp; 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.ManageMasterUserPassword = this.ManageMasterUserPassword; context.MasterUsername = this.MasterUsername; context.MasterUserPassword = this.MasterUserPassword; context.MasterUserSecretKmsKeyId = this.MasterUserSecretKmsKeyId; context.MaxAllocatedStorage = this.MaxAllocatedStorage; context.MonitoringInterval = this.MonitoringInterval; context.MonitoringRoleArn = this.MonitoringRoleArn; context.MultiAZ = this.MultiAZ; context.NcharCharacterSetName = this.NcharCharacterSetName; context.NetworkType = this.NetworkType; context.OptionGroupName = this.OptionGroupName; context.PerformanceInsightsKMSKeyId = this.PerformanceInsightsKMSKeyId; context.PerformanceInsightsRetentionPeriod = this.PerformanceInsightsRetentionPeriod; context.Port = this.Port; context.PreferredBackupWindow = this.PreferredBackupWindow; context.PreferredMaintenanceWindow = this.PreferredMaintenanceWindow; if (this.ProcessorFeature != null) { context.ProcessorFeature = new List(this.ProcessorFeature); } context.PromotionTier = this.PromotionTier; context.PubliclyAccessible = this.PubliclyAccessible; context.StorageEncrypted = this.StorageEncrypted; context.StorageThroughput = this.StorageThroughput; 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.RDS.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.BackupTarget != null) { request.BackupTarget = cmdletContext.BackupTarget; } if (cmdletContext.CACertificateIdentifier != null) { request.CACertificateIdentifier = cmdletContext.CACertificateIdentifier; } if (cmdletContext.CharacterSetName != null) { request.CharacterSetName = cmdletContext.CharacterSetName; } if (cmdletContext.CopyTagsToSnapshot != null) { request.CopyTagsToSnapshot = cmdletContext.CopyTagsToSnapshot.Value; } if (cmdletContext.CustomIamInstanceProfile != null) { request.CustomIamInstanceProfile = cmdletContext.CustomIamInstanceProfile; } 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.DBSystemId != null) { request.DBSystemId = cmdletContext.DBSystemId; } if (cmdletContext.DeletionProtection != null) { request.DeletionProtection = cmdletContext.DeletionProtection.Value; } if (cmdletContext.Domain != null) { request.Domain = cmdletContext.Domain; } if (cmdletContext.DomainAuthSecretArn != null) { request.DomainAuthSecretArn = cmdletContext.DomainAuthSecretArn; } if (cmdletContext.DomainDnsIp != null) { request.DomainDnsIps = cmdletContext.DomainDnsIp; } if (cmdletContext.DomainFqdn != null) { request.DomainFqdn = cmdletContext.DomainFqdn; } if (cmdletContext.DomainIAMRoleName != null) { request.DomainIAMRoleName = cmdletContext.DomainIAMRoleName; } if (cmdletContext.DomainOu != null) { request.DomainOu = cmdletContext.DomainOu; } if (cmdletContext.EnableCloudwatchLogsExport != null) { request.EnableCloudwatchLogsExports = cmdletContext.EnableCloudwatchLogsExport; } if (cmdletContext.EnableCustomerOwnedIp != null) { request.EnableCustomerOwnedIp = cmdletContext.EnableCustomerOwnedIp.Value; } 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.ManageMasterUserPassword != null) { request.ManageMasterUserPassword = cmdletContext.ManageMasterUserPassword.Value; } if (cmdletContext.MasterUsername != null) { request.MasterUsername = cmdletContext.MasterUsername; } if (cmdletContext.MasterUserPassword != null) { request.MasterUserPassword = cmdletContext.MasterUserPassword; } if (cmdletContext.MasterUserSecretKmsKeyId != null) { request.MasterUserSecretKmsKeyId = cmdletContext.MasterUserSecretKmsKeyId; } if (cmdletContext.MaxAllocatedStorage != null) { request.MaxAllocatedStorage = cmdletContext.MaxAllocatedStorage.Value; } 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.NcharCharacterSetName != null) { request.NcharCharacterSetName = cmdletContext.NcharCharacterSetName; } if (cmdletContext.NetworkType != null) { request.NetworkType = cmdletContext.NetworkType; } if (cmdletContext.OptionGroupName != null) { request.OptionGroupName = cmdletContext.OptionGroupName; } if (cmdletContext.PerformanceInsightsKMSKeyId != null) { request.PerformanceInsightsKMSKeyId = cmdletContext.PerformanceInsightsKMSKeyId; } if (cmdletContext.PerformanceInsightsRetentionPeriod != null) { request.PerformanceInsightsRetentionPeriod = cmdletContext.PerformanceInsightsRetentionPeriod.Value; } 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.ProcessorFeature != null) { request.ProcessorFeatures = cmdletContext.ProcessorFeature; } if (cmdletContext.PromotionTier != null) { request.PromotionTier = cmdletContext.PromotionTier.Value; } if (cmdletContext.PubliclyAccessible != null) { request.PubliclyAccessible = cmdletContext.PubliclyAccessible.Value; } if (cmdletContext.StorageEncrypted != null) { request.StorageEncrypted = cmdletContext.StorageEncrypted.Value; } if (cmdletContext.StorageThroughput != null) { request.StorageThroughput = cmdletContext.StorageThroughput.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.RDS.Model.CreateDBInstanceResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.CreateDBInstanceRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "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 BackupTarget { get; set; } public System.String CACertificateIdentifier { get; set; } public System.String CharacterSetName { get; set; } public System.Boolean? CopyTagsToSnapshot { get; set; } public System.String CustomIamInstanceProfile { 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.String DBSystemId { get; set; } public System.Boolean? DeletionProtection { get; set; } public System.String Domain { get; set; } public System.String DomainAuthSecretArn { get; set; } public List DomainDnsIp { get; set; } public System.String DomainFqdn { get; set; } public System.String DomainIAMRoleName { get; set; } public System.String DomainOu { get; set; } public List EnableCloudwatchLogsExport { get; set; } public System.Boolean? EnableCustomerOwnedIp { 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.Boolean? ManageMasterUserPassword { get; set; } public System.String MasterUsername { get; set; } public System.String MasterUserPassword { get; set; } public System.String MasterUserSecretKmsKeyId { get; set; } public System.Int32? MaxAllocatedStorage { get; set; } public System.Int32? MonitoringInterval { get; set; } public System.String MonitoringRoleArn { get; set; } public System.Boolean? MultiAZ { get; set; } public System.String NcharCharacterSetName { get; set; } public System.String NetworkType { get; set; } public System.String OptionGroupName { get; set; } public System.String PerformanceInsightsKMSKeyId { get; set; } public System.Int32? PerformanceInsightsRetentionPeriod { get; set; } public System.Int32? Port { get; set; } public System.String PreferredBackupWindow { get; set; } public System.String PreferredMaintenanceWindow { get; set; } public List ProcessorFeature { get; set; } public System.Int32? PromotionTier { get; set; } public System.Boolean? PubliclyAccessible { get; set; } public System.Boolean? StorageEncrypted { get; set; } public System.Int32? StorageThroughput { 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; } } }