Secrets¶
Secrets in InfraKitchen provide a secure way to manage sensitive configuration data required by your infrastructure resources. They enable safe storage and retrieval of credentials, API keys, and other sensitive values needed during resource provisioning.
🎯 What are Secrets?¶
A Secret in InfraKitchen is a secure storage mechanism that contains:
- Sensitive configuration values (passwords, API keys, tokens)
- Cloud provider secrets (AWS Secrets Manager, GCP Secret Manager)
- Custom key-value pairs for application configuration
- Provider-specific settings (regions, resource groups, account names)
All secret values are encrypted at rest using industry-standard encryption and are decrypted only when needed during resource provisioning.
🔍 Secret Properties¶
All secrets share common properties:
| Property | Description | Required |
|---|---|---|
| Name | Human-readable identifier | ✅ |
| Secret Type | Type of secret (currently only tofu supported) |
✅ |
| Secret Provider | Provider (AWS, GCP, Custom) | ✅ |
| Configuration | Provider-specific settings | ✅ |
| Integration | Associated cloud integration (if applicable) | ❌ |
| Description | Purpose and usage notes | ❌ |
| Labels | Tags for categorization and filtering | ❌ |
📦 Secret Providers¶
InfraKitchen supports multiple secret storage providers:
Cloud-Native Providers¶
| Provider | Description | Use Case |
|---|---|---|
| AWS | AWS Secrets Manager | Store secrets in AWS for resources deployed to AWS |
| GCP | GCP Secret Manager | Store secrets in GCP for GCP-deployed resources |
Custom Provider¶
| Provider | Description | Use Case |
|---|---|---|
| Custom | InfraKitchen-managed key-value pairs | Store arbitrary secrets encrypted within InfraKitchen |
🔐 How Secrets Work¶
Creation Flow¶
- Create Secret → Choose provider and configure settings
- Encryption → Values are encrypted using your encryption key
- Storage → Encrypted data is stored in InfraKitchen database
- Reference → Resources reference secrets in their configuration
Usage Flow¶
- Resource Provisioning → Resource references a secret
- Authentication → InfraKitchen authenticates to secret provider (if cloud-based)
- Retrieval → Secret values are fetched and decrypted
- Injection → Values are injected into Terraform/OpenTofu as variables (setup variables with TF_VAR_ prefix)
- Cleanup → Decrypted values exist only in memory during execution
🛠️ Managing Secrets¶
Create¶
Only platform engineers can create secrets:
- Navigate to Secrets page
- Click "Create Secret"
- Select secret provider (AWS, GCP, or Custom)
- Fill in required configuration fields
- (Optional) Link to a cloud integration
- Add labels for organization
- Validate and save
Update¶
Secrets can be updated to modify values or configuration:
- Edit existing secret
- Update description or labels
- Modify configuration (provider-dependent)
- Save changes
- Resources will use updated values on next provision
Provider and Type Cannot Change
The secret_provider and secret_type fields are immutable after creation. To change providers, create a new secret.
Delete¶
⚠️ Warning: Deleting a secret will prevent resources using it from being provisioned.
Before deletion:
- Ensure no resources reference it
- Update or destroy dependent resources
- Document the change
- Consider disabling instead of deleting
Disable/Enable¶
Secrets can be disabled without deletion:
- Disabled secrets cannot be used by new resource provisions
- Existing resources retain their configuration
- Can be re-enabled at any time
📚 Provider-Specific Guides¶
Cloud Provider Secrets¶
- AWS Secrets Manager - AWS Secrets Manager integration
- GCP Secret Manager - GCP Secret Manager configuration
Custom Secrets¶
- Custom Secrets - InfraKitchen-managed key-value pairs
🆘 Troubleshooting¶
Common issues and solutions:
| Issue | Possible Cause | Solution |
|---|---|---|
| Cannot create secret | Missing permissions | Verify platform engineer role |
| Secret not found during provision | Name mismatch | Check secret name matches resource reference |
| Cloud provider secret fails | Invalid integration | Verify integration credentials and permissions |
| Encryption error | Missing encryption key | Configure ENCRYPTION_KEY environment variable |