diff --git a/.wordlist.txt b/.wordlist.txt index 4060549..b3a1f41 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -42,12 +42,20 @@ js JS jq Kyma +Kubeconfig +kubeconfig +kymaruntime +Kyma +kyma macOS md namings Namings NextSteps OAuth +OpenID +oidc +OIDC OpenSSF OpenTofu PEM diff --git a/sample-setups/basic-setup/directory-setup/.terraform.lock.hcl b/sample-setups/basic-setup/directory-setup/.terraform.lock.hcl deleted file mode 100644 index a41edc8..0000000 --- a/sample-setups/basic-setup/directory-setup/.terraform.lock.hcl +++ /dev/null @@ -1,25 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/sap/btp" { - version = "1.11.0" - constraints = ">= 1.11.0, ~> 1.11.0" - hashes = [ - "h1:q9XDheshVlSVbcWKmAlOjF+EGTxvpgS+CyMOyPzh3uw=", - "zh:16647cac2e5062c4ac9db89d622b1de3375e57372841f65f3e6997a26a2f283d", - "zh:548d023762dbd3c2830a151f0beadf58401a70368299625f4c90100997348aed", - "zh:55aba6fba636e2d6524f4b180fb1ff0df6328dd3812682726a0b9972c921dbdf", - "zh:624fb982f4cfb2c26b1448e6270b6ad891592e4e52a00718781579fb5a079adb", - "zh:6319aa5b8c60c3916eff4142ecf6f297a8baf1bc903c98a29b6c248a3984f488", - "zh:7979a475dd06d12255269fe6ec004d1c460bb64869a9d814bec58bec88b65147", - "zh:967b5d6b71053e19dbb017319b8b8bd84d8c7f7cfba6fbb4b23243ce860c370e", - "zh:97b02bc0cd9d74bbf4b89b4f8cd9508f0eec7b772b88704f70b696c425a5165e", - "zh:a398f2697184f49cb5e32a6c7b3f586a8a723a2d533a4cc13e11d8739fabf6b2", - "zh:b9e0a0a986cf8a790c10d469f61c81e9cfc41f4a188f060fb1c5a7612101a4da", - "zh:d03b1276c08f7b9d5da9d89505d1a71c0f806142ef336f26abd85a144a68b895", - "zh:dd6e32cf30f53707fec2acb1e5c69c044a76349706785bfcdee8fbaa6bb053c6", - "zh:e7afd57c00ba45a6be5005620e44db08eec2e6adb97b0af1ffb57963767f8229", - "zh:f29dc297897b96bf39f4b6737e6b9e2b8339c3ddc362fc5466ce901d84ef8cb9", - "zh:f6057496ac45093be445ed8423dc9dfcdbb21e5cc6d6348dbe3a8d5641882f3f", - ] -} diff --git a/sample-setups/basic-setup/subaccount-setup/.terraform.lock.hcl b/sample-setups/basic-setup/subaccount-setup/.terraform.lock.hcl deleted file mode 100644 index 6451737..0000000 --- a/sample-setups/basic-setup/subaccount-setup/.terraform.lock.hcl +++ /dev/null @@ -1,63 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.3" - hashes = [ - "h1:I0Um8UkrMUb81Fxq/dxbr3HLP2cecTH2WMJiwKSrwQY=", - "zh:22d062e5278d872fe7aed834f5577ba0a5afe34a3bdac2b81f828d8d3e6706d2", - "zh:23dead00493ad863729495dc212fd6c29b8293e707b055ce5ba21ee453ce552d", - "zh:28299accf21763ca1ca144d8f660688d7c2ad0b105b7202554ca60b02a3856d3", - "zh:55c9e8a9ac25a7652df8c51a8a9a422bd67d784061b1de2dc9fe6c3cb4e77f2f", - "zh:756586535d11698a216291c06b9ed8a5cc6a4ec43eee1ee09ecd5c6a9e297ac1", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:9d5eea62fdb587eeb96a8c4d782459f4e6b73baeece4d04b4a40e44faaee9301", - "zh:a6355f596a3fb8fc85c2fb054ab14e722991533f87f928e7169a486462c74670", - "zh:b5a65a789cff4ada58a5baffc76cb9767dc26ec6b45c00d2ec8b1b027f6db4ed", - "zh:db5ab669cf11d0e9f81dc380a6fdfcac437aea3d69109c7aef1a5426639d2d65", - "zh:de655d251c470197bcbb5ac45d289595295acb8f829f6c781d4a75c8c8b7c7dd", - "zh:f5c68199f2e6076bce92a12230434782bf768103a427e9bb9abee99b116af7b5", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.7.1" - hashes = [ - "h1:t152MY0tQH4a8fLzTtEWx70ITd3azVOrFDn/pQblbto=", - "zh:3193b89b43bf5805493e290374cdda5132578de6535f8009547c8b5d7a351585", - "zh:3218320de4be943e5812ed3de995946056db86eb8d03aa3f074e0c7316599bef", - "zh:419861805a37fa443e7d63b69fb3279926ccf98a79d256c422d5d82f0f387d1d", - "zh:4df9bd9d839b8fc11a3b8098a604b9b46e2235eb65ef15f4432bde0e175f9ca6", - "zh:5814be3f9c9cc39d2955d6f083bae793050d75c572e70ca11ccceb5517ced6b1", - "zh:63c6548a06de1231c8ee5570e42ca09c4b3db336578ded39b938f2156f06dd2e", - "zh:697e434c6bdee0502cc3deb098263b8dcd63948e8a96d61722811628dce2eba1", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:a0b8e44927e6327852bbfdc9d408d802569367f1e22a95bcdd7181b1c3b07601", - "zh:b7d3af018683ef22794eea9c218bc72d7c35a2b3ede9233b69653b3c782ee436", - "zh:d63b911d618a6fe446c65bfc21e793a7663e934b2fef833d42d3ccd38dd8d68d", - "zh:fa985cd0b11e6d651f47cff3055f0a9fd085ec190b6dbe99bf5448174434cdea", - ] -} - -provider "registry.terraform.io/sap/btp" { - version = "1.11.0" - constraints = "~> 1.11.0" - hashes = [ - "h1:q9XDheshVlSVbcWKmAlOjF+EGTxvpgS+CyMOyPzh3uw=", - "zh:16647cac2e5062c4ac9db89d622b1de3375e57372841f65f3e6997a26a2f283d", - "zh:548d023762dbd3c2830a151f0beadf58401a70368299625f4c90100997348aed", - "zh:55aba6fba636e2d6524f4b180fb1ff0df6328dd3812682726a0b9972c921dbdf", - "zh:624fb982f4cfb2c26b1448e6270b6ad891592e4e52a00718781579fb5a079adb", - "zh:6319aa5b8c60c3916eff4142ecf6f297a8baf1bc903c98a29b6c248a3984f488", - "zh:7979a475dd06d12255269fe6ec004d1c460bb64869a9d814bec58bec88b65147", - "zh:967b5d6b71053e19dbb017319b8b8bd84d8c7f7cfba6fbb4b23243ce860c370e", - "zh:97b02bc0cd9d74bbf4b89b4f8cd9508f0eec7b772b88704f70b696c425a5165e", - "zh:a398f2697184f49cb5e32a6c7b3f586a8a723a2d533a4cc13e11d8739fabf6b2", - "zh:b9e0a0a986cf8a790c10d469f61c81e9cfc41f4a188f060fb1c5a7612101a4da", - "zh:d03b1276c08f7b9d5da9d89505d1a71c0f806142ef336f26abd85a144a68b895", - "zh:dd6e32cf30f53707fec2acb1e5c69c044a76349706785bfcdee8fbaa6bb053c6", - "zh:e7afd57c00ba45a6be5005620e44db08eec2e6adb97b0af1ffb57963767f8229", - "zh:f29dc297897b96bf39f4b6737e6b9e2b8339c3ddc362fc5466ce901d84ef8cb9", - "zh:f6057496ac45093be445ed8423dc9dfcdbb21e5cc6d6348dbe3a8d5641882f3f", - ] -} diff --git a/sample-setups/basic-setup/subaccount-setup/README.md b/sample-setups/basic-setup/subaccount-setup/README.md index 59ee6c9..a43e884 100644 --- a/sample-setups/basic-setup/subaccount-setup/README.md +++ b/sample-setups/basic-setup/subaccount-setup/README.md @@ -41,16 +41,25 @@ To ease the provisioning of entitlements we use the Terraform community module [ The setup of a Cloud Foundry environment is optional. The caller can decide if a Cloud Foundry environment is required or not e.g. when setting up a shared subaccount. The boolean variable is `provision_cf_environment` in the [variables.tf](./variables.tf) file. +The configuration of the setup is done in the corresponding module [`sap-btp-environment/cloudfoundry`](../../modules/sap-btp-environment/cloudfoundry/README.md). + +### Setup of Kyma Environment + +The setup of a Kyma environment is optional. The caller can decide if a Kyma environment is required or not e.g. when setting up a shared subaccount. The boolean variable is `provision_kyma_environment` in the [variables.tf](./variables.tf) file. + +If the Kyma environment is requested, the variable `kyma_administrators` in the [variables.tf](./variables.tf) file must be filled with the users that should be assigned as administrators. This condition is validated + +The configuration of the setup is done in the corresponding module [`sap-btp-environment/kyma`](../../modules/sap-btp-environment/kyma/README.md). ### Output The output defined in the [outputs.tf](./outputs.tf) file returns the main information relevant for the development team namely: - a link to the subaccount -- The ID of the Cloud Foundry org -- The API endpoint of the Cloud Foundry environment - - +- The ID of the Cloud Foundry org if a Cloud Foundry environment is created +- The API endpoint of the Cloud Foundry environment if a Cloud Foundry environment is created +- The URL to the Kyma dashboard if a Kyma environment is created +- The URL to the Kubeconfig file for the Kyma runtime if a Kyma environment is created ## SAP BTP Administrator's Guide - References diff --git a/sample-setups/basic-setup/subaccount-setup/main.tf b/sample-setups/basic-setup/subaccount-setup/main.tf index 12bc390..35a8804 100644 --- a/sample-setups/basic-setup/subaccount-setup/main.tf +++ b/sample-setups/basic-setup/subaccount-setup/main.tf @@ -70,7 +70,7 @@ module "sap_btp_entitlements" { } module "cf_environment" { - source = "../../modules/sap-btp-environment/CloudFoundry" + source = "../../modules/sap-btp-environment/cloudfoundry" count = var.provision_cf_environment ? 1 : 0 @@ -78,3 +78,13 @@ module "cf_environment" { instance_name = module.subaccount_namings.cloudfoundry_org_name cf_org_name = module.subaccount_namings.cloudfoundry_org_name } + +module "kyma_environment" { + source = "../../modules/sap-btp-environment/kyma" + + count = var.provision_kyma_environment ? 1 : 0 + + subaccount_id = btp_subaccount.self.id + instance_name = module.subaccount_namings.kyma_instance_name + kyma_administrators = var.kyma_administrators +} diff --git a/sample-setups/basic-setup/subaccount-setup/outputs.tf b/sample-setups/basic-setup/subaccount-setup/outputs.tf index 136e2c4..0f94389 100644 --- a/sample-setups/basic-setup/subaccount-setup/outputs.tf +++ b/sample-setups/basic-setup/subaccount-setup/outputs.tf @@ -12,3 +12,13 @@ output "cf_org_id" { value = var.provision_cf_environment ? module.cf_environment[0].cf_org_id : "No Cloud Foundry environment was requested to be provisioned" description = "The Cloud Foundry org ID" } + +output "kyma_dashboard_url" { + value = var.provision_kyma_environment ? module.kyma_environment[0].kyma_dashboard_url : "No Kyma environment was requested to be provisioned" + description = "The URL to the Kyma dashboard" +} + +output "kyma_kubeconfig_url" { + value = var.provision_kyma_environment ? module.kyma_environment[0].kyma_kubeconfig_url : "No Kyma environment was requested to be provisioned" + description = "The URL to the Kubeconfig file for the Kyma runtime" +} diff --git a/sample-setups/basic-setup/subaccount-setup/variables.tf b/sample-setups/basic-setup/subaccount-setup/variables.tf index 0b29175..f9706ec 100644 --- a/sample-setups/basic-setup/subaccount-setup/variables.tf +++ b/sample-setups/basic-setup/subaccount-setup/variables.tf @@ -76,3 +76,20 @@ variable "provision_cf_environment" { description = "Provision Cloud Foundry environment in subaccount" default = true } + +variable "provision_kyma_environment" { + type = bool + description = "Provision Kyma environment in subaccount" + default = false +} + +variable "kyma_administrators" { + description = "Users to be assigned as administrators for the Kyma environment." + type = list(string) + default = null + + validation { + condition = var.provision_kyma_environment ? length(var.kyma_administrators) > 0 : true + error_message = "Kyma administrators must be provided if a Kyma environment is provisioned" + } +} diff --git a/sample-setups/modules/sap-btp-environment/CloudFoundry/README.md b/sample-setups/modules/sap-btp-environment/CloudFoundry/README.md index ceb9464..274d105 100644 --- a/sample-setups/modules/sap-btp-environment/CloudFoundry/README.md +++ b/sample-setups/modules/sap-btp-environment/CloudFoundry/README.md @@ -1,4 +1,4 @@ -# SAP BTP - Environment Setup +# SAP BTP - Cloud Foundry Environment Setup This module encapsulates the creation of a Cloud Foundry environment in a subaccount on SAP BTP. diff --git a/sample-setups/modules/sap-btp-environment/CloudFoundry/variables.tf b/sample-setups/modules/sap-btp-environment/CloudFoundry/variables.tf index 5500b45..eac52f9 100644 --- a/sample-setups/modules/sap-btp-environment/CloudFoundry/variables.tf +++ b/sample-setups/modules/sap-btp-environment/CloudFoundry/variables.tf @@ -2,6 +2,7 @@ variable "subaccount_id" { type = string description = "ID of the subaccount where the Cloud Foundry environment will be created." } + variable "instance_name" { type = string description = "Name of the Cloud Foundry environment instance." diff --git a/sample-setups/modules/sap-btp-environment/kyma/README.md b/sample-setups/modules/sap-btp-environment/kyma/README.md new file mode 100644 index 0000000..98f0f1c --- /dev/null +++ b/sample-setups/modules/sap-btp-environment/kyma/README.md @@ -0,0 +1,46 @@ +# SAP BTP - Kyma Environment Setup + +This module encapsulates the creation of a Kyma environment in a subaccount on SAP BTP. The configuration is a basic setup. In a real world scenario, you would likely want to customize the setup further with respect to the available parameters like machine type etc. as described in the [documentation](https://help.sap.com/docs/btp/sap-business-technology-platform/provisioning-and-update-parameters-in-kyma-environment) depending on the stage of the environment (development, test, production). + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.11 | +| [btp](#requirement\_btp) | >= 1.11.0 | + +## Providers + +| Name | Version | +|------|---------| +| [btp](#provider\_btp) | >= 1.11.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [btp_subaccount_entitlement.kymaruntime](https://registry.terraform.io/providers/SAP/btp/latest/docs/resources/subaccount_entitlement) | resource | +| [btp_subaccount_environment_instance.kymaruntime](https://registry.terraform.io/providers/SAP/btp/latest/docs/resources/subaccount_environment_instance) | resource | +| [btp_regions.all](https://registry.terraform.io/providers/SAP/btp/latest/docs/data-sources/regions) | data source | +| [btp_subaccount.this](https://registry.terraform.io/providers/SAP/btp/latest/docs/data-sources/subaccount) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [instance\_name](#input\_instance\_name) | Name of the Kyma environment instance. | `string` | n/a | yes | +| [kyma\_administrators](#input\_kyma\_administrators) | Users to be assigned as administrators. | `list(string)` | `[]` | no | +| [oidc](#input\_oidc) | Custom OpenID Connect IdP configuration to authenticate users in your Kyma runtime. |
object({| `null` | no | +| [plan\_name](#input\_plan\_name) | Desired service plan for the Kyma environment instance.
# the URL of the OpenID issuer (use the https schema)
issuer_url = string
# the client ID for the OpenID client
client_id = string
#the name of a custom OpenID Connect claim for specifying user groups
groups_claim = string
# the list of allowed cryptographic algorithms used for token signing. The allowed values are defined by RFC 7518.
signing_algs = set(string)
# the prefix for all usernames. If you don't provide it, username claims other than “email” are prefixed by the issuerURL to avoid clashes. To skip any prefixing, provide the value as -.
username_prefix = string
# the name of a custom OpenID Connect claim for specifying a username
username_claim = string
})