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

🚀 Feature Request: Config Aggregator Support #4067

Closed
gazoakley opened this issue Apr 5, 2018 · 8 comments
Closed

🚀 Feature Request: Config Aggregator Support #4067

gazoakley opened this issue Apr 5, 2018 · 8 comments
Labels
new-resource Introduces a new resource. service/configservice Issues and PRs that pertain to the configservice service.
Milestone

Comments

@gazoakley
Copy link
Contributor

gazoakley commented Apr 5, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

AWS Config now supports aggregating resources across accounts/regions: https://aws.amazon.com/blogs/aws/aws-config-update-aggregate-compliance-data-across-accounts-regions/

New or Affected Resource(s)

  • aws_config_aggregator
  • aws_config_authorization

Potential Terraform Configuration

# Example implementation, may change when developed

resource "aws_config_aggregator" "example" {
  name = "example" # Required

  account_aggregation_source {
    account_ids     = ["123456789012"] # Required
    all_aws_regions = true             # Optional
    aws_regions     = ["eu-west-2"]    # Optional
  }

  organization_aggregation_source {
    all_aws_regions = true          # Optional
    aws_regions     = ["eu-west-2"] # Optional
    role_arn        = ""            # Required
  }
}

resource "aws_config_authorization" "example" {
  authorized_account_id = "123456789012" # Required
  authorized_aws_region = "eu-west-2"    # Required
}

References

@bflad bflad added new-resource Introduces a new resource. service/configservice Issues and PRs that pertain to the configservice service. labels Apr 5, 2018
@marcotesch
Copy link
Contributor

Terraform Configuration Files

# Example implementation, may change when developed

resource "aws_config_aggregator" "example" {
  name = "example" # Required

  account_aggregation_source {
    account_ids     = ["123456789012"] # Required
    all_aws_regions = true             # Optional
    aws_regions     = ["eu-west-2"]    # Optional
  }

  organization_aggregation_source {
    all_aws_regions = true          # Optional
    aws_regions     = ["eu-west-2"] # Optional
    role_arn        = ""            # Required
  }
}

resource "aws_config_authorization" "example" {
  authorized_account_id = "123456789012" # Required
  authorized_aws_region = "eu-west-2"    # Required
}

I think it would be better to have the all_aws_regions argument as a required argument in the first place, or the default value set to false instead of true.

@gazoakley
Copy link
Contributor Author

The Config API seems to default all_aws_regions to false if not specified - but it does return an error if you specify it as true and then also set aws_regions. I'd probably go for the latter to make configuration easier and match what the API does.

@lorengordon
Copy link
Contributor

I don't suppose there's a way to do this that allows accounts to be added to the aggregator over time, as separate resources? I'm imagining a resource to create the aggregator in one config, then in a separate config a resource that adds the account to that aggregator. I think this would improve composition. Otherwise every time we create an account, we also need to re-run the terraform config that manages the aggregator config in its entirety (with some mechanism that collects the accounts and updates the account list).

It doesn't really look like the API would be terribly supportive of this approach though. :(

But... perhaps an aggregator per account would work...

@hoeg
Copy link

hoeg commented May 24, 2018

Until this gets merged, what are the best practices for getting a centralized overview of these logs?

@gazoakley gazoakley changed the title Feature Request: Config Aggregator Support 🚀 Feature Request: Config Aggregator Support May 24, 2018
@jayzes
Copy link

jayzes commented May 24, 2018

@hoeg I've been looking for the same - my current approach is to use a Terraform-managed Cloudformation template to create all of the aggregator resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-configurationaggregator.html). It's a little hacky for sure, but I think it's going to work.

@bflad bflad added this to the v1.22.0 milestone Jun 3, 2018
@bflad
Copy link
Contributor

bflad commented Jun 3, 2018

The following new resources have been merged in (thanks @gazoakley!) and will release with v1.22.0 of the AWS provider, middle of this week:

  • aws_config_aggregate_authorization
  • aws_config_configuration_aggregator

@bflad bflad closed this as completed Jun 3, 2018
@bflad
Copy link
Contributor

bflad commented Jun 5, 2018

This has been released in version 1.22.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 5, 2020

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.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. service/configservice Issues and PRs that pertain to the configservice service.
Projects
None yet
Development

No branches or pull requests

6 participants