Create Resources
The Flowcore CLI allows you to create resources in Flowcore using a manifest file. This is useful for creating multiple resources at once, or for creating resources in a CI/CD pipeline.
Data Cores
To create a data core, you can use the apply
command with a manifest file. The manifest file should be in YAML format.
to generate a manifest file, you can use the init
command:
this will generate a flowcore.yaml
file, then run the following command to apply the manifest file
this will create a plan to create the data core, and then apply the plan to create the data core.
Scenarios
To create a scenario, you can use the apply
command with a manifest file. The manifest file should be in YAML format.
to generate a manifest file, you can use the init
command:
this will generate a flowcore.yaml
file, then run the following command to apply the manifest file
this will create a plan to create the scenario, and then apply the plan to create the scenario.
Apply all resources
You can also apply all resources in a manifest file at once by using the root apply
command:
Delete Protection
By default, data cores are created without delete protection enabled. You can enable delete protection by setting
deleteProtection
to true
for each resource in the manifest file.
Keep in mind that if delete protection is enabled on a resource all nested resources will also have delete protection enabled. To delete a resource with delete protection enabled, you must first disable delete protection.
Transformer Size
By default, transformers are created with a size of SMALL
. You can set the size of the transformer by setting the size
field to SMALL
, MEDIUM
or LARGE
or XLARGE
in the manifest file.
This will set the resource requirements for the transformers. The size of the transformer will determine the amount of CPU and memory allocated to the transformer.
Page Size
By default, transformers are created with a page size of 1000
. You can set the page size of the transformer by setting the pageSize
field to a number in the manifest file.
Default Start Date
By default, transformers are created with a default start date of 7 days
. You can set the default start date of the transformer by setting the defaultStartDateTime
field to a number in the manifest file.
This will set the default start date of the transformer to selected ISO start time.
Concurrency
By default, transformers are created with a concurrency of 1
. You can set the concurrency of the transformer by setting the concurrency
field to a number in the manifest file.
This will set the number of concurrent executions of the transformer.
Replicas
By default, transformers are created with a single replica. You can set the number of replicas of the transformer by setting the replicas
field to a number in the manifest file.
This will determine the number of replicas of the transformer.
Private Github Artifacts
If you want to use a private Github artifact, you can add the following to the manifest file:
This will use the Github PAT stored as an organization secret to download the artifact.
To create a Github PAT secret, you can use this link (https://github.com/settings/tokens/new) to create a new token.
You need to have the repo
scope to be able to download the artifact. then you can add the secret to the github repository using the following command:
Endpoints
To add an endpoint to a transformer, you can add the this to the manifest file:
This will set up an endpoint for the transformer that will send data returned from the transformer to the specified data core.
To create a read model endpoint, you can add the following to the manifest file:
This will set up an endpoint for the transformer that will send data returned from the transformer to the specified database.
Advanced Configuration
Shell
You can customize what shell container is used for the transformer by adding the following to the manifest file:
This will use the specified shell container to run the transformer.
Entrypoint
You can customize what entrypoint is used for the transformer by adding the following to the manifest file:
This will use the specified entrypoint to run the transformer.
Runtime
You can customize what runtime is used for the transformer by adding the following to the manifest file:
this will use the specified runtime to run the transformer.
Timeouts
You can customize what timeouts are used for the transformer by adding the following to the manifest file:
This will set the timeout for the transformer.
V2 Resources
We are currently rolling out a new functionality of components, these components definitions are defined using the v2 schema and can be defined using individual yaml documents.
currently only the IAM resources are supported, but more resources will be added in the future.
To enable the IAM resources you need to install the @flowcore/cli-plugin-iam
plugin:
see the following resources for more information on what v2 resources look like:
You can create v2 resources using the apply
command by adding the --v2
flag:
and delete v2 resources using the delete
command: