-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[New Resource]: Delegated Administrator for CloudTrail #29179
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
You can delegate admin control in the following way. resource "aws_organizations_delegated_administrator" "this" {
account_id = "your-account-id"
service_principal = "cloudtrail.amazonaws.com"
} |
@rojones94 No, there is a dedicated API for registering cloudtrail delegated administrator. https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-delegated-administrator.html |
Actually, this will not work and will prevent delegation from working. Just to explain how bad this is, if you do the delegation this way it appears to work, but you can't do anything. If you try to run this command after applying the resource quoted above you'll see this: $ aws cloudtrail register-organization-delegated-admin --member-account-id="123456789012"
An error occurred (AccountRegisteredException) when calling the RegisterOrganizationDelegatedAdmin operation: The specified AWS account 370208956287 is already registered as the CloudTrail delegated administrator. You must delete the $ aws cloudtrail register-organization-delegated-admin --member-account-id="123456789012" This is why a new resource utilizing the Cloudtrail APIs is required. |
I'm curious did you have already implemented delegated admin for cloudtrail using this? If so, could you explain? Because AWS has absolutely no documentation on how to do it using the organization's APIs instead of Cloudtrail's |
@posquit0 After some research, I found the solution. resource "aws_iam_service_linked_role" "cloudtrail_service_role" {
aws_service_name = "cloudtrail.amazonaws.com"
} This resource should be in your root account. Also, you are going to need to set up s3's policy manually; I will assume you know how to do it, but let me know if you need further help. |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.63.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
Requested Resource(s) and/or Data Source(s)
Potential Terraform Configuration
References
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: