Terraform、AWS RDS aurora mysql 无服务器异常“找不到源集群”

2024-02-29

我正在尝试通过引用第一个集群的还原时间点来创建一个新集群和另一个集群。 对于第一个 tfvar 块 - 它将创建一个新的 aurora mysql 集群 aurora-cluster-mysql-serverless 在第二个 tfvar 块中 - 它应该从源 aurora-cluster-mysql-serverless 创建一个新的集群 aurora-cluster-mysql-serverless-clone。但即使已创建集群,也会出现异常“找不到或无法访问源集群:aurora-cluster-mysql-serverless”。

下面是我的结构。

主块调用模块

module "aurora_mysql" {
  count                                   = var.general_config.cluster_count
  source                                  = "./modules/aurora_mysql"
  cluster_identifier                      = var.aurora_mysql[count.index].cluster_identifier
  source_cluster_identifier               = var.aurora_mysql[count.index].source_cluster_identifier
  engine                                  = var.aurora_mysql[count.index].engine
  engine_version                          = var.aurora_mysql[count.index].engine_version
  engine_mode                             = var.aurora_mysql[count.index].engine_mode
  availability_zones                      = var.aurora_mysql[count.index].availability_zones
  database_name                           = var.aurora_mysql[count.index].database_name
  db_port                                 = var.aurora_mysql[count.index].db_port
  master_username                         = var.aurora_mysql[count.index].master_username
  master_password                         = var.aurora_mysql[count.index].master_password
  backup_retention_period                 = var.aurora_mysql[count.index].backup_retention_period
  restore                                 = var.aurora_mysql[count.index].restore
  restore_type                            = var.aurora_mysql[count.index].restore_type
  db_subnet_group_name                    = var.aurora_mysql[count.index].db_subnet_group_name
  vpc_security_group_ids                  = var.aurora_mysql[count.index].vpc_security_group_ids
  cluster_parameter_group                 = var.aurora_mysql[count.index].cluster_parameter_group
  backtrack_window                        = var.aurora_mysql[count.index].backtrack_window
  skip_final_snapshot                     = var.aurora_mysql[count.index].skip_final_snapshot
  deletion_protection                     = var.aurora_mysql[count.index].deletion_protection
  db_parameter_group                      = var.aurora_mysql[count.index].db_parameter_group
  auto_pause                              = var.aurora_mysql[count.index].auto_pause
  max_capacity                            = var.aurora_mysql[count.index].max_capacity
  min_capacity                            = var.aurora_mysql[count.index].min_capacity
  seconds_until_auto_pause                = var.aurora_mysql[count.index].seconds_until_auto_pause
  timeout_action                          = var.aurora_mysql[count.index].timeout_action
}

模块变量文件

variable "general_config" {
  description                                  = "general configs for tf module."
  type                                         = map
  default                                      = {
    account_id                                 = ""
    aws_region                                 = "us-east-1"
    cluster_count                              = 2
  }
}

variable "aurora_mysql" {
  type = list(object({
     cluster_identifier                        = string
     source_cluster_identifier                 = string
     cluster_parameter_group                   = string
     db_parameter_group                        = string
     engine                                    = string
     engine_version                            = string
     engine_mode                               = string
     database_name                             = string
     db_port                                   = number
     master_username                           = string
     master_password                           = string
     db_subnet_group_name                      = string
     availability_zones                        = list(string)
     vpc_security_group_ids                    = list(string)
     backup_retention_period                   = number
     restore                                   = bool
     restore_type                              = string
     backtrack_window                          = number
     deletion_protection                       = bool
     skip_final_snapshot                       = bool
     auto_pause                                = bool
     max_capacity                              = number
     min_capacity                              = number
     seconds_until_auto_pause                  = number
     timeout_action                            = string
  }))
}

Tfvars 文件

general_config = {
  account_id        = "accountnumber"         
  aws_region        = "us-east-1"            
  cluster_count     = 2
}

aurora_mysql = [
    {
                cluster_identifier               = "aurora-cluster-mysql-serverless"                     
                source_cluster_identifier        = ""                                                            
                cluster_parameter_group          = "aurora-cluster-mysql-serverless-cluster-parameter-group"     
                db_parameter_group               = "aurora-cluster-mysql-serverless-db-parameter-group"                                                          
                engine                           = "aurora-mysql"                             
                engine_version                   = "5.7.mysql_aurora.2.07.1"                  
                engine_mode                      = "serverless"                              
                database_name                    = "auroramysqlserverless"                              
                db_port                          = 3306                                       
                master_username                  = "admin"                                    
                master_password                  = "admin1234"                                               
                db_subnet_group_name             = "aurora-cluster-mysql-serverless-subnet-group"                
                availability_zones               = ["us-east-1a", "us-east-1b"]               
                vpc_security_group_ids           = ["sg-1234"]                   
                backup_retention_period          = 1                                                                        
                backtrack_window                 = 0                                          
                restore                          = false                                      
                restore_type                     = ""                                                                                                                 
                deletion_protection              = false                                      
                skip_final_snapshot              = true                                       
                auto_pause                       = true                                       
                max_capacity                     = 256                                        
                min_capacity                     = 2                                          
                seconds_until_auto_pause         = 300                                        
                timeout_action                   = "ForceApplyCapacityChange"                 
    },
    {
                cluster_identifier               = "aurora-cluster-mysql-serverless-clone"                     
                source_cluster_identifier        = "aurora-cluster-mysql-serverless"                                                            
                cluster_parameter_group          = "aurora-cluster-mysql-serverless-clone-cluster-parameter-group"     
                db_parameter_group               = "aurora-cluster-mysql-serverless-clone-db-parameter-group"                                                          
                engine                           = "aurora-mysql"                             
                engine_version                   = "5.7.mysql_aurora.2.07.1"                  
                engine_mode                      = "serverless"                              
                database_name                    = "auroramysqlserverless"                              
                db_port                          = 3306                                       
                master_username                  = "admin"                                    
                master_password                  = "admin1234"                                               
                db_subnet_group_name             = "aurora-cluster-mysql-serverless-clone-subnet-group"                
                availability_zones               = ["us-east-1a", "us-east-1b"]               
                vpc_security_group_ids           = ["sg-1234"]                   
                backup_retention_period          = 1                                                                        
                backtrack_window                 = 0                                          
                restore                          = true                                      
                restore_type                     = "copy-on-write"                                                                                                                 
                deletion_protection              = false                                      
                skip_final_snapshot              = true                                       
                auto_pause                       = true                                       
                max_capacity                     = 256                                        
                min_capacity                     = 2                                          
                seconds_until_auto_pause         = 300                                        
                timeout_action                   = "ForceApplyCapacityChange"                 
    },
]

模块调用的资源 (rds_mysql)

resource "aws_rds_cluster" "rds_mysql" {
  cluster_identifier                  = var.cluster_identifier
  engine                              = var.engine
  engine_version                      = var.engine_version
  engine_mode                         = var.engine_mode
  availability_zones                  = var.availability_zones
  database_name                       = var.database_name
  port                                = var.db_port
  master_username                     = var.master_username
  master_password                     = var.master_password
  backup_retention_period             = var.backup_retention_period
  db_subnet_group_name                = var.db_subnet_group_name
  vpc_security_group_ids              = var.vpc_security_group_ids
  db_cluster_parameter_group_name     = var.cluster_parameter_group
  backtrack_window                    = var.backtrack_window
  skip_final_snapshot                 = var.skip_final_snapshot
  deletion_protection                 = var.deletion_protection

  dynamic "restore_to_point_in_time" {
    for_each = var.restore == true ? [1] : []
    content {
      source_cluster_identifier         = var.source_cluster_identifier
      restore_type                      = var.restore_type
      use_latest_restorable_time        = true
    }
  }

  dynamic "scaling_configuration" {
      auto_pause                        = var.auto_pause
      max_capacity                      = var.max_capacity
      min_capacity                      = var.min_capacity
      seconds_until_auto_pause          = var.seconds_until_auto_pause
      timeout_action                    = var.timeout_action
  }


  lifecycle {
    create_before_destroy             = false
    ignore_changes = [
     availability_zones
    ]
  }
}

资源变量

variable "cluster_identifier" {
  description = "The name of the RDS instance. If the value is empty, Terraform assigns a random unique identifier."
  type        = string
}

variable "source_cluster_identifier" {
  description = "The name of the RDS instance. If the value is empty, Terraform assigns a random unique identifier."
  type        = string
}

variable "cluster_parameter_group" {
  description = "cluster parameter group name"
  type        = string
}

variable "cluster_parameter_group_family" {
  description = "cluster parameter group family name"
  type        = string
}


variable "db_parameter_group" {
  description = "db parameter group name"
  type        = string
}


variable "engine" {
  description = "rds_aurora mysql"
  type        = string
}

variable "engine_version" {
  description = "postgres version"
  type        = string
}

variable "engine_mode" {
  description = " version"
  type        = string
  default     = "provisioned"
}

variable "database_name" {
  description = "The DB name to create. If omitted, no database is created initially"
  type        = string
  default     = null
}

variable "db_port" {
  description = "database port"
  type        = number
  default     = 3306
}

variable "master_username" {
  description = "RDS root user"
}

variable "master_password" {
  description = "RDS root user password"
  sensitive   = true
}

variable "availability_zones" {
  description = "A mapping of tags to assign to the resource"
  type        = list(string)
}

variable "vpc_security_group_ids" {
  description = "A mapping of tags to assign to the resource"
  type        = list(string)
}

variable "backup_retention_period" {
  description = "A mapping of tags to assign to the resource"
  type        = number
}


variable "db_subnet_group_name" {
  description = "A mapping of tags to assign to the resource"
  type        = string
}

variable "db_parameter_group_family" {
  description = "parameter_group_family"
  type        = string
}

variable "backtrack_window" {
  description = "Defaults to 0. Must be between 0 and 259200 (72 hours)"
  type        = number
  default     = 0
}

variable "deletion_protection" {
  description = "If the DB instance should have deletion protection enabled.The database can't be deleted when this value is set to true. The default is false"
  type        = bool
  default     = false
}

variable "skip_final_snapshot" {
  description = "Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created"
  type        = bool
  default     = true
}

variable "restore_type" {
  description = "(Optional) Type of restore to be performed. Valid options are full-copy (default) and copy-on-write."
  type        = string
}

variable "restore" {
  description             = "only if you want to restore from existing instance"
  type                    = bool
  default                 = false
}

variable "auto_pause" {
  description             = "Whether to enable automatic pause. A DB cluster can be paused only when it's idle (it has no connections). If a DB cluster is paused for more than seven days, the DB cluster might be backed up with a snapshot. In this case, the DB cluster is restored when there is a request to connect to it. Defaults to true."
  type                    = bool
  default                 = true
}

variable "max_capacity" {
  description             = "The maximum capacity for an Aurora DB cluster in serverless DB engine mode. The maximum capacity must be greater than or equal to the minimum capacity. Valid Aurora MySQL capacity values are 1, 2, 4, 8, 16, 32, 64, 128, 256. Valid Aurora PostgreSQL capacity values are (2, 4, 8, 16, 32, 64, 192, and 384). Defaults to 16."
  type                    = number
  default                 = 16
}

variable "min_capacity" {
  description             = "The minimum capacity for an Aurora DB cluster in serverless DB engine mode. The minimum capacity must be lesser than or equal to the maximum capacity. Valid Aurora MySQL capacity values are 1, 2, 4, 8, 16, 32, 64, 128, 256. Valid Aurora PostgreSQL capacity values are (2, 4, 8, 16, 32, 64, 192, and 384). Defaults to 1"
  type                    = number
  default                 = 1
}

variable "seconds_until_auto_pause" {
  description             = "The time, in seconds, before an Aurora DB cluster in serverless mode is paused. Valid values are 300 through 86400. Defaults to 300."
  type                    = number
  default                 = 300
}

variable "timeout_action" {
  description             = "The action to take when the timeout is reached. Valid values: ForceApplyCapacityChange, RollbackCapacityChange. Defaults to RollbackCapacityChange"
  type                    = string
  default                 = "RollbackCapacityChange"
}

Issue:当 terraform 尝试创建引用第一个集群的集群时出现异常。 请建议解决以下问题。

module.aurora_mysql[0].aws_rds_cluster.rds_mysql: Still creating... [6m0s elapsed]
module.aurora_mysql[0].aws_rds_cluster.rds_mysql: Creation complete after 6m6s [id=aurora-cluster-mysql-serverless]
╷
│ Error: DBClusterNotFoundFault: The source cluster could not be found or cannot be accessed: aurora-cluster-mysql-serverless
│       status code: 404, request id: 31950839-5ca6-433f-acf8-e4b3d8089dd3
│
│   with module.aurora_mysql[1].aws_rds_cluster.rds_mysql,
│   on modules/aurora_mysql/aurora_mysql.tf line 36, in resource "aws_rds_cluster" "rds_mysql":
│   36: resource "aws_rds_cluster" "rds_mysql" {
│
╵

遗憾的是你不能这样做。如果您要使用以下命令创建集群count:

 count                                   = 2

TF会创建两个集群同时。因此,显然第二个集群失败了,因为第一个集群不存在,因为它是与第二个集群一起(而不是之前)创建的。您必须分别创建两个集群。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Terraform、AWS RDS aurora mysql 无服务器异常“找不到源集群” 的相关文章

  • 从 Flask 中的 S3 返回 PDF

    我正在尝试在 Flask 应用程序的浏览器中返回 PDF 我使用 AWS S3 来存储文件 并使用 boto3 作为与 S3 交互的 SDK 到目前为止我的代码是 s3 boto3 resource s3 aws access key id
  • 访问 AWS 上的 Tensorboard

    我正在尝试访问 AWS 上的 Tensorboard 这是我的设置 张量板 tensorboard host 0 0 0 0 logdir train 在端口 6006 上启动 TensorBoard b 39 您可以导航到http 172
  • 在 aws-cdk 上的 aws-rds 上,使数据库可公开访问的设置在哪里?

    使用 AWS RDS 控制台和 CLI API 都有一个开关可以使数据库可公开访问 但我找不到使用提供的构造使用新的 aws cdk 来实现此目的的方法 Cloud Formation 类 例如 CfnDBInstance 中有一个布尔值
  • 如何将 kubernetes LoadBalancer Ingress URL 发布到 aws Route53

    今天 当我通过 aws 使用 kubernetes 启动一个应用程序时 它公开了一个公开可见的 LoadBalancer Ingress URL 但是要将其链接到我的域以使公众可以访问该应用程序 我需要在每个设备上的浏览器中手动进入 aws
  • AWS Textract InvalidParameterException

    我有一个 Net core 客户端应用程序 根据 AWS 文档 使用带有 S3 SNS 和 SQS 的 amazon Textract 检测和分析多页文档中的文本 https docs aws amazon com texttract la
  • 如何更改 Amazon Redshift 中的默认时区?

    默认情况下将时间戳列设置为 SYSDATE 将其存储为UTC 是否可以更改时区 以便 SYSDATE 将日期和时间存储到不同的时区 到目前为止 我已经检查了SET http docs aws amazon com redshift late
  • DynamoDB 中的时间戳应使用什么数据类型?

    我是 DynamoDB 新手 我希望创建一个使用 DeviceID 作为哈希键 时间戳作为范围键和一些数据的表 DeviceID 123 Timestamp 2016 11 11T17 21 07 5272333Z X 12 Y 35 在
  • 从 EC2 W2008 实例创建 AMI - 为什么从来没有获得密码?

    我正在尝试做什么 我正在尝试克隆 EC2视窗2008通过管理控制台实例 该实例基于 Windows Server2008 i386 Base v104 ami 92ba43fb 但上面安装了许多应用程序 我想为新实例保留这些应用程序 发生了
  • 如何使用对象标记上传到 AWS S3

    有没有办法使用标签将文件上传到AWS S3 不将标签添加到S3中的现有文件 对象 我需要让该文件与我的 Tags 一起出现在 S3 中 即在单个 API 调用中 我需要这个 因为我使用 Lambda 函数 使用这些 S3 对象标签 由 S3
  • 限制 terraform 嵌套资源中的 AWS 安全组设置

    我有一个aws directory service directory服务中定义的资源 这会创建一个安全组 https registry terraform io providers hashicorp aws latest docs re
  • 将 Django 部署到 AWS;傻瓜静态文件

    我对这个项目的最后一步完全迷失了 到目前为止 我已经能够开发一个 Django 应用程序 它可以在本地主机上按照我想要的方式工作 我已经能够将网站部署到 AWS EC2 但我一定错过了有关提供静态文件的一些基本知识 我什至还没有尝试过媒体文
  • AWS EC2 应用程序负载均衡器 + 双向 SSL?

    是否可以使用 AWS Application Load Balancer 并使用双向 ssl 客户端证书 我当前的设置使用经典的 ELB 通过 tcp 转发到 Web 服务器端点来支持此操作 我现在需要使用 URL 路由流量 并希望在可能的
  • 使用S3上传但不允许公共访问

    我的想法是创建一个 S3 存储桶以允许用户上传二进制对象 下一步是确认上传 然后 API 将启动文件处理 为了使其更安全 客户端将首先请求上传位置 然后 API 会在 S3 上为此上传分配并预先创建一个一次性使用目录 并在该目录上设置访问策
  • Amazon MWAA Airflow - 任务容器在没有日志的情况下关闭/停止/终止

    我们使用 Amazon MWAA Airflow 很少有任务标记为 FAILED 但根本没有日志 就好像容器在我们没有注意到的情况下被关闭了一样 我找到了这个链接 https cloud google com composer docs h
  • AWS Elastic Beanstalk 一次也不会部署我的 Rails 应用程序

    我目前正在使用 Ruby 2 6 running on 64bit Amazon Linux 2 3 0 2 图像 并通过查看EC2实例内部的 var logs eb engine log eb logs 命令不会 t 告诉我这个 反复出现
  • AWS Amazon - 登录循环卡住

    我已经使用 AWS 亚马逊几年了 但是 突然当我登录时 我进入了此验证部分 他们将验证码发送到我的电子邮件 我收到了该代码 因此 我输入收到的代码 最终返回登录页面 所以我登录后 同样的事情一遍又一遍地发生 我无法进入我的仪表板 它只是不断
  • 从 Amazon S3 存储桶下载文件的脚本

    尝试编写脚本以从 Amazon S3 存储桶下载文件 cURL 网站上的示例遇到问题 下面的脚本产生 我们计算的请求签名与您的签名不匹配 假如 检查您的密钥和签名方法 感谢任何帮助 bin sh file filename php buck
  • 如何在AWS策略中提供多个StringNotEquals条件?

    我正在尝试编写 AWS S3 存储桶策略 拒绝所有流量 除非来自两个 VPC 的流量 我正在尝试编写的策略如下所示 两者之间有逻辑与StringNotEquals 除非这是无效的政策 Version 2012 10 17 Id Policy
  • AWS S3 上传的图像已损坏

    我正在 AWS ec2 ubuntu 机器上工作 我的代码在 cakephp 中 当我尝试将任何图像上传到 AWS S3 时 它都会损坏 虽然它在核心 php 代码中运行良好 这是我的控制器代码 if this gt User gt sav
  • 如何自动启动我的 ec2 实例、运行命令然后将其关闭?

    我想每周对 redshift postgres 数据库中的数据运行一次机器学习模型 我使用以下命令将 R 脚本设置为休息 apiplumbr然后我将其设置为一项任务来管理pm2 我有它 所以任务会在ec2实例启动然后继续运行 要让 R 脚本

随机推荐

  • SQL 增加一个数字

    Problem 我想根据表格增加一个数字 例如 如果一个表包含 排 1 1 2 3 4 4 4 5 mytable 列应在此基础上增加 取上一列中的 max row 1 所以结果应该是这样的 6 6 7 8 9 9 9 10 这是到目前为止
  • 如何获取 PFX 密钥的容器名称?

    不久前 我使用如下命令将 PFX 密钥安装到容器中 sn i mykey pfx VS XXX 但两个月后我忘记了容器名称 VS XXX 所以我的问题是 如何取回比名字 我知道密钥名称 我有这个密钥 我知道密钥密码短语 下载Keypal h
  • 将材料设计与 VueJS 结合使用

    我正在使用 VueJs 构建一个 Web 应用程序 并且需要一个 css 框架来设计一些东西 而不是从头开始 我找到了material design lite www getmdl io 但我无法让它与vue router一起正常工作 我的
  • 跨多个范围的多个条件格式规则?

    我需要执行以下操作 如果单元格 E 包含大于 30 的数字且单元格 L 包含大于 100 的数字 则突出显示一行 此规则需要应用于所有行 你能帮忙吗 你应该使用条件格式 http office microsoft com en us exc
  • Electron:打开默认电子邮件客户端

    我正在使用选举框架来构建 exe 和 dmg 文件 在应用程序中 我有一个按钮 单击该按钮必须打开系统上安装的默认电子邮件应用程序才能发送电子邮件 以下是打开电子邮件客户端的代码 shell openExternal mailto emai
  • 本地硬重置后无法推送到原点

    我最近对本地 git 存储库进行了硬重置 换句话说 我将其重置为较早的时间点 现在当我尝试向上推时origin它告诉我不能 因为origin包含比我的存储库晚的工作 这是有道理的 但我不关心源在我的本地存储库之后所做的工作 如果我先pull
  • @protocol 与类簇

    那些主要是什么pro and contra for protocol and 类簇 http developer apple com library mac documentation Cocoa Conceptual CocoaFunda
  • 将 Jenkins 与 Gitlab 集成

    我需要在 Jenkins 中设置构建配置 以便每当触发构建时 我都会从 Gitlab 获取最新的脚本并将它们复制到目标系统并在目标上运行该脚本 我找不到任何将 Gitlab 集成到 Jenkins 的相关信息 有我可以使用的特定插件吗 我使
  • 检查哪些参数(组合)为空

    假设我有 4 个变量 String a String b String c String d 我想检查单个变量或变量组合是否不为空并采取相应的行动 例如 一种方法是使用 if else 这种方式 if a null b null c nul
  • VM 上的 Azure SQL Server 可以作为生产数据库吗?

    我试图找出 VM 上的 Azure SQL Server 和 Azure SQL Server 数据库之间的区别 我知道一个是 IaaS 另一个是 PaaS 服务 但有一件事我仍然不明白 哪一个可以用于开发 测试 哪一个可以用于生产 或者说
  • 在 python 中读取 csv 文件并将每个行项目作为脚本中的值进行迭代?

    编辑是因为我似乎太模糊或没有进行足够的研究 我很抱歉 这里是新手 我正在尝试读取 csv 文件并将每个新行分配为一个值 以迭代写入 API 的脚本 我的 csv 中没有标题数据 我将添加正则表达式搜索 然后使用正则表达式表达式后面的数据 并
  • Twitter Bootstrap - 模态格式的表单 - ASP.NET

    我有一个模式形式的表单 如果主窗口不太宽 标签位于字段上方 则该表单可以完美格式化 但是 如果浏览器最大化或足够大 它会更改模式内内容的布局 以便标签现在位于字段的左侧 这意味着每行一个单词 看起来非常混乱 知道我如何克服这种行为 以便类
  • 设置重复本地通知的日期

    我想设置从日期开始重复的本地通知 例如 开始日期 2018 年 6 月 25 日 今天日期 2018 年 6 月 21 日 我被困在这里了 下面的代码可以工作 但它从今天开始而不是从 2018 年 6 月 25 日开始触发本地通知 请看一下
  • 在 flutter 中更新我的应用程序时,您的 Android App Bundle 使用错误的密钥进行签名错误

    我只是不太明白为什么这种情况发生在我身上 我遵循了所有步骤https flutter dev docs deployment android https flutter dev docs deployment android上传我的第一个版
  • 在 Woocommerce 商店页面上获取产品变体图像

    我想在商店页面上显示产品变体图像 每个变体的特定图像 我使用下面的代码成功地获取了变体的名称 放入 content product php 中 不幸的是 里面什么也没有 colouvalues数组 它是变体图像 url 或与图像相关的任何内
  • CSS 三角形 + “之后”实施

    我尝试用 CSS 创建一个三角形 它看起来不错 但是我现在在一个盒子之后实现它时遇到了问题 看看我的例子 你就会明白我的意思 https jsfiddle net TTVuS https jsfiddle net TTVuS 好像是后面的三
  • 计算一个字符串在另一个字符串中出现的次数 (Perl)

    计算某个字符串在较大字符串中出现的次数的最快方法是什么 我最好的猜测是将该字符串的所有实例替换为空 计算长度差并除以子字符串的长度 但这似乎相当慢 而且我需要分析大量数据 您可以捕获字符串 然后对它们进行计数 可以通过将列表上下文应用于捕获
  • 为什么我在使用 Rspec 和 Capybara 编写测试用例时无法获取 current_user

    我必须为我的一个功能列表页面编写集成测试用例 并且该功能索引方法具有如下代码 def index food categories current user food categories end 现在 当我尝试为此编写测试用例时 它会抛出错
  • 如何使用反应式扩展通过最大窗口大小来限制事件?

    Scenario 我正在构建一个 UI 应用程序 每隔几毫秒从后端服务获取通知 一旦收到新的通知 我想尽快更新用户界面 由于我可以在短时间内收到大量通知 并且我总是只关心最新的事件 因此我使用风门 反应式扩展框架的方法 这使我可以忽略紧接着
  • Terraform、AWS RDS aurora mysql 无服务器异常“找不到源集群”

    我正在尝试通过引用第一个集群的还原时间点来创建一个新集群和另一个集群 对于第一个 tfvar 块 它将创建一个新的 aurora mysql 集群 aurora cluster mysql serverless 在第二个 tfvar 块中