Skip to main content

EC2 Deploy

Stable

Type: DEVRAMPS:EC2:DEPLOY

Category: deploy

Version: 1.0.0


Description

Deploy to a single EC2 instance via SSH or SSM.

Deploys an artifact to a specific EC2 instance using either SSH or AWS Systems Manager (SSM). Downloads the artifact to the instance and executes the specified deployment commands. Useful for legacy applications or instances not managed by Auto Scaling Groups.

Parameters

Required Parameters

ParameterTypeDescription
instance_idstringThe EC2 instance ID to deploy to.
artifact_namestringThe name of the artifact to deploy.
deployment_methodenum: SSH | SSMMethod to connect to the instance (SSH or SSM).
commandsarray<string>Shell commands to execute on the instance for deployment.

Optional Parameters

ParameterTypeDefaultDescription
account_idstring-The AWS account ID where the EC2 instance is located. Defaults to stage account.
regionstring-The AWS region. Defaults to stage region.
timeoutinteger30Deployment timeout in minutes.

Example Usage

- type: DEVRAMPS:EC2:DEPLOY
name: Deploy to Web Server
params:
instance_id: i-0123456789abcdef0
artifact_name: app-bundle
deployment_method: SSM
commands:
- sudo systemctl stop myapp
- tar -xzf /tmp/artifact.tar.gz -C /opt/myapp
- sudo systemctl start myapp
timeout: 15