terraform-aws-transit-gateway icon indicating copy to clipboard operation
terraform-aws-transit-gateway copied to clipboard

fix: Change count for for_each on ram_principal_association due resource recreation

Open ebarros29 opened this issue 2 years ago β€’ 34 comments

Description

Change count for for_each on aws_ram_principal_association due resource recreation.

Motivation and Context

In order to avoid recreation of the resource aws_ram_principal_association everytime that a principal is removed or inserted in the middle of the list, it's necessary to change count for for_each loop.

Breaking Changes

The meta-argument count use indices to organize the list, for instance aws_ram_principal_association.this["0"]. The meta-argument for_eachuses "key, value" to organize it, for instance aws_ram_principal_association.this["01234567890123"] where 01234567890123 will be the principal account ID for this case. So due these differences it will cause a recreation of all existing aws_ram_principal_association resources and the people who use RAM for share the TGW will need to run terraform state mv in order to avoid this recreation.

How Has This Been Tested?

It has been tested using the module with input share_tgw = true by analysing the plan and outputs after apply.

  • [ ] I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • [ ] I have tested and validated these changes using one or more of the provided examples/* projects
  • [x] I have executed pre-commit run -a on my pull request

ebarros29 avatar Dec 23 '22 03:12 ebarros29

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Jan 27 '23 00:01 github-actions[bot]

Folks! could you review this PR? I think it's a good improvement...

ebarros29 avatar Jan 28 '23 17:01 ebarros29

can we remove the stale label?

ebarros29 avatar Jan 28 '23 17:01 ebarros29

@antonbabenko @bryantbiggs Please, could you review this PR?

ebarros29 avatar Jan 28 '23 17:01 ebarros29

This is a breaking change and it has some fundamental issues with regards to the use of for_each

Yes, it is! I described this breaking change into the PR description and I've tested this change...

What kind of issues we can expect different from what has been described into PR?

ebarros29 avatar Feb 05 '23 19:02 ebarros29

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Apr 29 '23 00:04 github-actions[bot]

Just to remove stale label...

ebarros29 avatar May 09 '23 00:05 ebarros29

Maybe an approach could be to write a local module for the association and then use for_each to instantiate many instances of the module?

drAlberT avatar May 24 '23 22:05 drAlberT

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Jun 24 '23 00:06 github-actions[bot]

keep alive

Jarodiv avatar Jun 24 '23 22:06 Jarodiv

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Jul 26 '23 00:07 github-actions[bot]

Any chance to have this done? (keep alive)

drAlberT avatar Aug 02 '23 14:08 drAlberT

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Sep 03 '23 00:09 github-actions[bot]

@ebarros29 @bryantbiggs is this MR destined to be closed?

drAlberT avatar Sep 11 '23 08:09 drAlberT

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Oct 12 '23 00:10 github-actions[bot]

ka

drAlberT avatar Oct 12 '23 10:10 drAlberT

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Nov 12 '23 00:11 github-actions[bot]

Sadly inactivity seems to be a big issue in this project. Combined with PRs/issues being automatically closed after two weeks of no activity, probably many valuable contributions get lost (keep alive)

Jarodiv avatar Nov 13 '23 12:11 Jarodiv

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Jan 11 '24 00:01 github-actions[bot]

keep alive

ebarros29 avatar Jan 18 '24 21:01 ebarros29

Sorry guys, It has been busy days since my last comment 😫

Actually I don't know if it's worth to go ahead with this PR, since we have this huge refactor #113 already marked as wip...

ebarros29 avatar Jan 19 '24 01:01 ebarros29

Sorry guys, It has been busy days since my last comment 😫

Actually I don't know if it's worth to go ahead with this PR, since we have this huge refactor #113 already marked as wip...

If it manages this issue then it should be ok to close this PR. Otherwise I'd go ahead and the refactor will pick the fix from this PR as well.

drAlberT avatar Jan 19 '24 10:01 drAlberT

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Feb 19 '24 00:02 github-actions[bot]

"Keep alive" post

Jarodiv avatar Feb 20 '24 21:02 Jarodiv

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Mar 23 '24 00:03 github-actions[bot]

"Keep alive" post

Jarodiv avatar Mar 23 '24 12:03 Jarodiv

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Apr 24 '24 00:04 github-actions[bot]

"Keep alive" post

Jarodiv avatar Apr 24 '24 15:04 Jarodiv

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar May 26 '24 00:05 github-actions[bot]

"Keep alive" post

Jarodiv avatar May 27 '24 18:05 Jarodiv