Official Upbound providers come with bundled schemas that you can leverage with popular VSCode extensions to enhance your Upbound development experience when authoring compositions. In VSCode, your Upbound project gets:
- Inline schema information
- Linting
- Autocompletion
Upbound supports Python and KCL schemas.
Installation
To install the Python extension, search for Python in your extensions search bar or go to the Marketplace. in VSCode.
You’ll also need a Python interpreter v3.12 installed on your machine. https://code.visualstudio.com/docs/python/python-tutorial#_install-a-python-interpreter.
Create a virtual environment to make sure the extension uses the correct version.
Usage
After you install the extensions, you must use an official Upbound provider that includes bundled schemas.
In your project upbound.yaml
file, specify the provider and the latest version:
apiVersion: meta.dev.upbound.io/v1alpha1
kind: Project
spec:
dependsOn:
- provider: xpkg.upbound.io/upbound/provider-aws
version: v0.13.0
Once configured, you can open Python or KCL files in VSCode and start compositing your resources.
Features
With the extensions and compatible Upbound provider, the following features are available:
Inline schema information
View descriptions, property types, and other schema details directly in your code editor window as you work with composed Managed Resources (MRs).
vpc = {
"apiVersion": "ec2.aws.upbound.io/v1beta1",
"kind": "VPC",
"spec": {
"forProvider": {
"cidrBlock": "10.0.0.0/16", # Hover to see description and type
"enableDnsHostnames": True, # Hover to see description and type
}
}
}
Linting
Real-time linting ensures:
- Property types are matched
- Managed Resource required fields are populated
vpc = {
"apiVersion": "ec2.aws.upbound.io/v1beta1",
"kind": "VPC",
"spec": {
"forProvider": {
"cidrBlock": 10, # Error: Expected string, got integer
# Error: Missing required field 'region'
}
}
}
Auto-completion
As you type, the extension suggests valid properties and values for Managed Resources.
vpc = {
"apiVersion": "ec2.aws.upbound.io/v1beta1",
"kind": "VPC",
"spec": {
"forProvider": {
"ci" # Auto-complete suggests: cidrBlock, cidrBlockAssociations, etc.
}
}
}
Auto-generate composed resources
Scaffold a new Managed Resource by using the auto-generate feature.
Start typing: vpc = {"kind": "V"}
Select "VPC" from the autocomplete suggestions
The extension generates:
vpc = {
"apiVersion": "ec2.aws.upbound.io/v1beta1",
"kind": "VPC",
"spec": {
"forProvider": {
"cidrBlock": "",
"region": ""
}
}
}
Resource references
Navigate between related resources in your composition.
subnet = {
"apiVersion": "ec2.aws.upbound.io/v1beta1",
"kind": "Subnet",
"spec": {
"forProvider": {
"vpcIdRef": {
"name": "my-vpc" # Ctrl+Click (Cmd+Click on Mac) to navigate to the VPC definition
}
}
}
}
Troubleshooting
If you’re not seeing the enhanced features:
- Ensure you’re using an official Upbound provider with bundled schemas.
- Check that the provider version in your
upbound.yaml
file matches the installed provider version. - Reload your VSCode window or restart VSCode.