When running atmos commands to apply the first tim...
# office-hours
m
When running atmos commands to apply the first time, it fails due to "account already belonging to organization", unless we set
organization_enabled
to false in accounts component in catalog stack. If we set this to false, it runs - we then just renamed the existing management account to
core-root
. Is
core-root
referencing the management account, or is there an expectation that
core-root
is another separate account? Once we get past that - the OUs/accounts exist, but when we apply account-settings it's implying the the account_name doesn't exist in local.account_org_role_arns. In your experience, is this likely an issue with what I mention above re: organizations, something running in the wrong workspace and by proxy not having access to the intended tfstate, or something else? This error is occurring in the account-map IAM roles module which is pulling from full account map from account map module.
Copy code
full_account_map = {
  "core-artifacts" = "<REDACTED>"
  "core-audit" = "<REDACTED>"
  "core-dns" = "<REDACTED>"
  "core-identity" = "<REDACTED>"
  "core-root" = "<REDACTED>"
}
How would we go about debugging this? Still working our way around atmos, heh.
e
This is a better question for our Customer Workshop this afternoon.
m
haha yeah I confused the two. Sorry about that.
👍 1
e
heads up @Ben Smith (Cloud Posse) @Dan Miller (Cloud Posse) for workshop later
👍 1
d
Assuming this is in regards to apply the
account
component on initial creation, you may need to import the existing organization into Terraform if it was manually created already
I believe we have docs on that, checking
Copy code
aws organizations describe-organization
atmos terraform import account --stack core-gbl-root 'aws_organizations_organization.this[0]' 'o-7qcakq6zxw'
m
Hey sorry my power went out. But this was great progress. I'll keep digging into it as time permits and will send you guys order of operations on how I got it into this state
b
Thanks! it might be helpful (hopefully things are already git controlled) but try re-vendoring (will overwrite local files) components. Our Components work with the right outputs - that might help reset to what was working before TF typechanges. By removing the account from accounts.yaml, the "bad" account should be removed from output of account-map as well, from TF side of things, you should be good