# AWS resource metadata collection Terraform module

Use Coralogix Terraform modules to install and manage AWS service integrations with Coralogix as modules in your infrastructure code. This guide shows you how to install our [Resource Metadata Collection Lambda](https://coralogix.com/docs/integrations/aws/aws-resource-metadata-collection/index.md).

## Installation

Install our [Resource Metadata Collection Lambda](https://coralogix.com/docs/integrations/aws/aws-resource-metadata-collection/index.md) by adding one of the following declarations to your Terraform project:

### Original mode

```tf
module "resource-metadata" {
  source = "coralogix/aws/coralogix//modules/resource-metadata"

  coralogix_region    = "Europe"
  private_key         = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXX"
}
```

### High volume mode

Use high volume mode when you have:

- More than 5,000 `Lambda` functions in your target AWS region
- A need to collect metadata from multiple AWS accounts and regions

Example with `StaticIAM` cross-account mode:

```tf
module "resource-metadata" {
  source = "coralogix/aws/coralogix//modules/resource-metadata-sqs"

  coralogix_region            = "EU2"
  api_key                     = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXX"
  source_regions              = ["eu-west-1", "eu-west-2"]
  crossaccount_mode           = "StaticIAM"
  crossaccount_iam_role_name  = "MyCrossAccountRole"
}
```

Example with `Config` cross-account mode:

```tf
module "resource-metadata" {
  source = "coralogix/aws/coralogix//modules/resource-metadata-sqs"

  coralogix_region               = "EU2"
  api_key                        = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXX"
  crossaccount_mode              = "Config"
  crossaccount_config_aggregator = "MyCrossAccountAggregator"
  # When the Config aggregator is in a different account, add:
  # crossaccount_config_assume_role = "arn:aws:iam::123456789012:role/ConfigCrossAccountRole"
  crossaccount_iam_role_name     = "MyCrossAccountRole"
}
```

When the AWS Config aggregator lives in a different account, set `crossaccount_config_assume_role` to the IAM role ARN in that account. The collector will assume this role when querying Config.

## Additional resources

Find our open-source modules in GitHub and the Coralogix Terraform Registry:

|                  |                                                                                                                                                                                                                                      |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Documentation    | [Coralogix Terraform Provider](https://coralogix.com/docs/developer-portal/infrastructure-as-code/terraform-provider/coralogix-terraform-provider/index.md)                                                                          |
| Original Mode    | [GitHub](https://github.com/coralogix/terraform-coralogix-aws/tree/master/modules/resource-metadata) [Terraform Registry](https://registry.terraform.io/modules/coralogix/aws/coralogix/latest/submodules/resource-metadata)         |
| High Volume Mode | [GitHub](https://github.com/coralogix/terraform-coralogix-aws/tree/master/modules/resource-metadata-sqs) [Terraform Registry](https://registry.terraform.io/modules/coralogix/aws/coralogix/latest/submodules/resource-metadata-sqs) |

## Support

**Need help?**

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us **via our in-app chat** or by sending us an email at **[support@coralogix.com](mailto:support@coralogix.com)**.
