Crossplane
The guide Deploy Cloud Services shows how to provision cloud resources by Terraform in CLI and VelaUX. This tutorial will talk about how to provision Cloud Resources by Crossplane.
Let's take cloud provider AWS as an example.
Enable addon crossplane-aws
vela addon enable crossplane-aws
Authenticate AWS Provider for Crossplane
Apply the application below. You can get AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY per https://aws.amazon.com/blogs/security/wheres-my-secret-access-key/.
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: aws
namespace: vela-system
spec:
components:
- name: aws
type: crossplane-aws
properties:
name: aws
AWS_ACCESS_KEY_ID: xxx
AWS_SECRET_ACCESS_KEY: yyy
Provision cloud resources
Let's provision a S3 bucket. Please apply the application below.
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: s3-poc
spec:
components:
- name: dev
type: crossplane-aws-s3
properties:
name: kubevela-test-0714
acl: private
locationConstraint: us-east-1
After the application gets running
, you can check the bucket by AWS cli or console.
$ vela ls
APP COMPONENT TYPE TRAITS PHASE HEALTHY STATUS CREATED-TIME
s3-poc dev crossplane-aws-s3 running healthy 2022-06-16 15:37:15 +0800 CST
$ aws s3 ls
2022-06-16 15:37:17 kubevela-test-0714
More
All Crossplane cloud resources are defined as ComponentDefinitions and are about to be delivered in Crossplane provider addons, like crossplane-aws. If your requirements are not met by the addons, you can define your own component type per the instructions on how to define customized component.