Learn Idem

Learn Idem

Powered by Idem Project

aws.rds.db_instance

**Autogenerated function**

The DeleteDBInstance action 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
RDS 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.  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 you skip creation of the final snapshot with the SkipFinalSnapshot parameter. If the
specified DB instance is part of an Amazon Aurora DB cluster, you can't delete the DB instance if both of the
following conditions are true:   The DB cluster is a read replica of another Amazon Aurora DB cluster.   The DB
instance is the only instance in the DB cluster.   To delete a DB instance in this case, first call the
PromoteReadReplicaDBCluster API action to promote the DB cluster so it's no longer a read replica. After the
promotion completes, then call the DeleteDBInstance API action to delete the final instance in the DB cluster.

Args:
    ctx:
    hub:
    name(Text): Idem name to identify the resource.
    resource_id(Text): AWS ID to identify the resource.
    skip_final_snapshot(bool, optional): Mention this true if you want to skip creating snapshot default is false.
                                         Either this or final_db_snapshot_identifier should be provided
    final_db_snapshot_identifier(Text, optional): Id for the created final db_snapshot while deleting
    timeout(Dict, optional): Timeout configuration for deletion of AWS DB Instance.
        * delete (Dict) -- Timeout configuration for deletion of a DB Instance
            * delay(int) -- The amount of time in seconds to wait between attempts.Defaults to 30
            * max_attempts(int) -- Customized timeout configuration containing delay and max attempts.Defaults to 60

Returns:
    Dict[str, Any]

Examples:

    .. code-block:: sls

        test-db-instance:
          aws.rds.db_instance.absent:
            - resource_id: test-db-instance,
            - skip_final_snapshot: true
**Autogenerated function**

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


Returns information about provisioned RDS instances. This API supports pagination.  This operation can also
return information for Amazon Neptune DB instances and Amazon DocumentDB instances.


Returns:
    Dict[str, Any]

Examples:

    .. code-block:: bash

        $ idem describe aws.rds.db_instance
**Autogenerated function**

Creates a new DB instance.

Args:
    hub:
    ctx:
    name(Text): Idem name to identify the resource.
    allocated_storage(int): The amount of storage in gibibytes (GiB) to allocate for the DB instance
    db_instance_class(Text): The compute and memory capacity of the DB instance, for example db.m4.large
    engine(Text): The name of the database engine to be used for this instance.
    resource_id(Text, optional): AWS Id of the resource
    db_name(Text, optional): Name of the database
    master_username(Text, optional): The name for the master user.Not required for aurora
    master_user_password(Text, optional): The password for the master user. The password can include any printable
                                         ASCII character except "/", """, or "@".Not required for aurora
    db_security_groups(list, optional): A list of DB security groups to associate with this DB instance.
    vpc_security_group_ids(list, optional): A list of DB security groups to associate with this DB instance.
    availability_zone(Text, optional): The Availability Zone (AZ) where the database will be created.
    db_subnet_group_name(Text, optional): A DB subnet group to associate with this DB instance.
    preferred_maintenance_window(Text, optional): The time range each week during which system maintenance can occur,
                                                 in Universal Coordinated Time (UTC).
    db_parameter_group_name(Text, optional): The name of the DB parameter group to associate with this DB instance.
                                            If you do not specify a value,then the default DB parameter group for
                                            the specified DB engine and version is used.
    backup_retention_period(int, optional): 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.
    preferred_backup_window(Text, optional): The daily time range during which automated backups are created if
                                            automated backups are enabled,using the BackupRetentionPeriod parameter.
    port(int, optional): The port number on which the database accepts connections.
    multi_az(bool, optional): A value that indicates 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.
    engine_version(Text, optional): The version number of the database engine to use.
    auto_minor_version_upgrade(bool, optional): A value that indicates whether minor engine upgrades are applied
                                                automatically to the DB instance during the maintenance window. By
                                                default, minor engine upgrades are applied automatically.
    license_model(Text, optional): License model information for this DB instance.
    iops(int, optional): The amount of Provisioned IOPS (input/output operations per second) to be initially
                         allocated for the DB instance.
    option_group_name(Text, optional): A value that indicates that the DB instance should be associated with the
                                      specified option group.
    character_set_name(Text, optional): For supported engines, this value indicates that the DB instance should be
                                       associated with the specified CharacterSet .
    nchar_character_set_name(Text, optional): The name of the NCHAR character set for the Oracle DB instance.
    publicly_accessible(bool, optional): A value that indicates whether the DB instance is publicly accessible.
    tags(Dict or List, optional): Dict in the format of {tag-key: tag-value} or List of tags in the format of
        [{"Key": tag-key, "Value": tag-value}] to associate with the DB instance.
        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(Text, optional): The identifier of the DB cluster that the instance will belong to.
    storage_type(Text, optional): Specifies the storage type to be associated with the DB instance.
    tde_credential_arn(Text, optional): The ARN from the key store with which to associate the instance for TDE
                                       encryption.
    tde_credential_password(Text, optional): The password for the given ARN from the key store in order to access the
                                            device.
    storage_encrypted(bool, optional): A value that indicates whether the DB instance is encrypted. By default, it
                                       isn't encrypted
    kms_key_id(Text, optional): The Amazon Web Services KMS key identifier for an encrypted DB instance.
    domain(Text, optional): The Active Directory, directory ID to create the DB instance in
    copy_tags_to_snapshot(Text, optional): A value that indicates whether to copy tags from the DB instance to
                                          snapshots of the DB instance. By default, tags are not copied.
    monitoring_interval(int, optional): 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. The default is 0.
                                        If MonitoringRoleArn is specified, then you must set MonitoringInterval to
                                        a value other than 0.
    monitoring_role_arn(Text, optional): The ARN for the IAM role that permits RDS to send enhanced monitoring metrics
                                        to Amazon CloudWatch Logs.
    domain_iam_role_name(Text, optional): Specify the name of the IAM role to be used when making API calls to the
                                         Directory Service.
    promotion_tier(int, optional): A value that specifies the order in which an Aurora Replica is promoted to the
                                   primary instance after a failure of the existing primary instance.
    timezone(Text, optional): The time zone of the DB instance.
    enable_iam_database_authentication(bool, optional): A value that indicates whether to enable mapping of Amazon
                                                        Web Services Identity and Access Management (IAM) accounts
                                                        to database accounts. By default, mapping isn't enabled.
    enable_performance_insights(bool, optional): A value that indicates whether to enable Performance Insights for the DB instance.
    performance_insights_kms_key_id(Text, optional): The Amazon Web Services KMS key identifier for encryption of
                                                    Performance Insights data.
    performance_insights_retention_period(int, optional): The amount of time, in days, to retain Performance
                                                          Insights data.
    enable_cloudwatch_logs_exports(List, optional):The list of log types that need to be enabled for exporting to
                                                   CloudWatch Logs. The values in the list depend on the DB engine.
    processor_features(List[Dict[str, Any]], optional): 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 RDS Custom. Defaults to None.
        * Name (str, optional): The name of the processor feature. Valid names are coreCount and threadsPerCore.
        * Value (str, optional): The value of a processor feature name.
    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 isn't enabled.
    max_allocated_storage(int, optional): The upper limit in gigabytes (GiB) to which Amazon RDS can automatically
                                          scale the storage of the DB instance.
    enable_customer_owned_ip(bool, optional): A value that indicates whether to enable a customer-owned IP address
                                              (CoIP) for an RDS on Outposts DB instance.
    custom_iam_instance_profile(Text, optional): The instance profile associated with the underlying Amazon EC2
                                                instance of an RDS Custom DB instance.
    backup_target(Text, optional):  Value to specify where automated backups and manual snapshots are stored.

    # parameters for the modify function
    apply_immediately(bool, optional): A value that indicates 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.
                                       By default, this parameter is disabled.
    allow_major_version_upgrades(bool, optional): A value that indicates whether major version upgrades are allowed.
                                                  Changing this parameter doesn't result in an outage and the change
                                                  is asynchronously applied as soon as possible.
    cloudwatch_logs_export_configuration(Dict, optional): The configuration setting for the log types to be enabled
                                                          for export to CloudWatch Logs for a specific DB instance.
    ca_certificate_identifier(Text, optional): The identifier of the CA certificate for the DB instance.
    use_default_processor_features(bool, optional): A value that indicates whether the DB instance class of the DB
                                                    instance uses its default processor features.
    certificate_rotation_restart(bool, optional): A value that indicates whether the DB instance is restarted when
                                                  you rotate your SSL/TLS certificate.
    replica_mode(Text, optional):A value that sets the open mode of a replica database to either mounted or read-only
    aws_backup_recovery_point_arn(Text, optional): The Amazon Resource Name (ARN) of the recovery point in Amazon Web
                                                  Services Backup.
    automation_mode(Text, optional): The automation mode of the RDS Custom DB instance: full or all paused .
    resume_full_automation_mode_minutes(int, optional):The number of minutes to pause the automation. When the time
                                                        period ends, RDS Custom resumes full automation
    timeout(Dict, optional): Timeout configuration for create/update of AWS DB Cluster.
        * create (Dict) -- Timeout configuration for creating DB Instance
            * delay(int) -- The amount of time in seconds to wait between attempts.Defaults to 30
            * max_attempts(int) -- Customized timeout configuration containing delay and max attempts.Defaults to 60
        * update (Dict) -- Timeout configuration for updating DB Instance
            * delay(int) -- The amount of time in seconds to wait between attempts.Defaults to 30
            * max_attempts(int) -- Customized timeout configuration containing delay and max attempts.Defaults to 60


Request Syntax:
    [db-instance-name]:
      aws.rds.db_instance.present:
      - db_instance_class: 'string'
      - engine: 'string'
      - resource_id: 'string'
      - availability_zone: 'string'
      - preferred_maintenance_window: 'string'
      - multi_az: 'bool'
      - engine_version: 'string'
      - auto_minor_version_upgrade: 'bool'
      - license_model: 'string'
      - publicly_accessible: 'bool'
      - db_cluster_identifier: 'string'
      - storage_type: 'string'
      - storage_encrypted: 'bool'
      - copy_tags_to_snapshot: 'bool'
      - monitoring_interval: 'int'
      - monitoring_role_arn: 'string'
      - promotion_tier: 'int'
      - enable_performance_insights: 'bool'
      - performance_insights_kms_key_id: 'string'
      - performance_insights_retention_period: 'int'
      - backup_target: 'string'
      - vpc_security_group_id: 'List'
      - db_subnet_group_name: 'string'
      - db_parameter_group_name: 'string'
      - option_group_name: 'string'
      - tags: 'List'
      - timeout: 'Dict'

Returns:
    Dict[str, Any]

Examples:

    .. code-block:: sls

          instance-1:
            aws.rds.db_instance.present:
            - db_instance_class: db.r5.large
            - engine: aurora-postgresql
            - availability_zone: us-east-2b
            - preferred_maintenance_window: sat:04:15-sat:04:45
            - multi_az: false
            - engine_version: '12.7'
            - auto_minor_version_upgrade: true
            - license_model: postgresql-license
            - publicly_accessible: false
            - db_cluster_identifier: db-cluster-1
            - storage_type: aurora
            - storage_encrypted: true
            - copy_tags_to_snapshot: false
            - monitoring_interval: 60
            - monitoring_role_arn: arn:aws:iam::537227425989:role/rds-monitoring-role
            - promotion_tier: 1
            - enable_performance_insights: true
            - performance_insights_kms_key_id: arn:aws:kms:us-east-2:537227425989:key/e9e79921-8dda-48d7-afd7-38a64dd8e9b1
            - performance_insights_retention_period: 7
            - backup_target: region
            - vpc_security_group_id:
              - sg-f5eeba9c
            - db_subnet_group_name: default
            - db_parameter_group_name: default.aurora-postgresql12
            - option_group_name: default:aurora-postgresql-12
            - tags:
              - Key: name
                Value: value
            - timeout:
                create:
                  delay: 10
                  max_attempts: 30

Full plugin documentation is available on the Idem documentation site - aws.rds.db_instance .

Last updated on 20 Sep 2022
 Edit on GitHub