Deploy CloudFormation Stack

Deploy the Ohlala SmartOps infrastructure in AWS

What Gets Deployed

The CloudFormation stack creates:

  • ECS Fargate cluster with container services
  • API Gateway for Teams and/or Google Chat webhooks
  • Network infrastructure (VPC, subnets, security groups)
  • IAM roles with appropriate permissions
  • Secrets Manager for credentials
  • CloudWatch logs for monitoring

Deployment Steps

1. Open CloudFormation Console

Navigate to CloudFormation in your target region:

https://console.aws.amazon.com/cloudformation/home

2. Create New Stack

Click “Create stack” and choose “With new resources (standard)”

CloudFormation Create Stack page with “Create stack” button highlighted

3. Upload Template

  1. Select “Choose an existing template”
  2. Select “Upload a template file”
  3. Click “Choose file” and select the template downloaded from AWS Marketplace
  4. Click “Next”

CloudFormation Create Stack page with “Choose an existing template” option and file upload highlighted

4. Configure Stack Parameters

Stack Name

Enter a unique stack name: OhlalaSmartOps (or your preference)

Required Parameters

Fill in the mandatory parameters:

Parameter Description Example/Value
DeploymentMode VPC configuration NewVPC (recommended)
ContainerImageTag Version to deploy v2.0.2 (default)
ChatPlatform Chat integration to enable Teams, GoogleChat, or Both

CloudFormation ChatPlatform parameter dropdown

Teams Parameters (required when ChatPlatform is Teams or Both)

Parameter Description Example/Value
MicrosoftAppId From Azure Bot setup Your App ID
MicrosoftAppPassword From Azure Bot setup Your App Password
MicrosoftAppTenantId From Azure Bot setup Your Tenant ID

Google Chat Parameters (required when ChatPlatform is GoogleChat or Both)

Parameter Description Example/Value
GoogleChatProjectId Your GCP project ID my-project-123456
GoogleChatServiceAccountInfo Service account JSON key (single line) {"type":"service_account",...}

CloudFormation Stack Parameters page with fields filled in

VPC Configuration (if NewVPC)

Keep defaults or customize:

  • VPCCIDR: 10.0.0.0/16
  • PublicSubnet1CIDR: 10.0.1.0/24
  • PublicSubnet2CIDR: 10.0.2.0/24
  • PrivateSubnet1CIDR: 10.0.10.0/24
  • PrivateSubnet2CIDR: 10.0.11.0/24
  • EnableNATGateway: true

Security & Reports Configuration

Parameter Description Default
AllowedIngressCIDR CIDR range allowed to access API Gateway 0.0.0.0/0
EnableDailyReports Enable daily health reports to chat platforms true
DailyReportSchedule Cron expression for report schedule cron(0 8 * * ? *)

Schedule Examples:

  • cron(0 8 * * ? *) - Every day at 8am UTC
  • cron(0 9 ? * MON-FRI *) - Weekdays at 9am UTC
  • cron(0 14 * * ? *) - Every day at 2pm UTC

Click “Next”

5. Configure Stack Options

On the stack options page:

  • Tags: (Optional) Add tags for resource organization
  • Permissions: Leave default
  • Advanced options: Leave default

Click “Next”

6. Review and Create

  1. Review all settings
  2. Check the acknowledgment box:
    • I acknowledge that AWS CloudFormation might create IAM resources with custom names

CloudFormation Stack Review page with acknowledgment checkbox highlighted

  1. Click “Submit”

CloudFormation Stack Review page with “Submit” button highlighted

7. Monitor Deployment

The stack creation takes 5-10 minutes. Monitor progress:

  1. Select your stack in the CloudFormation console
  2. Check the Events tab for real-time updates
  3. Wait for status: CREATE_COMPLETE

Get Stack Outputs

Once deployment completes, get the important URLs:

  1. Select your stack
  2. Go to the Outputs tab
  3. Save these values:
Output Description Use
TeamsWebhookURL API Gateway endpoint for Teams Configure in Azure Bot
GoogleChatWebhookURL API Gateway endpoint for Google Chat Configure in Google Chat API
APIGatewayEndpoint Base API URL Reference only
ECSCluster Cluster name For monitoring
ECSService Service name For monitoring

Verify Deployment

Check ECS Service

  1. Go to ECS Console → Clusters
  2. Find your cluster (e.g., OhlalaSmartOps-Cluster-...)
  3. Check service shows 1 running task

Check API Gateway

  1. Go to API Gateway Console
  2. Find your API (e.g., OhlalaSmartOps-API-...)
  3. Verify endpoints are created

Check Health Endpoint

Test the health endpoint (no authentication required):

curl https://your-api-id.execute-api.region.amazonaws.com/prod-stackname/health

Should return: {"status": "healthy"}

Troubleshooting

Stack Creation Failed

IAM Role Already Exists

Error: “Resource of type ‘AWS::IAM::Role’ with identifier already exists” Solution: Use a different stack name, or delete the existing role first

Insufficient Permissions

Error: “User is not authorized to perform: iam:CreateRole” Solution: Ensure you have admin permissions or required IAM policies

Service Quota Exceeded

Error: “Service quota exceeded” Solution: Request quota increase or deploy in different region

Stack Stuck in CREATE_IN_PROGRESS

  • Check Events tab for specific resource causing delay
  • ECS service can take 3-5 minutes to stabilize
  • If stuck >15 minutes, consider deleting and retrying

Next Step

With infrastructure deployed and webhook URL ready, continue based on your ChatPlatform selection: