Odin
  • Introduction
  • Why Odin?
  • Key Concepts
    • Environment
      • Environment Type
    • Provisioning
      • Provisioning Config for Component Types
    • Component
      • Available Component Types
      • Component Type reference
        • Optimus Components
          • Aerospike [6.3.0.7-1.0.0]
    • Service
      • Know Your Service Definition
    • Versioning
      • Clearing the Confusion: A Simplified Guide to Artifact, Component, and Service Versions
    • Service Sets
    • Labels
  • Reference
    • CLI reference
  • Onboard Your Service
    • Installation
    • Configure
    • Odin -h
    • Getting Started
    • Create Environment
      • Operations on Environment
    • Service Definition
    • Provisioning Config
    • Deploy Service
    • Release Service
    • Optimus Datastore Operations
      • How to use Optimus Datastore in my service?
      • RDS Operations
      • Aerospike Operations
      • Kafka Operations
    • Operating Service & Components
      • Redeploy
        • In Place Deployment
        • Blue Green Deployment
      • Rolling Restart
      • Adding & removing components
      • Revert a deployment for application component
      • Downscaling a Passive Stack
      • Updating the no. of stacks of application component
    • Dev <> QA iteration
    • Frequently Asked Questions
    • Deploy Concrete Service
    • Undeploy Service
    • Delete Environment
    • Appendix
  • How To
    • Define error threshold for canary deployment
    • Add or Remove a component in an already deployed service
    • Integrate mono-repo(cronjobs) with Odin
    • Deploy crontab with Odin
    • Integrate Data pipeline with Odin
    • Push logs to log central
    • Build artifacts for multi module applications
    • Load test with Odin
    • Track Deployments against Commit Ids
    • Deploy Service on Production - Dream11
    • How and when images are created
    • Check logs for deployed infrastructure - Dream11
    • Onboard Stepfunction as a component
    • Onboard Serverless as a component
    • Login to Kubernetes clusters
  • Release Notes
    • 1.2.0-beta.2 - 11 August, 2022
    • Odin October Release
    • Odin 1.2.0 - Nov 9th 2022
    • Odin February Release
Powered by GitBook
On this page
Export as PDF
  1. How To

Onboard Stepfunction as a component

This article details out the process of using stepfunction as a component within your service.

Stepfunction is a managed service provided by AWS and is limited to the boundary of AWS itself. Odin supports stepfucntion as a component. However, to use the same within your service, Odin expects a certain standard.

Jfrog Artifact Structure

In case of stepfucntion, odin expects that the artifact pushed in the Jfrog artifactory is provided in a specific structure. The structure is as follow:

<Jfrog Artifact>
    └─── Stepfucntion.zip
        └─── StepFn <folder>   
            | main.yml //Main configuration file with respect to Serverless
            | node_modules // if its a node application
            | <Additional file 1>
            | <Additional file 2>

Stepfunction is a resource in AWS and to create the same, Odin uses Serverless that expects a particular configuration file to be in place for creating stepfunction as a resource (in the above example, main.yaml). That configuration file should be written in such a way that Serverless can provision the resource. Along with the config file, if the user is using any additional file or folder to customise the resource, the same can be put in the folder within the zip file (in this case StepFn).

Define Stepfunction as a component in Service Definition

While adding the stepfucntion as a component in the service definition, along with general details like component type, name, and version, Odin expect the following configuration details to be added. Please note that it is mandatory to include artifact name and version as part of config details for Stepfunction for the resource to be created.

//Sample Service Definition

{
    "name": "Service Name",
    "version": "1.0.0-SNAPSHOT",
    "team": "TeamName",
    "components":
    [
        {
        "type":"stepfunction",
        "version": "1.0.0",
        "name": "StepFn", //The folder name within the Artifact zip should be same as this
        "config":{
	    "artifact_name": "Stepfunction", //As per the above example, Artifact name is Stepfucntion
	    "artifact_version": "1.0.0-SNAPSHOT", //The version with which artifact was pushed
	    "filename": "main.yml" //The file name, in this case main.yml
		}	
        }
    ]
}

Please note that in the above format, file name is not a mandatory field. By default, Odin would look for a file name called main.yml. However, user can use a different file name than this. In that case the file name needs to be mentioned in the config section for stepfucntion component.

Define Provisioning file to use Stepfunction as a component

The provisioning details for the stepfunction should be provided along with the component name and deployment type. Please note that Stepfunction being a managed service by AWS, the deployment type will always be 'aws_stepfunction'.

For stepfunction, the configuration file complying with serverless is same across the environment. However, the user can customise the requirements based on the environment within the configuration file and the environment details can be passed to Odin using the provisioning file with the help of the parameter 'extra_env'. E.g: there might be difference in the provisioning requirement for stepfunction in prod environment and stage environment. The specific requirements can be mentioned within the configuration file [in this case, main.yml] while pushing the artifact.

// Sample Provisioning file

[
  {
    "component_name": "StepFn",
    "deployment_type": "aws_stepfunction",
    "params": {
        "extra_envs": {
                    "NODE_ENV1":"stag",
                    "NODE_ENV2":"load",
		      }
		}
    }
]

The user has to specify the environment specific details in the config file created for serverless using placeholders for the extra environments. A sample structure for an artifact for a service which is using stepfunction and has custom configs for stage and load environment would be as follow:

<Jfrog Artifact>
    └─── Stepfucntion.zip
        └─── StepFn <folder>   
            | main.yml 
            | config/
                stag.conf
                load.conf
PreviousCheck logs for deployed infrastructure - Dream11NextOnboard Serverless as a component

Last updated 2 years ago