-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add workspace starterkit for STACKIT university #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Jelledb
wants to merge
1
commit into
main
Choose a base branch
from
feature/ws-starterkit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...meshstack-trial/platforms/stackit/buildingblocks/workspace-starterkit/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
foundations/meshstack-trial/platforms/stackit/buildingblocks/workspace-starterkit/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Owns every resource the workspace-starterkit building block creates or deletes on the | ||
| # admin-scoped provider it authenticates with (see modules/meshstack/workspace-starterkit). | ||
| # Created here instead of injected from the environment so no admin credential needs to be | ||
| # provisioned or rotated by hand. | ||
| resource "meshstack_api_key" "workspace_starterkit_admin" { | ||
| metadata = { | ||
| owned_by_workspace = "meshcloud" | ||
| } | ||
|
|
||
| spec = { | ||
| display_name = "workspace-starterkit-admin" | ||
| permissions = [ | ||
| "ADM_WORKSPACE_SAVE", "ADM_WORKSPACE_LIST", "ADM_WORKSPACE_DELETE", | ||
| "ADM_PAYMENTMETHOD_SAVE", "ADM_PAYMENTMETHOD_LIST", "ADM_PAYMENTMETHOD_DELETE", | ||
| "ADM_PROJECT_SAVE", "ADM_PROJECT_LIST", "ADM_PROJECT_DELETE", | ||
| "ADM_TENANT_SAVE", "ADM_TENANT_LIST", "ADM_TENANT_DELETE", | ||
| "ADM_WORKSPACEPRINCIPALBINDING_SAVE", "ADM_WORKSPACEPRINCIPALBINDING_LIST", "ADM_WORKSPACEPRINCIPALBINDING_DELETE", | ||
| "ADM_PROJECTPRINCIPALROLE_SAVE", "ADM_PROJECTPRINCIPALROLE_LIST", "ADM_PROJECTPRINCIPALROLE_DELETE", | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| locals { | ||
| hub = { | ||
| git_ref = "e7ce957b33283b257e073d6b81f0e95d0f5fd546" | ||
| # Vital: keeps this BBD in draft. A draft BBD is only orderable from its owning workspace | ||
| # (meshcloud), never published to the marketplace — we want this hidden, not offered generally. | ||
| bbd_draft = true | ||
| } | ||
| } | ||
|
|
||
| module "workspace_starterkit" { | ||
| source = "github.com/meshcloud/meshstack-hub//modules/meshstack/workspace-starterkit?ref=${local.hub.git_ref}" | ||
|
|
||
| meshstack = { | ||
| owning_workspace_identifier = "meshcloud" | ||
| tags = { | ||
| # Required: meshStack's "Restrict BuildingBlockDefinitions by Company" policy | ||
| # requires this BBD's Company tag to intersect with its owning workspace's (meshcloud's) | ||
| # Company=stackit-university tag, or creating the BBD fails outright. This is unrelated to | ||
| # ordering visibility, which bbd_draft above is what actually controls (kept hidden). | ||
| building_block = { Company = ["stackit-university"] } | ||
| # The STACKIT Sandbox landing zone is itself tagged Company=stackit-university and enforces | ||
| # a "Restrict LandingZones by Company" policy: any workspace placing a tenant there must share | ||
| # that tag. Every workspace this building block creates needs it to be able to order a tenant | ||
| # on that landing zone. | ||
| workspace = { Company = ["stackit-university"] } | ||
| payment_method = {} | ||
| project = {} | ||
| } | ||
| } | ||
|
|
||
| hub = local.hub | ||
|
|
||
| # STACKIT University sandbox: every onboarded team gets a project+tenant here. | ||
| platform_uuid = "b66e3542-5887-4d48-9f06-968dbc98d97c" | ||
| landing_zone_name = "stackit-sandbox-default" | ||
|
|
||
| meshstack_admin_api_key = meshstack_api_key.workspace_starterkit_admin.status.client_id | ||
| meshstack_admin_api_secret = meshstack_api_key.workspace_starterkit_admin.status.client_secret | ||
|
|
||
| workspace_expiry_tag_key = "TrialEnd" | ||
| } | ||
15 changes: 15 additions & 0 deletions
15
...ions/meshstack-trial/platforms/stackit/buildingblocks/workspace-starterkit/terragrunt.hcl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| include "common" { | ||
| path = find_in_parent_folders("common.hcl") | ||
| } | ||
|
|
||
| generate "provider" { | ||
| path = "provider.tf" | ||
| if_exists = "overwrite" | ||
| contents = <<EOF | ||
| provider "meshstack" { | ||
| endpoint = "https://api.try.meshstack.io" | ||
| apikey = "a17b9ad7-14c8-44cc-94ef-cb6b4db7ac8a" | ||
| apisecret = "${get_env("MESHSTACK_API_SECRET_AKS_IDP")}" | ||
| } | ||
| EOF | ||
| } |
10 changes: 10 additions & 0 deletions
10
...dations/meshstack-trial/platforms/stackit/buildingblocks/workspace-starterkit/versions.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| terraform { | ||
| required_version = ">= 1.12.0" | ||
|
|
||
| required_providers { | ||
| meshstack = { | ||
| source = "meshcloud/meshstack" | ||
| version = ">= 0.24.0" | ||
| } | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment that this is vital: we want this BBD to stay hidden in meshcloud workspace.