In order to use an application in Colony Blueprints, you must first specify how to deploy and configure it.
The first step is to create a folder bearing the same name as the application you wish to create, this will be the location where you'll drop the scripts and YAML files which define that application.
Create a new file called [application_name].yaml and place it in the direction you've created.
For example, if your application is called acme_dashboard You should now have the following structure in your source control:
The YAML file contains a few basic definitions about the application. In this section, we'll review the most basic ones needed in order to start the application:
TIP: For more information about each code section, click the icon next to it.
kind: application inputs:
- ...: '' - ...: '' infrastructure:
external: - port_info: path: '' port: .... Internal: - port_info: path: '' port: .... permissions:
aws: iam_instance_profile: aws: ... source:
image: ami: - id: ... region: ... os_type: ... configuration:
initialization: script: ....sh start: script: ....sh healthcheck: wait_for_ports: ... timeout: ...
spec_version: 1 kind: application
kind/ spec_version: These are mandatory YAML attributes classifying this file as a blueprint and specifying which version of the spec you'll be using. Currently version 1 is the latest version available.
The inputs section is where you list the parameters required by your application. To learn all about working with parameters, receiving input from the blueprint and making parameters available for your application scripts, see Working with Parameters.
The infrastructure section defines the default infrastructure requirements for the app.
infrastructure: connectivity: external: - port_info: port: 5050 internal: - port_info: port: $api_port Permissions: aws: iam_instance_profile: aws: $iam_instance_profile
Connectivity: The ports which the app requires and that are required to interact with it. By default, ports can be assigned as external ports, which are available from outside the sandbox, or internal - available to other apps inside the sandbox.
Permissions: grant permissions, to your infrastructure instances, to perform actions using the cloud provider's services. In the case of AWS for example, you can assign your EC2 machine with an IAM role to be used by your application when accessing any AWS service (such as S3 bucket).
source: image: ami: - id: ami-0ba9283e196fbedb0 region: eu-west-2 - id: ami-02608d939b50361de region: us-west-1 os_type: linux
- image: this is a collection of images, grouped by type. For AWS AMI images, you can specify the specific region this image is applicable to. Colony will automatically pick the image which matches the regions the blueprint is being deployed to.
- os_type: Can be either 'linux' or 'windows'.
This section is where you reference scripts or commands to be used in configuring, launching and checking the health status of your application.
To learn more about running application scripts and commands in your application, see Application Scripts.