Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trail created but not under the acount runs terraform #238

Open
forrayz opened this issue Jan 4, 2023 · 0 comments
Open

trail created but not under the acount runs terraform #238

forrayz opened this issue Jan 4, 2023 · 0 comments

Comments

@forrayz
Copy link

forrayz commented Jan 4, 2023

bug/limitation?

module creates the CloudTrail but runs into an error

Error: Error creating CloudTrail: TrailAlreadyExistsException: Trail trailName already exists for customer: ID_of_MyAnotherAccount (Service: AWSCloudTrail; Status Code: 400; Error Code: TrailAlreadyExistsException;

the ID_of_MyAnotherAccount is not the account I am using for terraform provisioning.

Code Snippet (versions used)

module "aws_cloudtrail" {
  source                      = "trussworks/cloudtrail/aws"
  version                     = "~> 4.5"
  trail_name                  = "${var.trail_name}-${var.project_name}"
  org_trail                   = true
  cloudwatch_log_group_name   = "${var.trail_name}-${var.project_name}-events"
  s3_bucket_name              = module.logs.aws_logs_bucket
  s3_key_prefix               = var.s3_key_prefix
  tags                        = local.tags
  log_retention_days          = 90
  enabled                     = true
  key_deletion_window_in_days = 30
  iam_policy_name             = "${var.trail_name}-${var.project_name}-logs-policy"
}

Steps to reproduce

  • based on amazon doc Add a CloudTrail delegated administrator delegate access to an administrator account
  • run the above code with terraform using the administrator which has the permission granted above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant