Skip to content

nsbno/terraform-aws-account-metadata

Repository files navigation

Account Metadata

A data module that gives you typical values that are needed in your environment.

Usage

To use this module, just add it to your terraform!

module "metadata" {
  source = "github.com/nsbno/terraform-aws-account-metadata?ref=x.y.z"
}

That’s it 😄

Remember to check out the outputs to see all metadata.

You can use the output of this module like this:

module "ecs_task" {
  source = "..."

  vpc_id                   = module.metadata.network.vpc_id
  private_subnet_ids       = module.metadata.network.private_subnet_ids

  # [...]

  lb_listeners = [{
    listener_arn      = module.metadata.load_balancer.https_listener_arn
    security_group_id = module.metadata.load_balancer.security_group_id

    conditions = [{
      path_pattern = "/${local.application_name}/*"
    }]
  }]
}

Or if you have an API Gateway:

module "api_gateway" {
  source = "..."

  domain_name = module.metadata.dns.domain_name
}

Examples

Simple Example

In reality just the example you can see on the top of this README.

Example with Options

Here you can see how to turn off individual parts of the metadata. Usefull when the account doesn’t have the resources.