Step 6: Deploy and run the App - AWS OpsWorks

Step 6: Deploy and run the App

Important

AWS OpsWorks Stacks is no longer accepting new customers. Existing customers will be able to use the OpsWorks console, API, CLI, and CloudFormation resources as normal until May 26, 2024, at which time they will be discontinued. To prepare for this transition, we recommend you transition your stacks to AWS Systems Manager as soon as possible. For more information, see AWS OpsWorks Stacks End of Life FAQs and Migrating your AWS OpsWorks Stacks applications to AWS Systems Manager Application Manager.

This example assumes that you have Ruby on Rails application that uses Redis. To access the configuration file, you can add the redis gem to your Gemfile and create a Rails initializer in config/initializers/redis.rb as follows:

REDIS_CONFIG = YAML::load_file(Rails.root.join('config', 'redis.yml')) $redis = Redis.new(:host => REDIS_CONFIG['host'], :port => REDIS_CONFIG['port'])

Then create an app to represent your application and deploy it to the Rails App Server layer's instances, which updates the application code and runs generate.rb to generate the configuration file. When you run the application, it will use the ElastiCache Redis instance as its in-memory key-value store.