This script configures the setup of the SAP AI Core
service in a subaccount
The setup comprises the following resources:
- Creation of a SAP BTP subaccount (optional - if variable
create_subaccount
is set totrue
) - Entitlement of the SAP AI Core service (optional - if variable
create_subaccount
is set totrue
) - Creation of a service instance of the SAP AI Core service
- Creation of a service key for the SAP AI Core service instance
- Subscription to the SAP AI Core Launchpad
- Role collection assignments to users for the SAP AI Core Launchpad
To deploy the resources you must:
-
Change the directory into the folder
gen_ai_setup
:cd gen_ai_setup
-
Change the variables in the
terraform.tfvars
file to meet your requirements. Do not forget to assign your user to theai_launchpad_user
variable. -
Export the variables for user name and password:
export BTP_USERNAME='<Email address of your BTP user>' export BTP_PASSWORD='<Password of your BTP user>'
As an alternative, you can also use the devcontainer and store the values of
BTP_USERNAME
andBTP_PASSWORD
in adevcontainer.env
file. -
Initialize your Terraform workspace:
terraform init
-
You can check what Terraform plans to apply based on your configuration:
terraform plan
-
Apply your configuration to provision the resources:
terraform apply
-
The script will create a
.env
, containing the environment variables that you can use later in applications to use the GenAI service.
To remove the assets e.g., to avoid unnecessary costs, destroy the setup by running the following command in the gen_ai_setup
directory:
terraform destroy