CodexBloom - Programming Q&A Platform

AWS CloudFormation scenarios to Create RDS Instance with 'DBInstanceNotFound' scenarios When Specifying Multi-AZ

👀 Views: 82 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-08
AWS CloudFormation RDS YAML

I'm upgrading from an older version and I'm trying to create an Amazon RDS instance using AWS CloudFormation, but I keep working with the behavior 'DBInstanceNotFound' during the stack creation process. I've set the `MultiAZ` parameter to `true`, but it seems that CloudFormation doesn't recognize the instance during the deployment phase. Here's a snippet of my CloudFormation template: ```yaml Resources: MyDBInstance: Type: 'AWS::RDS::DBInstance' Properties: DBInstanceIdentifier: mydbinstance AllocatedStorage: '20' DBInstanceClass: db.t2.micro Engine: mysql EngineVersion: '8.0' MasterUsername: admin MasterUserPassword: !Ref DBPassword MultiAZ: true VPCSecurityGroups: - !GetAtt MyDBSecurityGroup.GroupId DBSubnetGroupName: !Ref MyDBSubnetGroup ``` I have a subnet group defined like this: ```yaml MyDBSubnetGroup: Type: 'AWS::RDS::DBSubnetGroup' Properties: DBSubnetGroupDescription: My DB Subnet Group SubnetIds: - !Ref Subnet1 - !Ref Subnet2 ``` I suspect the scenario might be related to the parameter settings or the way I am defining the VPC security groups, as I have made sure the subnets are in the same VPC. I have also checked that the `DBPassword` parameter is being passed correctly. I tried creating the RDS instance manually via the AWS Console with the same settings, and it worked fine. Is there something I might be missing in the CloudFormation template? Any insights would be greatly appreciated! I'm working on a API that needs to handle this. Any help would be greatly appreciated! For reference, this is a production mobile app.