Any PRs will require running terraform fmt -recursive successfully first. Please install terraform version v0.12.18 on your local setup for this activity.
Why this change is needed
Describe why this change is needed, what issues it will fix and the benefits the change will add
cognito module currently uses count to loop through app_clients and user_groups variable to provision resources. By doing this we need to remember the order of the resource - This is fragile. This PR enhance cognito module to solve issue #226 and #210
Negative effects of this change
Will making this change break or change an existing functionality? flag it here
Yes. If you are migrating from odc terraform version v1.8.0, then you are require to change cognito.tf configuration as per README. e.g. -
Also this will recreates cognito user pool app-clients and user-groups so if you don't wont it then migrate terraform state as explained below -
**step 1:** Download `odc_eks` module latest state file - just for sanity
step 2: Move cognito states using terraform state mv command for all the resources for - aws_cognito_user_group and aws_cognito_user_pool_client(optional)
e.g.
terraform state mv 'module.cognito_auth.aws_cognito_user_pool_client.clients[0]' 'module.cognito_auth.aws_cognito_user_pool_client.clients["sandbox-client"]'
terraform state mv 'module.cognito_auth.aws_cognito_user_group.group[0]' 'module.cognito_auth.aws_cognito_user_group.group["dev-group"]'
step 3: Execute terraform state plant to validate changes
Any PRs will require running
terraform fmt -recursive
successfully first. Please install terraform versionv0.12.18
on your local setup for this activity.Why this change is needed
cognito
module currently uses count to loop throughapp_clients
anduser_groups
variable to provision resources. By doing this we need to remember the order of the resource - This is fragile. This PR enhancecognito
module to solve issue #226 and #210Negative effects of this change
Yes. If you are migrating from odc terraform version
v1.8.0
, then you are require to change cognito.tf configuration as per README. e.g. -app-clients
anduser-groups
so if you don't wont it then migrate terraform state as explained below -step 2: Move cognito states using terraform state mv command for all the resources for -
aws_cognito_user_group
andaws_cognito_user_pool_client
(optional) e.g. terraform state mv 'module.cognito_auth.aws_cognito_user_pool_client.clients[0]' 'module.cognito_auth.aws_cognito_user_pool_client.clients["sandbox-client"]'terraform state mv 'module.cognito_auth.aws_cognito_user_group.group[0]' 'module.cognito_auth.aws_cognito_user_group.group["dev-group"]'
step 3: Execute terraform state plant to validate changes