AWS CLI RDS create-db-instance - Unknown options: groups, Subnet

0

Hi everyone, I am trying to write a bash script and using the AWS CLI in a Linux environment to automate the creation of some AWS infrastructure. I am trying to use the aws rds create-db-instance command to create my RDS instance but I am running into an error: Unknown options: groups, Subnet

I have done some research and know that the groups and Subnet options are from AWS CLI v1 and is depreciated but I am using the latest version of AWS CLI and do not use those options in my command.

Interestingly enough if I run this command outside my bash script in my Linux terminal it does not have this issue and the RDS instance is created.

Any suggestions or ideas would be greatly appreciated thank you.

aws --version aws-cli/2.10.1 Python/3.9.11 Linux/5.10.16.3-microsoft-standard-WSL2 exe/x86_64.ubuntu.22 prompt/off

aws rds create-db-instance
--debug
--db-name $rds_db_name
--db-instance-identifier $rds_identifier
--allocated-storage $rds_allocated_storage
--db-instance-class $rds_instance_class
--engine $rds_engine
--master-username $rds_master_username
--master-user-password $rds_master_user_password
--vpc-security-group-ids $security_group_id_db
--db-subnet-group-name $subnet_group_name

Debug logs

2023-02-19 09:58:27,509 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f2265ee7040> 2023-02-19 09:58:27,509 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0x7f2265a4e160> 2023-02-19 09:58:27,509 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0x7f2265bd7e50> 2023-02-19 09:58:27,509 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.devcommands.CLIDevCommand'>> 2023-02-19 09:58:27,509 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0x7f2265a473a0> 2023-02-19 09:58:27,510 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f22657a0190>> 2023-02-19 09:58:27,510 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.10.1/dist/awscli/data/cli.json 2023-02-19 09:58:27,513 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0x7f2265b0d0d0> 2023-02-19 09:58:27,513 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0x7f2265b0dc10> 2023-02-19 09:58:27,513 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0x7f2265b0db80> 2023-02-19 09:58:27,513 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0x7f2265b0dd30> 2023-02-19 09:58:27,513 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0x7f2265b0dca0> 2023-02-19 09:58:27,513 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0x7f22657a9b80> 2023-02-19 09:58:27,514 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.10.1 Python/3.9.11 Linux/5.10.16.3-microsoft-standard-WSL2 exe/x86_64.ubuntu.22 prompt/off 2023-02-19 09:58:27,514 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['rds', 'create-db-instance', '--debug', '--db-name', 'bookstack_db', '--db-instance-identifier', 'Assignment2-rds', '--allocated-storage', '5', '--db-instance-class', 'db.m6i.large', '--engine', 'mysql', '--master-username', 'root', '--master-user-password', 'password', '--vpc-security-group-ids', 'sg-044926a269ca7870c', '--db-subnet-group-name', 'RDS', 'Subnet', 'group'] 2023-02-19 09:58:27,514 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x7f2265abadc0> 2023-02-19 09:58:27,514 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7f2266354dc0> 2023-02-19 09:58:27,514 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x7f22657e4670> 2023-02-19 09:58:27,514 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0x7f22663510d0> 2023-02-19 09:58:27,515 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7f2266337ca0> 2023-02-19 09:58:27,516 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/ 2023-02-19 09:58:27,518 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x7f2265bd7d30> 2023-02-19 09:58:27,518 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x7f2265e43ee0> 2023-02-19 09:58:27,531 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.10.1/dist/awscli/botocore/data/rds/2014-10-31/service-2.json 2023-02-19 09:58:27,540 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.10.1/dist/awscli/botocore/data/rds/2014-10-31/service-2.sdk-extras.json 2023-02-19 09:58:27,547 - MainThread - botocore.hooks - DEBUG - Event building-command-table.rds: calling handler <function _building_command_table at 0x7f2265b25e50> 2023-02-19 09:58:27,548 - MainThread - botocore.hooks - DEBUG - Event building-command-table.rds: calling handler <function _add_generate_db_auth_token at 0x7f2265b25ca0> 2023-02-19 09:58:27,548 - MainThread - botocore.hooks - DEBUG - Event building-command-table.rds: calling handler <function add_waiters at 0x7f2265a473a0> 2023-02-19 09:58:27,559 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.10.1/dist/awscli/botocore/data/rds/2014-10-31/waiters-2.json 2023-02-19 09:58:27,561 - MainThread - botocore.hooks - DEBUG - Event building-command-table.rds: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f22657a0190>> 2023-02-19 09:58:27,564 - MainThread - awscli.clidriver - DEBUG - OrderedDict([('db-name', <awscli.arguments.CLIArgument object at 0x7f2264fa9550>), ('db-instance-identifier', <awscli.arguments.CLIArgument object at 0x7f2264fa9580>), ('allocated-storage', <awscli.arguments.CLIArgument object at 0x7f2264f43070>), ('db-instance-class', <awscli.arguments.CLIArgument object at 0x7f2264f430a0>), ('engine', <awscli.arguments.CLIArgument object at 0x7f2264f430d0>), ('master-username', <awscli.arguments.CLIArgument object at 0x7f2264f43100>), ('master-user-password', <awscli.arguments.CLIArgument object at 0x7f2264f43130>), ('db-security-groups', <awscli.arguments.ListArgument object at 0x7f2264f43160>), ('vpc-security-group-ids', <awscli.arguments.ListArgument object at 0x7f2264f43190>), ('availability-zone', <awscli.arguments.CLIArgument object at 0x7f2264f431c0>), ('db-subnet-group-name', <awscli.arguments.CLIArgument object at 0x7f2264f431f0>), ('preferred-maintenance-window', <awscli.arguments.CLIArgument object at 0x7f2264f43220>), ('db-parameter-group-name', <awscli.arguments.CLIArgument object at 0x7f2264f43250>), ('backup-retention-period', <awscli.arguments.CLIArgument object at 0x7f2264f43280>), ('preferred-backup-window', <awscli.arguments.CLIArgument object at 0x7f2264f432b0>), ('port', <awscli.arguments.CLIArgument object at 0x7f2264f432e0>), ('multi-az', <awscli.arguments.BooleanArgument object at 0x7f2264f43310>), ('no-multi-az', <awscli.arguments.BooleanArgument object at 0x7f2264f43340>), ('engine-version', <awscli.arguments.CLIArgument object at 0x7f2264f43370>), ('auto-minor-version-upgrade', <awscli.arguments.BooleanArgument object at 0x7f2264f433a0>), ('no-auto-minor-version-upgrade', <awscli.arguments.BooleanArgument object at 0x7f2264f433d0>), ('license-model', <awscli.arguments.CLIArgument object at 0x7f2264f43400>), ('iops', <awscli.arguments.CLIArgument object at 0x7f2264f43430>), ('option-group-name', <awscli.arguments.CLIArgument object at 0x7f2264f43460>), ('character-set-name', <awscli.arguments.CLIArgument object at 0x7f2264f43490>), ('nchar-character-set-name', <awscli.arguments.CLIArgument object at 0x7f2264f434c0>), ('publicly-accessible', <awscli.arguments.BooleanArgument object at 0x7f2264f434f0>), ('no-publicly-accessible', <awscli.arguments.BooleanArgument object at 0x7f2264f43520>), ('tags', <awscli.arguments.ListArgument object at 0x7f2264f43550>), ('db-cluster-identifier', <awscli.arguments.CLIArgument object at 0x7f2264f43580>), ('storage-type', <awscli.arguments.CLIArgument object at 0x7f2264f435b0>), ('tde-credential-arn', <awscli.arguments.CLIArgument object at 0x7f2264f435e0>), ('tde-credential-password', <awscli.arguments.CLIArgument object at 0x7f2264f43610>), ('storage-encrypted', <awscli.arguments.BooleanArgument object at 0x7f2264f43640>), ('no-storage-encrypted', <awscli.arguments.BooleanArgument object at 0x7f2264f43670>), ('kms-key-id', <awscli.arguments.CLIArgument object at 0x7f2264f436a0>), ('domain', <awscli.arguments.CLIArgument object at 0x7f2264f436d0>), ('copy-tags-to-snapshot', <awscli.arguments.BooleanArgument object at 0x7f2264f43700>), ('no-copy-tags-to-snapshot', <awscli.arguments.BooleanArgument object at 0x7f2264f43730>), ('monitoring-interval', <awscli.arguments.CLIArgument object at 0x7f2264f43760>), ('monitoring-role-arn', <awscli.arguments.CLIArgument object at 0x7f2264f43790>), ('domain-iam-role-name', <awscli.arguments.CLIArgument object at 0x7f2264f437c0>), ('promotion-tier', <awscli.arguments.CLIArgument object at 0x7f2264f437f0>), ('timezone', <awscli.arguments.CLIArgument object at 0x7f2264f43820>), ('enable-iam-database-authentication', <awscli.arguments.BooleanArgument object at 0x7f2264f43850>), ('no-enable-iam-database-authentication', <awscli.arguments.BooleanArgument object at 0x7f2264f43880>), ('enable-performance-insights', <awscli.arguments.BooleanArgument object at 0x7f2264f438b0>), ('no-enable-performance-insights', <awscli.arguments.BooleanArgument object at 0x7f2264f438e0>), ('performance-insights-kms-key-id', <awscli.arguments.CLIArgument object at 0x7f2264f43910>), ('performance-insights-retention-period', <awscli.arguments.CLIArgument object at 0x7f2264f43940>), ('enable-cloudwatch-logs-exports', <awscli.arguments.ListArgument object at 0x7f2264f43970>), ('processor-features', <awscli.arguments.ListArgument object at 0x7f2264f439a0>), ('deletion-protection', <awscli.arguments.BooleanArgument object at 0x7f2264f439d0>), ('no-deletion-protection', <awscli.arguments.BooleanArgument object at 0x7f2264f43a00>), ('max-allocated-storage', <awscli.arguments.CLIArgument object at 0x7f2264f43a30>), ('enable-customer-owned-ip', <awscli.arguments.BooleanArgument object at 0x7f2264f43a60>), ('no-enable-customer-owned-ip', <awscli.arguments.BooleanArgument object at 0x7f2264f43a90>), ('custom-iam-instance-profile', <awscli.arguments.CLIArgument object at 0x7f2264f43ac0>), ('backup-target', <awscli.arguments.CLIArgument object at 0x7f2264f43af0>), ('network-type', <awscli.arguments.CLIArgument object at 0x7f2264f43b20>), ('storage-throughput', <awscli.arguments.CLIArgument object at 0x7f2264f43b50>), ('manage-master-user-password', <awscli.arguments.BooleanArgument object at 0x7f2264f43b80>), ('no-manage-master-user-password', <awscli.arguments.BooleanArgument object at 0x7f2264f43bb0>), ('master-user-secret-kms-key-id', <awscli.arguments.CLIArgument object at 0x7f2264f43be0>), ('ca-certificate-identifier', <awscli.arguments.CLIArgument object at 0x7f2264f43c10>)]) 2023-02-19 09:58:27,565 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.rds.create-db-instance: calling handler <function add_streaming_output_arg at 0x7f2265abf0d0> 2023-02-19 09:58:27,565 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.rds.create-db-instance: calling handler <function add_cli_input_json at 0x7f226633d4c0> 2023-02-19 09:58:27,565 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.rds.create-db-instance: calling handler <function add_cli_input_yaml at 0x7f226633d700> 2023-02-19 09:58:27,565 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.rds.create-db-instance: calling handler <function unify_paging_params at 0x7f2265e50820> 2023-02-19 09:58:27,577 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.10.1/dist/awscli/botocore/data/rds/2014-10-31/paginators-1.json 2023-02-19 09:58:27,578 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.rds.create-db-instance: calling handler <function add_generate_skeleton at 0x7f2265b01670> 2023-02-19 09:58:27,579 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.rds.create-db-instance: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x7f2264f43d00>> 2023-02-19 09:58:27,579 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.rds.create-db-instance: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x7f2264f43d30>> 2023-02-19 09:58:27,579 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.rds.create-db-instance: calling handler <bound method GenerateCliSkeletonArgument.override_required_args of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7f2264f43dc0>> 2023-02-19 09:58:27,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.rds_create-db-instance: calling handler <function add_waiters at 0x7f2265a473a0> 2023-02-19 09:58:27,579 - MainThread - botocore.hooks - DEBUG - Event building-command-table.rds_create-db-instance: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f22657a0190>> 2023-02-19 09:58:27,582 - MainThread - awscli.clidriver - DEBUG - Exception caught in main() Traceback (most recent call last): File "awscli/clidriver.py", line 460, in main File "awscli/clidriver.py", line 595, in call File "awscli/clidriver.py", line 764, in call awscli.arguments.UnknownArgumentError: Unknown options: group, Subnet

asked a year ago636 views
1 Answer
1
Accepted Answer

This is from your debug log above

[
  'rds', 
  'create-db-instance',
   '--debug',
   '--db-name', 'bookstack_db',
   '--db-instance-identifier', 'Assignment2-rds',
   '--allocated-storage', '5',
   '--db-instance-class', 'db.m6i.large',
   '--engine', 'mysql', 
  '--master-username', 'root',
   '--master-user-password', 'password',
   '--vpc-security-group-ids', 'sg-044926a269ca7870c',
   '--db-subnet-group-name', 'RDS', 'Subnet', 'group'
] 

You are passing multiple (3) values to the db-subnet-group-name parameter.

I guess in the bash code where you fill $subnet_group_name you are getting an array.

Regards, Jacco

profile picture
JaccoPK
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions