amazon.cloud.rds_db_instance module – Creates and manages resource creates an Amazon DB instance
Note
This module is part of the amazon.cloud collection (version 0.4.0).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install amazon.cloud
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: amazon.cloud.rds_db_instance
.
New in amazon.cloud 0.3.0
Synopsis
Creates and manages resource creates an Amazon DB instance.
The new DB instance can be an RDS DB instance, or it can be a DB instance in an Aurora DB cluster.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.9
boto3 >= 1.25.0
botocore >= 1.28.0
jsonpatch
Parameters
Parameter |
Comments |
---|---|
AWS access key ID. See the AWS documentation for more information about access tokens https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys. The The aws_access_key and profile options are mutually exclusive. The aws_access_key_id alias was added in release 5.1.0 for consistency with the AWS botocore SDK. The ec2_access_key alias has been deprecated and will be removed in a release after 2024-12-01. Support for the |
|
The amount of storage (in gigabytes) to be initially allocated for the database instance. |
|
A value that indicates whether major version upgrades are allowed. Changing this parameter doesnt result in an outage and the change is asynchronously applied as soon as possible. Choices:
|
|
The AWS Identity and Access Management (IAM) roles associated with the DB instance. |
|
The name of the feature associated with the AWS Identity and Access Management (IAM) role. IAM roles that are associated with a DB instance grant permission for the DB instance to access other AWS services on your behalf. |
|
The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance. |
|
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. Choices:
|
|
The Availability Zone (AZ) where the database will be created. For information on AWS Regions and Availability Zones. |
|
The location of a CA Bundle to use when validating SSL certificates. The |
|
A dictionary to modify the botocore configuration. Parameters can be found in the AWS documentation https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config. |
|
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. Default: |
|
The identifier of the CA certificate for this DB instance. |
|
Returns the details of the DB instances server certificate. |
|
A value that indicates whether the DB instance is restarted when you rotate your SSL/TLS certificate. By default, the DB instance is restarted when you rotate your SSL/TLS certificate. The certificate is not updated until the DB instance is restarted. If you are using SSL/TLS to connect to the DB instance, follow the appropriate instructions for your DB engine to rotate your SSL/TLS certificate. This setting doesnt apply to RDS Custom. Choices:
|
|
For supported engines, indicates that the DB instance should be associated with the specified character set. |
|
A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied. Choices:
|
|
The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance. The instance profile must meet the following requirements:. * The profile must exist in your account. * The profile must have an IAM role that Amazon EC2 has permissions to assume. * The instance profile name and the associated IAM role name must start with the prefix AWSRDSCustom . For the list of permissions required for the IAM role, see Configure IAM and your VPC in the Amazon RDS User Guide . This setting is required for RDS Custom. |
|
The identifier of the DB cluster that the instance will belong to. |
|
The identifier for the RDS for MySQL Multi-AZ DB cluster snapshot to restore from. For more information on Multi-AZ DB clusters, see Multi-AZ deployments with two readable standby DB instances in the Amazon RDS User Guide . Constraints:. * Must match the identifier of an existing Multi-AZ DB cluster snapshot. * Cant be specified when DBSnapshotIdentifier is specified. * Must be specified when DBSnapshotIdentifier isnt specified. * If you are restoring from a shared manual Multi-AZ DB cluster snapshot, the DBClusterSnapshotIdentifier must be the ARN of the shared snapshot. * Cant be the identifier of an Aurora DB cluster snapshot. * Cant be the identifier of an RDS for PostgreSQL Multi-AZ DB cluster snapshot. |
|
The compute and memory capacity of the DB instance, for example, db.m4.large. Not all DB instance classes are available in all AWS Regions, or for all database engines. |
|
A name for the DB instance. If you specify a name, AWS CloudFormation converts it to lowercase. If you dont specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the DB instance. |
|
The meaning of this parameter differs according to the database engine you use. |
|
The name of an existing DB parameter group or a reference to an AWS::RDS::DBParameterGroup resource created in the template. |
|
A list of the DB security groups to assign to the DB instance. The list can include both the name of existing DB security groups or references to AWS::RDS::DBSecurityGroup resources created in the template. |
|
The name or Amazon Resource Name (ARN) of the DB snapshot thats used to restore the DB instance. If youre restoring from a shared manual DB snapshot, you must specify the ARN of the snapshot. |
|
A DB subnet group to associate with the DB instance. If you update this value, the new subnet group must be a subnet group in a new VPC. |
|
Use a The Choices:
|
|
A value that indicates whether to remove automated backups immediately after the DB instance is deleted. This parameter isnt case-sensitive. The default is to remove automated backups immediately after the DB instance is deleted. Choices:
|
|
A value that indicates whether the DB instance has deletion protection enabled. The database cant be deleted when deletion protection is enabled. By default, deletion protection is disabled. Choices:
|
|
The Active Directory directory ID to create the DB instance in. Currently, only MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances can be created in an Active Directory Domain. |
|
Specify the name of the IAM role to be used when making API calls to the Directory Service. |
|
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 being used. |
|
A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. By default, mapping is disabled. Choices:
|
|
A value that indicates whether to enable Performance Insights for the DB instance. Choices:
|
|
Specifies the connection endpoint. |
|
URL to connect to instead of the default AWS endpoints. While this can be used to connection to other AWS-compatible services the amazon.aws and community.aws collections are only tested against AWS. The The ec2_url and s3_url aliases have been deprecated and will be removed in a release after 2024-12-01. Support for the |
|
The name of the database engine that you want to use for this DB instance. |
|
The version number of the database engine to use. |
|
Cancel IN_PROGRESS and PENDING resource requestes. Because you can only perform a single operation on a given resource at a time, there might be cases where you need to cancel the current resource operation to make the resource available so that another operation may be performed on it. Choices:
|
|
The number of I/O operations per second (IOPS) that the database provisions. |
|
The ARN of the AWS Key Management Service (AWS KMS) master key thats used to encrypt the DB instance. |
|
License model information for this DB instance. |
|
A value that indicates whether to manage the master user password with AWS Secrets Manager. Choices:
|
|
The password for the master user. |
|
Contains the secret managed by RDS in AWS Secrets Manager for the master user password. |
|
The AWS KMS key identifier that is used to encrypt the secret. |
|
The master user name for the DB instance. |
|
The upper limit to which Amazon RDS can automatically scale the storage of the DB instance. |
|
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. Default: |
|
The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to Amazon CloudWatch Logs. |
|
Specifies whether the database instance is a multiple Availability Zone deployment. Choices:
|
|
The name of the NCHAR character set for the Oracle DB instance. This parameter doesnt apply to RDS Custom. |
|
The network type of the DB cluster. |
|
Indicates that the DB instance should be associated with the specified option group. |
|
The AWS KMS key identifier for encryption of Performance Insights data. The KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS encryption key. |
|
The amount of time, in days, to retain Performance Insights data. Valid values are 7 or 731 (2 years). |
|
The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter. |
|
he weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). |
|
The number of CPU cores and the number of threads per core for the DB instance class of the DB instance. |
|
The name of the processor feature. Valid names are coreCount and threadsPerCore. Choices:
|
|
The value of a processor feature name. |
|
A named AWS profile to use for authentication. See the AWS documentation for more information about named profiles https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html. The The profile option is mutually exclusive with the aws_access_key, aws_secret_key and security_token options. |
|
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. Default: |
|
Indicates whether the DB instance is an internet-facing instance. If you specify true, AWS CloudFormation creates an instance with a publicly resolvable DNS name, which resolves to a public IP address. If you specify false, AWS CloudFormation creates an internal instance with a DNS name that resolves to a private IP address. Choices:
|
|
Remove tags not listed in tags. Choices:
|
|
The AWS region to use. For global services such as IAM, Route53 and CloudFront, region is ignored. The See the Amazon AWS documentation for more information http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region. The Support for the |
|
The open mode of an Oracle read replica. The default is open-read-only. |
|
The date and time to restore from. |
|
AWS secret access key. See the AWS documentation for more information about access tokens https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys. The The secret_key and profile options are mutually exclusive. The aws_secret_access_key alias was added in release 5.1.0 for consistency with the AWS botocore SDK. The ec2_secret_key alias has been deprecated and will be removed in a release after 2024-12-01. Support for the |
|
AWS STS session token for use with temporary credentials. See the AWS documentation for more information about access tokens https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys. The The security_token and profile options are mutually exclusive. Aliases aws_session_token and session_token were added in release 3.2.0, with the parameter being renamed from security_token to session_token in release 6.0.0. The security_token, aws_security_token, and access_token aliases have been deprecated and will be removed in a release after 2024-12-01. Support for the |
|
The Amazon Resource Name (ARN) of the replicated automated backups from which to restore. |
|
If you want to create a Read Replica DB instance, specify the ID of the source DB instance. Each DB instance can have a limited number of Read Replicas. |
|
The resource ID of the source DB instance from which to restore. |
|
The ID of the region that contains the source DB instance for the Read Replica. |
|
Goal state for resource. state=present creates the resource if it doesn’t exist, or updates to the provided state if the resource already exists. state=absent ensures an existing instance is deleted. state=list get all the existing resources. state=describe or state=get retrieves information on an existing resource. Choices:
|
|
A value that indicates whether the DB instance is encrypted. By default, it isnt encrypted. Choices:
|
|
Specifies the storage throughput for the DB instance. |
|
Specifies the storage type to be associated with the DB instance. |
|
A dict of tags to apply to the resource. To remove all tags set tags={} and purge_tags=true. |
|
The ARN from the key store with which to associate the instance for TDE encryption. |
|
The password for the given ARN from the key store in order to access the device. |
|
The time zone of the DB instance. The time zone parameter is currently supported only by Microsoft SQL Server. |
|
A value that indicates whether the DB instance class of the DB instance uses its default processor features. Choices:
|
|
A value that indicates whether the DB instance is restored from the latest backup time. By default, the DB instance isnt restored from the latest backup time. Choices:
|
|
When set to Setting validate_certs=false is strongly discouraged, as an alternative, consider setting aws_ca_bundle instead. Choices:
|
|
A list of the VPC security group IDs to assign to the DB instance. The list can include both the physical IDs of existing VPC security groups and references to AWS::EC2::SecurityGroup resources created in the template. |
|
Wait for operation to complete before returning. Choices:
|
|
How many seconds to wait for an operation to complete before timing out. Default: |
Notes
Note
Caution: For modules, environment variables and configuration files are read from the Ansible ‘host’ context and not the ‘controller’ context. As such, files may need to be explicitly copied to the ‘host’. For lookup and connection plugins, environment variables and configuration files are read from the Ansible ‘controller’ context and not the ‘host’ context.
The AWS SDK (boto3) that Ansible uses may also read defaults for credentials and other settings, such as the region, from its configuration files in the Ansible ‘host’ context (typically
~/.aws/credentials
). See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html for more information.
Examples
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
When state=list, it is a list containing dictionaries of resource information. Otherwise, it is a dictionary of resource information. When state=absent, it is an empty dictionary. Returned: always |
|
The unique identifier of the resource. Returned: success |
|
The resource properties. Returned: success |