0

I am creating a CloudFormation template using Troposphere when I run it in the stack it only create a single availability zone. I have 2 private subnets and 1 AZ in each subnet. The file create VPC, subnets, rounte internet gateway, EC2 instances and RDS instance, everything but it in RDS it creates for a single availability zone, I have setup MultiAZ = true also but still it fails.

RDSdatabase = t.add_resource(
    rds.DBInstance(
        "RDSDatabase",
        DBName=Client+'RDSDatabase',
        AllocatedStorage=Ref(dballocatedstorage),
        DBInstanceClass=Ref(dbclass),
        Engine="MySQL",
        EngineVersion="5.5",
        MasterUsername=Ref(dbuser),
        MasterUserPassword=Ref(dbpassword),
        DBSubnetGroupName=Ref(mydbsubnetgroup),
        VPCSecurityGroups=[Ref(myvpcsecuritygroup)],
        MultiAZ=True,
        Tags=Tags(
            Application=ref_stack_name, Client=Client, Name=Client+'_RDS-Master_1'),
    ))

This is My Subnet group---

mydbsubnetgroup = t.add_resource(
    rds.DBSubnetGroup(
    "MyDBSubnetGroup",
        DBSubnetGroupDescription="Subnets available for the RDS DB Instance",
        SubnetIds=[Ref(db_subnet_AZ_1),Ref(db_subnet_AZ_2)],
        Tags=Tags(Name=Join("-", [Ref("AWS::StackName"), "DBSubnetGroup"]),
      ),
    ))

1 Answer 1

1

I think this is mostly a misunderstanding of what MultiAZ does. A single RDS instance really can only be in a single availability zone (and subnet). MultiAZ doesn't actually put that instance into multiple availability zones - it creates a backup instance that keeps in sync with the primary one in a separate availability zone (and it doesn't really tell you which, I don't believe) to give you greater durability and uptime in the case that the primary fails in some way.

See: https://aws.amazon.com/rds/details/multi-az/

3
  • Yeah DB instance creates in a single availability zone, But while setting up MultiAZ it creates another backup with sync in parallel zone, but My question is- How can i check and make sure that it creates in another availability zone, or in which zone it creates? Is there any way to get these details, I have gone through every details but i didn't find anywhere. I tried to delete my DBinstance and it deleted. Thanks for your answer @phobologic -------------- More It Applies Master Slave concept but i don't know how.
    – Rajat jain
    Jan 31, 2019 at 6:58
  • Hey @Rajatjain - I don't believe there is any way to find out information about the Multi-AZ host. MultiAZ doesn't mean master/slave/replica or anything like that. It's not available for you to query directly. That said, it's definitely worth enabling. It will make changes to the database much faster (less downtime). If you need a replica, you should setup a replica separately. That's more for distributing your read load though.
    – phobologic
    Jan 31, 2019 at 23:30
  • I was going through it, and watched some videos and i saw, while enabling Multi-AZ there is one more zone called Secondary availability zone, creates. so like suppose my instance is in us-west-1a then secondary AZ will be us-west-1b. And that we can see in Description section below the instance details
    – Rajat jain
    Feb 1, 2019 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.