I have created a boundary scope as below, using terraform boundary provider .i.e.
Created a global scope, in it created an org, and in the org created 3 projects as dev, stage and prod
resource "boundary_scope" "global" {
global_scope = true
description = "Global Scope"
scope_id = "global"
}
#Creating an organization scope within global:
resource "boundary_scope" "org" {
name = "corp"
description = "corp scope"
scope_id = boundary_scope.global.id
auto_create_admin_role = true
auto_create_default_role = true
}
resource "boundary_scope" "project" {
for_each = toset(var.boundary_projects)
name = each.key
description = "project for ${each.key}"
scope_id = boundary_scope.corp.id
auto_create_admin_role = true
auto_create_default_role = true
}
variable "boundary_projects" {
type = list
default = ["development", "staging", "production"]
}
I was able to successfully created host target inside one of the project (development) using below terraform
# Create host catalogs .i.e. collection of hosts for development
resource "boundary_host_catalog_static" "development" {
name = "development"
description = "development hosts"
scope_id = boundary_scope.project["development"].id
}
# Boundary static host represents the static host
resource "boundary_host_static" mongo_dev_host {
name = "mongo_dev_host"
description = "mongo db primary host"
address = local.internal_db.mongo_primary.url
host_catalog_id = boundary_host_catalog_static.development.id
}
resource "boundary_host_set_static" "mongo_dev_host" {
name = "mongo_dev_host_set"
description = "Host set for mongo db"
host_catalog_id = boundary_host_catalog_static.development.id
host_ids = [
boundary_host_static.mongo_dev_host.id
]
}
# Define boundary target for mongo_dev
resource "boundary_target" "mongo_dev_host" {
type = "tcp"
name = "mongo_dev_host"
description = "mongo dev host"
scope_id = boundary_scope.project["development"].id
session_connection_limit = -1
default_port = 27017
host_source_ids = [
boundary_host_set_static.mongo_dev_host.id
]
}
however I am not able to see this target on the UI (or any other resource ).i.e. i get this page only
when I manually create a project on UI inside the org, I can see other resources,
I have logged in as admin user so not sure why I am getting behaviour, kindly guide !!!
I am uisng version hashicorp/boundary:0.13.0