How to change AccountName for a Control Tower managed account with Account Factory for Terraform

0

Hello, I am using Account Factory for Terraform to create account in our Control Tower Landing Zone. I am able to create new account using aft-account-request repository located on GitHub. I am trying now to update parameters like AccountName, SSOUserEmail, SSOUserFirstName, SSOUserLastName for a given account and I am not able to. When I try to change the parameters in the corresponding account request the account is not updated. I searched on AWS documentation and was not able to find how I can do that. The goal is to be able to manage those parameters using Infrastructure as Code with terraform and not having to manually change them in the console.

demandé il y a 9 mois686 vues
2 réponses
0

Hi, unfortunately Account Factory for Terraform (AFT) is unable to support this feature due to the was the underlying services function. However it is possible to change the account name. It just takes multiple steps.

  1. Change the name of the enrolled account: https://docs.aws.amazon.com/controltower/latest/userguide/change-account-name.html
  2. Since Control Tower creates a Service Catalog Provisioned Product for the new account, update the Account name in the product using this documentation https://docs.aws.amazon.com/controltower/latest/userguide/updating-account-factory-accounts.html#update-provisioned-product
  3. Once those steps are completed, Control Tower should reflect the new Account Name.
  4. To make sure AFT is in sync with the new Control Tower information, update the AFT account request that created the new account with the new name. That won't make any changes other than in DynamoDB tables for the AFT solution. But ensures all information is in sync.

Due to this it's important to try and keep Account Names reasonably static when they are created, they can be changed, it's just still partially manual. Even with using Control Tower directly without AFT, steps 1-3 would still need to be performed in scenarios where the name needs to be changed.

profile pictureAWS
répondu il y a 9 mois
profile picture
EXPERT
vérifié il y a 9 mois
  • Hello,

    Thank you very much for all the solutions provided. It is a little bit annoying because the operation cannot be automated with terraform. I will take note and use those solutions.

0

According to https://repost.aws/knowledge-center/change-organizations-name this must be done by the root user, which on the face of it means that even access keys for an IAM user with the AdministratorAccess policy attached would not be enough.

It's possible to create access keys for the root user https://docs.aws.amazon.com/accounts/latest/reference/root-user-access-key.html though as it says at the top of the page this isn't recommended by AWS.

profile picture
EXPERT
Steve_M
répondu il y a 9 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions