wing icon indicating copy to clipboard operation
wing copied to clipboard

terraform security groups in `ex.Redis` are recreated

Open eladcon opened this issue 10 months ago • 4 comments

I tried this:

compile and deploy this (tf-aws)

bring ex;
bring cloud;

let api = new cloud.Api() as "api1";
// let ap2 = new cloud.Api() as "api2";

new ex.Redis();

security group id is Redis_KEN25securityGroup_D3232AB7

uncomment the second api creation and recompile and redploy

security group id is Redis_KEN35securityGroup_E4111F48

This happened:

the id of the security group changed without touching the redis resource itself. this causes terraform to fail on deployment since the security group name itself didn't change

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.

eladcon avatar Mar 31 '24 18:03 eladcon

Have you tried using the Redis winglib? We migrated ex.Redis on tf-aws to the winglib. We plan to also migrate the sim level to the winglib and once that's done we'll deprecate ex.Redis.

staycoolcall911 avatar Apr 01 '24 15:04 staycoolcall911

it seems that tf-aws is still not supported?

eladcon avatar Apr 01 '24 16:04 eladcon

You're right, my mistake. sim is supported on the redis winglib, tf-aws still isn't.

staycoolcall911 avatar Apr 01 '24 16:04 staycoolcall911

I think there's an issue in how the resource IDs are being generated - I noticed in the Terraform output for your example that the resource with a Terraform name of "Redis_KEN31securityGroup_2ECF73BF" is annotated with a construct path of "root/Default/Default/Redis/KEN.31]}securityGroup". When the second API is added, there's a different construct path generated, "root/Default/Default/Redis/KEN.41]}securityGroup"

Chriscbr avatar May 15 '24 15:05 Chriscbr

I believe the plan's to move this code into the redis winglib: https://github.com/winglang/wing/issues/5857

Chriscbr avatar Jun 25 '24 17:06 Chriscbr

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] avatar Sep 29 '24 06:09 github-actions[bot]

Closing as ex.Redis has been deprecated in favor of the redis winglib: https://github.com/winglang/winglibs/tree/main/redis

Chriscbr avatar Sep 30 '24 16:09 Chriscbr