DynamoDB PowerShell: can't create local table in selected region - node.js

I'm trying to create a table in a local instance of DynamoDB using PowerShell cmdlets. In VS AWS Explorer I created a DDB instance and bound it to port:10000. Right after that, the new DB was created where name is KEYID_us-east-1.db
In the PS script, I'm setting up the AWS context and the table to create it in eu-central-1 region. Despite this, the new table is created in us-east-1 db, so the PS cmdlet ignored my region settings and used default one.
In the mean time, when I specify a different region in NodeJS, but the same endpoint that I use in PS script, after accessing the db, the new DB appears with region that I specified.
Why does this happen?

Please refer the "Notes" section on the below link. Looks like the local dynamodb instance use the region to create the database file. However, the local instance is not using the region effectively in the same way as AWS remote dynamodb instance.
"Bullet Point : 2 - The values that you supply for the AWS access key and the Region are only used to name the database file."
https://aws.amazon.com/blogs/aws/dynamodb-local-for-desktop-development/

Related

Creating aws aurora with 'require_secure_transport'

According to this doc :
You can require that all user connections to your Aurora MySQL DB cluster use SSL/TLS by using the require_secure_transport DB cluster parameter.
Been looking through terraform docs and samples. Not seeing if this setting is available.
Does terraform have a method to set arbitrary values if they aren't supported as module params?
#ethrbunny If my guess is not wrong, you are trying to set SSL/TLS connection for mysql DB cluster in aws aurora using terraform? I guess for this first you need to create custom DB cluster parameter group in aws aurora and specify that group name in your terraform module.
Reference :
Terraform Registery Look for 'db_cluster_parameter_group_name' tag
Terraform aws aurora github link
As per AWS document we can set this parameter in a custom DB cluster parameter group. The parameter isn't available in DB instance parameter groups.
Reference : aws aurora documentation refer 'Notes' section
The require_secure_transport parameter is only available for Aurora MySQL version 5.7. You can set this parameter in a custom DB cluster parameter group. The parameter isn't available in DB instance parameter groups.

AWS RDS Network & Security panel not visible

I'm new to AWS and I'm having trouble connecting to an Aurora (Postgres compatible) database that I've created.
I can connect to it via the AWS CLI using the following command:
aws rds-data execute-statement --resource-arn "<my rds cluster ARN>" --database "<My database>" --secret-arn "<My secret in the secret manager>" --sql "select count(*) from information_schema.tables" --profile <my profile>
and this returns a result of 175 which is correct (the same result I get if I run this in the query editor tool in the AWS console.
I then put together a little C# console app and referenced the Npgsql.EntityFrameworkCore.PostgreSQL nuget package as suggested in the AWS docs. When I run it on my PC I get a connection timeout exception.
var connectionString = "Server=<My db cluster>; Database=<database name>; User ID=<my user id>; Password=<my password>; Port=5432";
using (var connection = new NpgsqlConnection(connectionString))
{
var sql = "select count(*) from information_schema.tables";
return connection.ExecuteScalar(sql).ToString();
}
When trying to troubleshoot the problem lots of AWS docs & videos suggest setting the Public accessibility property to true by selecting the Db in the RDS console, choosing modify and setting the Public accessibility property.
The only problem is, when I choose to modify the DB, that panel is not visible. The AWS docs & videos do go on to talk about changing inbound rules and whatnot in VPC and subnets but not before they've changed the Public accessibility property.
Can anyone advise please?
In case this helps a future reader and as I stated in my comment. The DB in question was created with a capacity type of "Serverless" instead of "Provisioned". Serverless Aurora DB's have all sorts of different characteristics: docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/… One of the characteristics is that they can't be set to publicly accessible.

Is it possible to create an RDS instance in different Region using Terraform (using snapshot of original DB)

I have my production site in us-east-1 region whereas the DR site in us-east-2 region.
We are using terraform to configure the environment but now stuck at the DB part.
We want to copy the snapshots of our DB from us-east-1 region to the us-east-2 region using terraform.
We want to create RDS instance using this copied snapshot in us-east-2 region.
Ultimate Goal --> To create a database in us-east-2 region using a snapshot which is available in us-east-1 region, and all this should be done using terraform.
I have not used the following one to cross-region copy but you could use the following.
aws_backup_plan link1 This is to setup backup and used to cross-region copy
aws_db_instance link2 This can be used to create the RDS instance.

Listing tags for Amazon Aurora DB cluster snapshots

I have an Amazon Aurora DB cluster with snapshots enabled.
I am adding tags to the snapshots and I am having trouble retrieving them, both through the aws cli and the Java API.
The tags are successfully added to the snapshots, and are visible in the Amazon RDS Dashboard Snapshots section.
Looking at the documentation here, I have to compose the ARN for the snapshot instance, and use that in the call.
So if the snapshot name (as displayed in the dashboard) is mysnapshot-1234, the ARN should look something like this:
arn:aws:rds:my_region:my_customer_id:snapshot:mysnapshot-1234
The aws cli call looks like this:
aws rds list-tags-for-resource --resource-name arn:aws:rds:my_region:my_customer_id:snapshot:mysnapshot-1234
and it results in:
A client error (InvalidParameterValue) occurred when calling the
ListTagsForResource operation: Unable to find a snapshot matching the
resource name: mysnapshot-1234
Am I composing the ARN properly? Any other idea how to get this to work?
I'm thinking I'm either using the wrong snapshot ID or there is a bug in their API.
The documentation was updated in the meantime, and the culprit was the fact that I was using the "snapshot" selector instead of "cluster-snapshot" (Aurora snapshots are created at a cluster level, not at a DB level).
So using the right selector I am able to list the tags:
arn:aws:rds:my_region:my_customer_id:cluster-snapshot:mysnapshot-1234

canonical name to RDS instance

I have different EC2 instances trying to access RDS instance. I want to upfront set RDS instance 'canonical name' within configuration file so that after deployment I don't need to make any changes to configuration files.
I have following questions:
Is there anyway, one can assign canonical name to a RDS instance within cloudformation template?
If above is not possible, can I setup dependency chain between EC2 creation and RDS instance (i.e. create RDS instance first, query it's name/ip and than create EC2 instance)
Thx
The canonical name of an RDS instance will always be generated automatically by AWS, however the naming scheme is consistent. The format of the name is:
<instance_name>.<arbitrary_string>.<region>.rds.amazonaws.com
The arbitrary_string section of the name is a string that uniquely identifies your AWS account. All RDS instances created within your account will use the same string identifier, so just grab that section from an existing RDS instance and you can piece together the full name based on the name you give the database and the region you launch it in.
If you want to have an easy to read/remember DNS name then you can always use Route 53 to assign another name as an alias to this.

Resources