You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: rds_stack.rb
    path of file: ./repos/barcelona/lib/barcelona/network
    
    the code of the file until where you have to start completion: module Barcelona::Network
  class PostgresqlBuilder < CloudFormation::Builder
    def build_resources
      add_resource("AWS::RDS::DBInstance", "DBInstance") do |j|
        j.AllocatedStorage options[:allocated_strage]
        j.AllowMajorVersionUpgrade true
        j.AutoMinorVersionUpgrade true
        j.Engine "postgres"
        j.DBInstanceClass options[:db_instance_class]
        j.DBInstanceIdentifier ref("AWS::StackName")
        j.DBName options[:db_name]
        j.Ma
    
    def build_resources
      add_resource("AWS::RDS::DBInstance", "DBInstance") do |j|
        j.AllocatedStorage options[:allocated_strage]
        j.AllowMajorVersionUpgrade true
        j.AutoMinorVersionUpgrade true
        j.Engine "postgres"
        j.DBInstanceClass options[:db_instance_class]
        j.DBInstanceIdentifier ref("AWS::StackName")
        j.DBName options[:db_name]
        j.MasterUsername options[:db_user]
        j.MasterUserPassword ref("DBPassword")
        j.MultiAZ options[:multi_az]
        j.VPCSecurityGroups [
          ref("DBSecurityGroup")
        ]
        j.DBSubnetGroupName ref("DBSubnetGroup")
        j.StorageType "gp2"
      end

      add_resource("AWS::EC2::SecurityGroup", "DBSecurityGroup") do |j|
        j.GroupDescription "DB Security Group"
        j.VpcId options[:vpc_id]
        j.SecurityGroupIngress [
          {
            "IpProtocol" => "tcp",
            "FromPort" => 5432,
            "ToPort" => 5432,
            "SourceSecurityGroupId" => options[:db_source_security_group_id]
          }
        ]
      end

      add_resource("AWS::RDS::DBSubnetGroup", "DBSubnetGroup") do |j|
        j.DBSubnetGroupDescription "DB subnet group"
        j.SubnetIds options[:db_subnet_ids]
      end
    end