102 lines
1.6 KiB
Markdown
Executable File
102 lines
1.6 KiB
Markdown
Executable File
# Lab Execution
|
|
|
|
## 1. Prepare The Environment
|
|
|
|
Windows:
|
|
|
|
```powershell
|
|
powershell -ExecutionPolicy Bypass -File .\scripts\bootstrap.ps1
|
|
```
|
|
|
|
Linux/macOS:
|
|
|
|
```bash
|
|
chmod +x scripts/*.sh
|
|
./scripts/bootstrap.sh
|
|
```
|
|
|
|
## 2. Configure Terraform
|
|
|
|
Windows:
|
|
|
|
```powershell
|
|
Copy-Item terraform\envs\demo\terraform.tfvars.example terraform\envs\demo\terraform.tfvars
|
|
notepad terraform\envs\demo\terraform.tfvars
|
|
```
|
|
|
|
Linux/macOS:
|
|
|
|
```bash
|
|
cp terraform/envs/demo/terraform.tfvars.example terraform/envs/demo/terraform.tfvars
|
|
vi terraform/envs/demo/terraform.tfvars
|
|
```
|
|
|
|
Fill in:
|
|
|
|
- `tenancy_ocid`
|
|
- `compartment_ocid`
|
|
- `user_ocid`
|
|
- `fingerprint`
|
|
- `private_key_path`
|
|
- `region`
|
|
- `adb_admin_password`
|
|
|
|
## 3. Validate Terraform
|
|
|
|
Windows:
|
|
|
|
```powershell
|
|
powershell -ExecutionPolicy Bypass -File .\scripts\validate-terraform.ps1
|
|
```
|
|
|
|
Linux/macOS:
|
|
|
|
```bash
|
|
./scripts/validate-terraform.sh
|
|
```
|
|
|
|
## 4. Apply Infrastructure
|
|
|
|
```bash
|
|
cd terraform/envs/demo
|
|
terraform init
|
|
terraform plan -out tfplan
|
|
terraform apply tfplan
|
|
```
|
|
|
|
## 5. Run A Scenario
|
|
|
|
Windows:
|
|
|
|
```powershell
|
|
powershell -ExecutionPolicy Bypass -File .\scripts\run-scenario.ps1 -Scenario 01-ai-prompt-injection -ConnectString "<connect_string>"
|
|
```
|
|
|
|
Linux/macOS:
|
|
|
|
```bash
|
|
./scripts/run-scenario.sh 01-ai-prompt-injection "<connect_string>"
|
|
```
|
|
|
|
## 6. Reset A Scenario
|
|
|
|
Windows:
|
|
|
|
```powershell
|
|
powershell -ExecutionPolicy Bypass -File .\scripts\reset-scenario.ps1 -Scenario 01-ai-prompt-injection -ConnectString "<connect_string>"
|
|
```
|
|
|
|
Linux/macOS:
|
|
|
|
```bash
|
|
./scripts/reset-scenario.sh 01-ai-prompt-injection "<connect_string>"
|
|
```
|
|
|
|
## 7. Destroy The Environment
|
|
|
|
```bash
|
|
cd terraform/envs/demo
|
|
terraform destroy
|
|
```
|
|
|