Step 4. Create and deploy component¶
MACH composer is undergoing a major, backwards compatible overhaul
MACH composer has been rewritten in Golang, coming from a Python version. We've done this because the Golang ecosystem is more suitable for a tool like this, as it is also the language in which Hashicorp builds Terraform itself.
Because of this, some commands might not be available yet in the Golang
version; particularly the mach-composer bootstrap
command is not
available, which makes it a bit harder to start up. However, based on
the examples in the GitHub repository,
you should be able to get started without the bootstrap
command.
For creating components, please instead of mach-composer bootstrap
component
, use mach-composer-cookiecutter.
We do currently recommend to use the latest version (2.14.x).
If you are still on the Python version, the bootstrap
command will still work.
Create a MACH component¶
Create a MACH component which we can use in our MACH stack later on.
mach-composer bootstrap component
And follow the wizard to create a new component.
This component can now be pushed to a Git repository.
Deploy your component¶
It depends on what component you have, but if you've created a component containing a serverless function, that function needs to be built, packaged and uploaded to an artifact repository.
For a component created with the mach-composer bootstrap
command or one of the
provided example components, these commands will be enough:
./build.sh package
./build.sh upload
Component deployment
The deployment process of a component can vary.
Read more about component deployments.