Skip to content

Issue delegating admin account #2

@jmreicha

Description

@jmreicha

I am attempting to import manually created settings and manage them using this module. I am running into an issue where I am unable to import the guardduty admin account.

Here is the config.

  ...
  admin_account_id = data.aws_caller_identity.current.account_id

  auto_enable_organization_members = "NEW"

  enable_kubernetes_protection = true
  enable_malware_protection    = true
  enable_s3_protection         = true

  guardduty_detector_id = module.guardduty_detector.guardduty_detector.id
  ...

Here is the error.

terragrunt import 'aws_guardduty_organization_admin_account.this[0]' '1234567890'
aws_guardduty_organization_admin_account.this[0]: Importing from ID "1234567890"...
aws_guardduty_organization_admin_account.this[0]: Import prepared!
  Prepared aws_guardduty_organization_admin_account for import
aws_guardduty_organization_admin_account.this[0]: Refreshing state... [id=1234567890]
╷
│ Error: reading GuardDuty Organization Admin Account (1234567890): BadRequestException: The request failed because you are not the master account for your AWS Organization.
│ {
│   RespMetadata: {
│     StatusCode: 400,
│     RequestID: "e2db002a-e1d1-49af-93b9-cc4bde0b146f"
│   },
│   Message_: "The request failed because you are not the master account for your AWS Organization.",
│   Type: "InvalidInputException"
│ }

I am not seeing a way in this module to skip the admin account resource creation and only import the org configuration, which I was able to import successfully. The account was delegated via the root account originally but I would like to manage all the config in the delegated account. Hopefully I am missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions