Skip to content

dhoppeIT/terraform-tfe-config

Repository files navigation

terraform-tfe-config

Terraform module to manage the Terraform Cloud/Enterprise resources.

Graph

Graph

Usage

Copy and paste into your Terraform configuration, insert the variables and run terraform init:

module "tfe-organization" {
  source = "dhoppeIT/organization/tfe"

  name  = "dhoppeIT"
  email = "terraform@dhoppe.it"
}

module "tfe-oauth_client" {
  source = "dhoppeIT/oauth_client/tfe"

  organization     = module.tfe-organization.name
  api_url          = "https://api.github.com"
  http_url         = "https://github.com"
  oauth_token      = "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"
  service_provider = "github"
}

module "tfe-workspace" {
  source = "dhoppeIT/workspace/tfe"

  name         = "terraform"
  organization = module.tfe-organization.name
}

module "tfe-variable" {
  source = "dhoppeIT/variable/tfe"

  key          = "TFE_TOKEN"
  value        = module.tfe-oauth_client.oauth_token_id
  category     = "env"
  description  = "The token used to authenticate with Terraform Cloud/Enterprise"
  sensitive    = true
  workspace_id = module.tfe-workspace.id
}

module "tfe-notification" {
  source = "dhoppeIT/notification/tfe"

  name             = "slack"
  enabled          = true
  destination_type = "slack"
  triggers = [
    "run:needs_attention",
    "run:errored"
  ]
  url          = "https://hooks.slack.com/services/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"
  workspace_id = module.tfe-workspace.id
}

module "tfe-registry" {
  source = "dhoppeIT/registry/tfe"

  display_identifier = "dhoppeIT/terraform-tfe-registry"
  identifier         = "dhoppeIT/terraform-tfe-registry"
  oauth_token_id     = module.tfe-oauth_client.oauth_token_id
}

Requirements

Name Version
terraform >= 1.0
aws ~> 4.2
tfe ~> 0.26

Providers

No providers.

Modules

Name Source Version
tfe_notification_aws dhoppeIT/notification/tfe ~> 0.1
tfe_notification_hcloud dhoppeIT/notification/tfe ~> 0.1
tfe_notification_terraform dhoppeIT/notification/tfe ~> 0.1
tfe_oauth_client dhoppeIT/oauth_client/tfe ~> 0.2
tfe_organization dhoppeIT/organization/tfe ~> 0.3
tfe_registry dhoppeIT/registry/tfe ~> 0.1
tfe_team dhoppeIT/team/tfe ~> 0.1
tfe_variable_aws_dev dhoppeIT/variable/tfe ~> 0.2
tfe_variable_aws_prod dhoppeIT/variable/tfe ~> 0.2
tfe_variable_aws_stage dhoppeIT/variable/tfe ~> 0.2
tfe_variable_hcloud_dev dhoppeIT/variable/tfe ~> 0.2
tfe_variable_hcloud_prod dhoppeIT/variable/tfe ~> 0.2
tfe_variable_hcloud_stage dhoppeIT/variable/tfe ~> 0.2
tfe_variable_terraform dhoppeIT/variable/tfe ~> 0.2
tfe_workspace_aws dhoppeIT/workspace/tfe ~> 0.2
tfe_workspace_hcloud dhoppeIT/workspace/tfe ~> 0.2
tfe_workspace_terraform dhoppeIT/workspace/tfe ~> 0.2

Resources

No resources.

Inputs

Name Description Type Default Required
aws_access_key_id The AWS access key to authenticate with Amazon Web Services string null no
aws_secret_access_key The AWS secret key to authenticate with Amazon Web Services string null no
github_token The token used to authenticate with GitHub string null no
hcloud_token_dev The token used to authenticate with Hetzner Cloud string null no
hcloud_token_prod The token used to authenticate with Hetzner Cloud string null no
hcloud_token_stage The token used to authenticate with Hetzner Cloud string null no
slack_webhook_url The destination URL used to send Slack notifications string null no

Outputs

No outputs.

Authors

Created and maintained by Dennis Hoppe.

License

Apache 2 licensed. See LICENSE for full details.