db_instance#

State module for AWS neptune DB instance.

async idem_aws.states.aws.neptune.db_instance.present(hub, ctx, name: str, resource_id: str = None, *, db_instance_class: str, engine: str, db_name: str = None, allocated_storage: int = None, master_username: str = None, master_user_password: str = None, db_security_groups: ~typing.List[str] = None, vpc_security_group_ids: ~typing.List[str] = None, availability_zone: str = None, db_subnet_group_name: str = None, preferred_maintenance_window: str = None, db_parameter_group_name: str = None, backup_retention_period: int = None, preferred_backup_window: str = None, port: int = None, multi_az: bool = None, engine_version: str = None, auto_minor_version_upgrade: bool = None, license_model: str = None, iops: int = None, option_group_name: str = None, character_set_name: str = None, publicly_accessible: bool = None, tags: ~typing.Dict[str, ~typing.Any], db_cluster_identifier: str = None, storage_type: str = None, tde_credential_arn: str = None, tde_credential_password: str = None, storage_encrypted: bool = None, kms_key_id: str = None, domain: str = None, copy_tags_to_snapshot: bool = None, monitoring_interval: int = None, monitoring_role_arn: str = None, domain_iam_role_name: str = None, promotion_tier: int = None, timezone: str = None, enable_iam_database_authentication: bool = None, enable_performance_insights: bool = None, performance_insights_kms_key_id: str = None, enable_cloudwatch_logs_exports: ~typing.List[str] = None, deletion_protection: bool = None, apply_immediately: bool = None, allow_major_version_upgrade: bool = None, ca_certificate_identifier: str = None, cloudwatch_logs_export_configuration: ~types.Cloudwatch log export configuration dataclass.CloudwatchLogsExportConfiguration = None, timeout: ~types.Timeout configuration dataclass.Timeout = None) Dict[str, Any][source]#

Creates a new DB instance.

Parameters:
  • name (str) – An Idem name of the resource. This is also DB instance identifier during resource creation. This parameter is stored as a lowercase string. Constraints: Must contain from 1 to 63 letters, numbers, or hyphens. First character must be a letter. Cannot end with a hyphen or contain two consecutive hyphens. Example: mydbinstance.

  • resource_id (str, Optional) – AWS Neptune DBInstanceIdentifier to identify the resource. Defaults to None.

  • db_name (str, Optional) – Not supported. Defaults to None.

  • allocated_storage (int, Optional) – Not supported by Neptune. Defaults to None.

  • db_instance_class (str) – 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.

  • engine (str) – The name of the database engine to be used for this instance. Valid Values: neptune.

  • master_username (str, Optional) – Not supported by Neptune. Defaults to None.

  • master_user_password (str, Optional) – Not supported by Neptune. Defaults to None.

  • db_security_groups (list[str], Optional) – A list of DB security groups to associate with this DB instance. Default: The default DB security group for the database engine. Defaults to None.

  • vpc_security_group_ids (list[str], Optional) – 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. Defaults to None.

  • availability_zone (str, Optional) – The EC2 Availability Zone that the DB instance is created in Default: 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. Defaults to None.

  • db_subnet_group_name (str, Optional) – 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. Defaults to None.

  • preferred_maintenance_window (str, Optional) – The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC). Format: ddd:hh24:mi-ddd:hh24:mi The 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. Defaults to None.

  • db_parameter_group_name (str, Optional) – 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: Must be 1 to 255 letters, numbers, or hyphens. First character must be a letter Cannot end with a hyphen or contain two consecutive hyphens. Defaults to None.

  • backup_retention_period (int, Optional) – 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: 1 Constraints: Must be a value from 0 to 35 Cannot be set to 0 if the DB instance is a source to Read Replicas. Defaults to None.

  • preferred_backup_window (str, Optional) – 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. Defaults to None.

  • port (int, Optional) – 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: 8182 Type: Integer. Defaults to None.

  • multi_az (bool, Optional) – 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. Defaults to None.

  • engine_version (str, Optional) – The version number of the database engine to use. Currently, setting this parameter has no effect. Defaults to None.

  • auto_minor_version_upgrade (bool, Optional) – Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window. Default: true. Defaults to None.

  • license_model (str, Optional) – License model information for this DB instance. Valid values: license-included | bring-your- own-license | general-public-license. Defaults to None.

  • iops (int, Optional) – The amount of Provisioned IOPS (input/output operations per second) to be initially allocated for the DB instance. Defaults to None.

  • option_group_name (str, Optional) – (Not supported by Neptune). Defaults to None.

  • character_set_name (str, Optional) – (Not supported by Neptune). Defaults to None.

  • publicly_accessible (bool, Optional) – This flag should no longer be used. Defaults to None.

  • tags (dict, Optional) –

    Dict in the format of {tag-key: tag-value} to associate with the VPC. Each tag consists of a key name and an associated value. Defaults to None.

    • Key (str, Optional):

      The key of the tag. Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

    • Value(str, Optional):

      The value of the tag. Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

  • db_cluster_identifier (str, Optional) – The identifier of the DB cluster that the instance will belong to. For information on creating a DB cluster, see CreateDBCluster. Type: String. Defaults to None.

  • storage_type (str, Optional) – Specifies the storage type to be associated with the DB instance. Not applicable. Storage is managed by the DB Cluster. Defaults to None.

  • tde_credential_arn (str, Optional) – The ARN from the key store with which to associate the instance for TDE encryption. Defaults to None.

  • tde_credential_password (str, Optional) – The password for the given ARN from the key store in order to access the device. Defaults to None.

  • storage_encrypted (bool, Optional) – 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. Defaults to None.

  • kms_key_id (str, Optional) – 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. Defaults to None.

  • domain (str, Optional) – Specify the Active Directory Domain to create the instance in. Defaults to None.

  • copy_tags_to_snapshot (bool, Optional) – True to copy all tags from the DB instance to snapshots of the DB instance, and otherwise false. The default is false. Defaults to None.

  • monitoring_interval (int, Optional) – 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. Defaults to None.

  • monitoring_role_arn (str, Optional) – 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. Defaults to None.

  • domain_iam_role_name (str, Optional) – Specify the name of the IAM role to be used when making API calls to the Directory Service. Defaults to None.

  • promotion_tier (int, Optional) – 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: 1 Valid Values: 0 - 15. Defaults to None.

  • timezone (str, Optional) – The time zone of the DB instance. Defaults to None.

  • enable_iam_database_authentication (bool, Optional) – Not supported by Neptune (ignored). Defaults to None.

  • enable_performance_insights (bool, Optional) – (Not supported by Neptune). Defaults to None.

  • performance_insights_kms_key_id (str, Optional) – (Not supported by Neptune). Defaults to None.

  • enable_cloudwatch_logs_exports (list[str], Optional) – The list of log types that need to be enabled for exporting to CloudWatch Logs. Defaults to None.

  • deletion_protection (bool, Optional) – 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. Defaults to None.

  • apply_immediately (bool, Optional) – Specifies whether the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB instance. If this parameter is set to false , changes to the DB instance are applied during the next maintenance window. Some parameter changes can cause an outage and are applied on the next call to RebootDBInstance , or the next failure reboot. Default: false

  • allow_major_version_upgrade (bool, Optional) – Indicates that major version upgrades are allowed. Changing this parameter doesn’t result in an outage and the change is asynchronously applied as soon as possible.

  • ca_certificate_identifier (str, Optional) – Indicates the certificate that needs to be associated with the instance.

  • cloudwatch_logs_export_configuration (dict[str, Any], Optional) –

    The configuration setting for the log types to be enabled for export to CloudWatch Logs for a specific DB instance.

    • EnableLogTypes (list[str], Optional):

      The list of log types to enable.

    • DisableLogTypes(list[str], Optional):

      The list of log types to disable.

  • timeout (dict, Optional) –

    Timeout configuration for create/update of AWS DB Instance.

    • create (dict, Optional):

      Timeout configuration for creating DB Cluster.

      • delay(int, Optional):

        The amount of time in seconds to wait between attempts.

      • max_attempts(int, Optional):

        Customized timeout configuration containing delay and max attempts.

    • update(dict, Optional):

      Timeout configuration for updating DB instance.

      • delay(int, Optional):

        The amount of time in seconds to wait between attempts.

      • max_attempts(int, Optional):

        Customized timeout configuration containing delay and max attempts.

Request Syntax:
[idem_test_aws_neptune_db_instance]:
      aws.neptune.db_instance.present:
          - name: 'string'
          - resource_id: 'string'
          - db_instance_identifier: 'string'
          - db_instance_class: 'string'
          - engine: 'string'
          - allocated_storage: 'integer'
          - master_username: 'string'
          - db_security_groups:
                - 'string'
                - 'string'
          - availability_zone: 'string'
          - preferred_maintenance_window: 'string'
          - backup_retention_period: 'integer'
          - preferred_backup_window: 'string'
          - multi_az: 'boolean'
          - engine_version: 'string'
          - auto_minor_version_upgrade: 'boolean'
          - license_model: 'string'
          - publicly_accessible: 'boolean'
          - db_cluster_identifier: 'string'
          - storage_type: 'string'
          - storage_encrypted: 'boolean'
          - kms_key_id: 'string'
          - copy_tags_to_snapshot: 'boolean'
          - monitoring_interval: 'integer'
          - promotion_tier: 'integer'
          - enable_iam_database_authentication: 'boolean'
          - enable_performance_insights: 'boolean'
          - enable_cloudwatch_logs_exports:
            - 'string'
          - db_instance_arn: 'string'
          - deletion_protection: 'boolean'
          - vpc_security_group_ids:
            - 'string'
          - db_parameter_group_name: 'string'
          - option_group_name: 'string'
          - db_subnet_group_name: 'string'
Returns:

Dict[str, Dict[str,Any]]

Examples

database-1-instance-1:
  aws.neptune.db_instance.present:
      - name: database-1-instance-1
      - resource_id: database-1-instance-1
      - db_instance_identifier: database-1-instance-1
      - db_instance_class: db.t3.medium
      - engine: neptune
      - allocated_storage: 1
      - master_username: admin
      - db_security_groups: []
      - availability_zone: ca-central-1d
      - preferred_maintenance_window: sun:03:07-sun:03:37
      - backup_retention_period: 1
      - preferred_backup_window: 06:18-06:48
      - multi_az: false
      - engine_version: 1.1.1.0
      - auto_minor_version_upgrade: true
      - license_model: amazon-license
      - publicly_accessible: false
      - db_cluster_identifier: database-1
      - storage_type: aurora
      - storage_encrypted: true
      - kms_key_id: arn:aws:kms:ca-central-1:746014882121:key/2a4a587a-04fb-4c3b-b4d5-c3f25fb7f69f
      - copy_tags_to_snapshot: false
      - monitoring_interval: 0
      - promotion_tier: 1
      - enable_iam_database_authentication: false
      - enable_performance_insights: false
      - enable_cloudwatch_logs_exports:
        - audit
      - db_instance_arn: arn:aws:rds:ca-central-1:746014882121:db:database-1-instance-1
      - deletion_protection: false
      - vpc_security_group_ids:
        - sg-ad5a2ac5
      - db_parameter_group_name: default.neptune1
      - option_group_name: default:neptune-1-1
      - db_subnet_group_name: default
async idem_aws.states.aws.neptune.db_instance.absent(hub, ctx, name: str, resource_id: str = None, skip_final_snapshot: bool = None, final_db_snapshot_identifier: str = None, timeout: ~types.Timeout configuration.Timeout = None) Dict[str, Any][source]#

Deletes a previously provisioned DB instance.

When you delete a DB instance, all automated backups for that instance are deleted and can’t be recovered. Manual DB snapshots of the DB instance to be deleted by DeleteDBInstance are not deleted. If you request a final DB snapshot the status of the Amazon Neptune DB instance is deleting until the DB snapshot is created. The API action DescribeDBInstance is used to monitor the status of this operation. The action can’t be canceled or reverted once submitted. Note that when a DB instance is in a failure state and has a status of failed, incompatible-restore, or incompatible-network, you can only delete it when the SkipFinalSnapshot parameter is set to true. You can’t delete a DB instance if it is the only instance in the DB cluster, or if it has deletion protection enabled.

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str, Optional) – AWS Neptune DBInstanceIdentifier to identify the resource. This parameter isn’t case- sensitive. Idem automatically considers the resource being absent if resource_id is not specified. Constraints: Must match the name of an existing DB instance.

  • skip_final_snapshot (bool, Optional) – Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB instance is deleted. Note that when a DB instance is in a failure state and has a status of ‘failed’, ‘incompatible-restore’, or ‘incompatible-network’, it can only be deleted when the SkipFinalSnapshot parameter is set to “true”. Specify true when deleting a Read Replica. The FinalDBSnapshotIdentifier parameter must be specified if SkipFinalSnapshot is false. Default: false. Defaults to None.

  • final_db_snapshot_identifier (str, Optional) – The DBSnapshotIdentifier of the new DBSnapshot created when SkipFinalSnapshot is set to false. Specifying this parameter and also setting the SkipFinalShapshot parameter to true results in an error. Constraints: Must be 1 to 255 letters or numbers. First character must be a letter Cannot end with a hyphen or contain two consecutive hyphens Cannot be specified when deleting a Read Replica. Defaults to None.

  • timeout (dict, Optional) –

    Timeout configuration for create/update of AWS DB Instance.

    • delete (dict, Optional):

      Timeout configuration for deleting DB Instance.

      • delay(int, Optional):

        The amount of time in seconds to wait between attempts.

      • max_attempts(int, Optional):

        Customized timeout configuration containing delay and max attempts.

Request Syntax:
[idem_test_aws_neptune_db_instance]:
    aws.neptune.db_instance.absent:
        - name: 'string'
        - resource_id: 'string'
        - skip_final_snapshot: 'boolean'
        - final_db_snapshot_identifier: 'string'
        - timeout:
            delete:
                delay: int
                max_attempts: int
Returns:

Dict[str, Dict[str,Any]]

Examples

database-1-instance-1:
    aws.neptune.db_instance.absent:
        - name: database-1-instance-1
        - resource_id: database-1-instance-1
        - skip_final_snapshot: True
async idem_aws.states.aws.neptune.db_instance.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function.

Returns information about provisioned instances, and supports pagination. This operation can also return information for Amazon RDS instances and Amazon DocDB instances.

Note

Following sensitive parameters are part of present but are not available as part of describe: * master_user_password * tde_credential_password

Following parameter is not part of present and is ignored from describe, idem ensures that the status is in ready state before declaring the resource present: * db_instance_status

Returns:

Dict[str, Dict[str, Any]]

Examples

$ idem describe aws.neptune.db_instance