Skip to content

Instantly share code, notes, and snippets.

@caffeinetiger
Last active April 18, 2022 18:30
Show Gist options
  • Save caffeinetiger/558e588ad72c6ca80e19e64c2cee8b15 to your computer and use it in GitHub Desktop.
Save caffeinetiger/558e588ad72c6ca80e19e64c2cee8b15 to your computer and use it in GitHub Desktop.
Example of using data resources to get current AWS region and account id
data "aws_region" "current" {}
data "aws_caller_identity" "current" {}
locals {
aws_region = data.aws_region.current.name
aws_account_id = data.aws_caller_identity.current.account_id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment