How can I find the endpoint after I have created a Redis instance using the CDK?

0

I'm doing this to create a Redis instance:

redis_cache_cluster = aws_elasticache.CfnCacheCluster(
            self,
            "RedisCacheCluster",
            cluster_name=f"ctest",
            cache_node_type="cache.t2.micro",
            cache_subnet_group_name="ghjghj",
            engine="redis",
            engine_version="7.0",
            num_cache_nodes=1,
            port=6379,
            vpc_security_group_ids=[
                'ghjghj'
            ]
        )

How can I get the endpoint after this? (Then assign it to an environment variable for a lambda?)

Mick B
已提問 1 年前檢視次數 574 次
3 個答案
0

Hi Mick.

There are several ways to find the endpoints. Please see the following documentation page and use your preferred method (Console, CLI, or API).

I hope this helps.

profile pictureAWS
專家
已回答 1 年前
  • Thanks. What about in the CDK? I want to assign it to an environment variable which can then be used by a lambda.

0

Mick, based on the documentation here, it looks you should be able to use the following properties from the redis_cache_cluster variable to get the endpoint information:

I hope this helps.

profile pictureAWS
專家
已回答 1 年前
0

I managed to get this working using CodeWhisperer:

redis_endpoint = redis_cache_cluster.attr_redis_endpoint_address
Mick B
已回答 1 年前
profile picture
專家
已審閱 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南