- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用 Pulumi
我正在尝试从 elasticache
集群获取主要端点,以便我可以将其作为环境变量传递给 fargate
aws
上的服务。出于某种原因,适用于 RDS
的相同过程不适用于 ElastiCache
。
pulumi version
v3.23.0
"@pulumi/aws": "^4.36.0",
"@pulumi/awsx": "^0.32.0",
"@pulumi/pulumi": "^3.23.0",
以下内容非常适合 RDS
:
super("backend:portalInfrastructure:rds", name, {}, opts)
let securityGroupIds = cluster.securityGroups.map((g:any) => g.id)
let dbSubnets = new aws.rds.SubnetGroup(`${name}-rds-subnets-${ENV_LOWER}`, {
subnetIds: vpc.publicSubnetIds,
})
//Extra dash on the name here because pulumi doesn't add one for RDS
let db = new aws.rds.Instance(`${name}-postgres-${ENV_LOWER}-`, {
engine: 'postgres',
instanceClass: 'db.t3.micro',
allocatedStorage: 20,
dbSubnetGroupName: dbSubnets.id,
vpcSecurityGroupIds: securityGroupIds,
// TODO only needs to be publicly accessible
// to run migrations from external host
publiclyAccessible: true,
...DB_CONN,
tags: {
'env':ENV_LOWER
},
skipFinalSnapshot: true
})
this.DBSetupOutput = {
dbhost : db.endpoint.apply(e => e.split(":")[0]),
db: db
}
// For dependency tracking, register output properties for this component
this.registerOutputs({
DBSetupOutput: this.DBSetupOutput
})
然而,当我为 ElastiCache/Redis
尝试此操作时:
super("backend:portalInfrastructure:redis", name, {}, opts)
let securityGroupIds = cluster.securityGroups.map((g:any) => g.id)
let redisSubnets = new aws.elasticache.SubnetGroup(`${name}-redis-subnets-${ENV_LOWER}`, {
subnetIds: vpc.publicSubnetIds,
})
let redis = new aws.elasticache.Cluster(`${name}-redis-${ENV_LOWER}`, {
engine: "redis",
engineVersion: "3.2.10",
nodeType: "cache.t3.micro",
numCacheNodes: 1,
parameterGroupName: "default.redis3.2",
port: 6379,
subnetGroupName: redisSubnets.id,
securityGroupIds: securityGroupIds
}, {parent: this});
redis.clusterAddress.apply(address => {
console.log(address)
})
this.RedisSetupOutput = {
redishost : redis.clusterAddress.apply(a => a),
redis: redis
}
// For dependency tracking, register output properties for this component
this.registerOutputs({
RedisSetupOutput: this.RedisSetupOutput
})
我的变量 redishost
得到以下输出
"Calling [toString] on an [Output<T>] is not supported.\n\nTo get the value of an Output<T> as an Output<string> consider either:\n1: o.apply(v => `prefix${v}suffix`)\n2: pulumi.interpolate `prefix${v}suffix`\n\nSee https://pulumi.io/help/outputs for more details.\nThis function may throw in a future version of @pulumi/pulumi."
我不明白,因为我正在调用 apply
到 pulumi 输出。尝试获取 ElastiCache
clusterAddress
或 cacheNodes
时也会发生同样的事情。如果有人了解如何获取 ElastiCache
主要端点,或者可以告诉我我在这里做错了什么,将不胜感激。
最佳答案
您正在创建一个 redis elasticache 集群。如果您阅读 elasticache 的文档,它会指出 clusterAddress
仅为 memcache
集群填充。参见 here
您实际需要使用的是 cacheNodes
输出,如下所示:
this.RedisSetupOutput = {
redishost : redis.cacheNodes
redis: redis
}
这将返回一个地址数组,您可以通过指定一个数组的输出来缩小范围:
this.RedisSetupOutput = {
redishost : redis.cacheNodes[0].address
redis: redis
}
关于typescript - 使用 pulumi Typescript 获取 Elasticache 端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70900831/
以下来自http://php.net/manual/en/memcache.ini.php#ini.memcache.hash-strategy session.save_path string De
我想根据“集群”的名称动态配置我的 API 服务器。 所以我正在使用 AmazonElastiCacheClient 来发现集群名称,并且需要提取具有特定名称的集群的端点。 问题是我可以找到它,但似乎
在 terraform/cloudformation 文档中,有两种不同的资源可用于创建 ElastiCache Redis 实例: aws_elasticache_cluster ( https:/
我正在努力解决 http://cloud.spring.io/spring-cloud-aws/spring-cloud-aws.html将 Spring Cache 集成到我们的 AWS 应用程序中
我之前使用它通过 cloudformation 成功启动了一个 redis 实例: "RedisCache": { "Type": "AWS::ElastiCache:
我正在尝试从我的应用程序连接到 aws elasticache。 我知道端点和端口,但出于某种原因我无法连接到它。 我使用了这个 npm 包: https://www.npmjs.com/packag
我一直在寻找 elasticache 作为我们 EC2 redis 部署的替代品。但是我在我们的部署中有 1 个主服务器和 11 个副本的硬性要求,而 elasticache 只允许 5 个副本。有没
我们计划使用 ElastiCache (Redis) 而不是我们自己的 redis 集群。但是,“维护窗口”设置会产生一些问题, 如果我使用 multi-az 复制集群,elasticache 是否会
前言 我们平时工作中,缓存服务这个词出现频率不低,Redis、Memcached 是我们经常用到的缓存服务。 运维人员、测试人员、研发人员、实施人员,是否都有过对集群服务搭建、部署及管理的烦恼,常常捣
我想从节点端点的角度理解故障转移案例https://forums.aws.amazon.com/ , 案例的 IP 地址 主节点故障转移和副本得到提升 副本故障转移 配置为禁用集群模式:只有 1 个分
我有一个grails应用程序,该应用程序始终使用memcached存储请求结果。 在请求中,存储在缓存中的结果很小(100kb)可以很好地处理50K个请求,但是在一种情况下,如果结果大约为800kb,
我正在尝试使用 Boto3 和 Python 获取 ElastiCache 标签。在boto3中,有一个函数叫做list_tags_for_resource()。但是,我面临的问题是,如何找到资源名称
我正在针对 AWS 上的 Elasticache 集群运行 Predis,该集群有一个写入主机和两个读取主机副本。 Predis 主从复制配置大致如下.. self::$client = new Pr
我正在使用 Redis 读取一些键/值数据(数据需要持久化,虽然它几乎不会随时间变化,只会有一个初始数据上传)。目前,我只是在本地环境中安装了Redis来实现读取数据的逻辑。 但是,我还需要考虑部署应
带有 redis 的 AWS ElastiCache 服务器有从非常小到非常大的多 cpu 机器的一切。但是redis是单线程的。任何人都知道亚马逊正在做什么以使其使用所有核心?我假设他们会这样做,否
最近我刚开始将 AWS ElastiCache 用于 Laravel 应用程序。该应用程序在 ELB 后面的 2 个实例上运行,每秒处理大约 6-10 个请求。当我启动该应用程序时一切正常,但随后我开
我很困惑。 AWS 对我这样做了。大量的文档,但我找不到任何能够以简单的方式告诉我简单内容的内容。 我们正在考虑为我们的应用程序使用 Elasticcache 和 Redis。我们需要准备好大规模扩展
我正在尝试运行 describe_cache_clusters使用 boto3 在 Python 上执行命令。当我的 ElastiCache 集群只有一个节点时,此命令有效,但当有多个节点时,它不起作
我在新加坡的 2 个可用区使用 AWS 负载平衡和多个 Web 服务器。 我现在正在寻找跨两个可用区部署 elasticache 节点,并想知道是否存在由 Web 服务器访问不同可用区的 elasti
ElasticCache 为您提供了一个配置端点和一个单独的节点端点。 两者之间的真正区别是什么?以及您将使用一个与另一个的用例? 我假设配置端点可以指向一组节点端点,但我不太明白。一个用例示例真的可
我是一名优秀的程序员,十分优秀!