Leveraging Atlassian’s Opsgenie and AWS Cloudformation Registry to stay ahead of incidents

In the past, managing IT infrastructure was a hard job. It required a lot of manual effort and it was hard to keep track of all the necessary information (monitoring, scalability etc). Thankfully, as time went on new frameworks emerged like Infrastructure as Code (IaC) and Cloud Computing. IaC is favorable because in addition to being cost effective and easily maintainable it also increases the speed at which infrastructure can be deployed. Developers like it because it makes it easier to build infrastructure, increases consistency, and makes infrastructure changes easy to track.

Atlassian and AWS are committed to developing integrations that enable teams to do their best work. Whether your team is already on the cloud, or moving to the cloud, the integrations allow for growth and scale of your business.

Enter Atlassian’s Opsgenie as an AWS CloudFormation Resource. AWS CloudFormation is an IaC offering which gives you an easy way to model, provision and manage a collection of related AWS and third-party resources throughout their lifecycle. You can now use a template to launch Opsgenie resources and their dependencies as a stack. Leveraging AWS’s third-party resource extension capability, Atlassian Opsgenie has created its own custom Opsgenie CloudFormation Resources to provide its users an easy and efficient way to maintain and manage Opsgenie as well as AWS Resources at one place.

This integration not only provides you the flexibility to easily create, update, delete your Opsgenie resources—but also provides a seamless option to model, provision and manage your resources. Simply put all of your Opsgenie configuration in a single JSON file then create and maintain your stack with the help of CloudFormation. Currently, Atlassian’s Opsgenie supports three kinds of resources, namely:

  • Atlassian::Opsgenie::User
  • Atlassian::Opsgenie::Team
  • Atlassian::Opsgenie::Integration

 

Let's get set up
Create an Opsgenie account 

   To create Opsgenie resources via CloudFormation, first you’ll need to set up your Opsgenie account

 

 

  • Get API Key
    Next, copy your API key by going to Settings > Configured Integrations > API Integration page. This api key will be required to create your entities in your Opsgenie Account.

 

 

Add Opsgenie Resources to your CloudFormation registry

You can add Opsgenie Resources to your CloudFormation Registry in two ways: 

  1. Activating Opsgenie third party resources from AWS CloudFormation Public Registry in your AWS Account. Check out AWS blog to learn more about how to achieve this.  Or, (2) Publishing these resources to your Private Registry. For more information on how to do that, please head over to Opsgenie’s open source Github repository.
  2. Prepare your stack.json file
  • This refers to the basic configuration file written in JSON that has details about the resources which you want to deploy to your Opsgenie account.
  • You can add the different resource extensions to your json file to create Users, Teams or Integration entities.
  • Here’s an example of how to create a User Resource using Atlassian::Opsgenie::User

{

  "AWSTemplateFormatVersion": "2010-09-09",

  "Description": "OG user",

  "Parameters": {

    "OpsgenieApiKey":{

      "Description":"Enter Opsgenie Api Key",

      "Type":"String"

    },

  },

  "Resources": {

    "TestUser": {

      "Type": "Atlassian::Opsgenie::User",

      "Properties": {

        "OpsgenieApiKey": {"Ref": "OpsgenieApiKey"},

        "OpsgenieApiEndpoint": "https://api.opsgenie.com",

        "Username": "test-user@opsgenie.com",

        "FullName": "test user",

        "Role": "User"

      }

    }

  }

}


Create Opsgenie Resources

You can either use the AWS CloudFormation console or command line tool. In this article we are going to create the resources via the AWS console.

Step 1: In your AWS CloudFormation console click “create stack” in the top right corner and choose an option. 

Step 2: Upload the resource json file which you have already created and click on Next. You can also give the s3 link of your JSON file.

Step 3: Specify the Stack Name and OpsgenieApiKey in the respective fields and click on Next.

Step 4: On the Configure stack options page, fill up the required fields and click Next.

Step 5: Review your changes and click on Create Stack.

 TADAAA! yellow-star Your stack is created.

You’ll now be able to see the user resource created in your Opsgenie account by going to Settings > Users page.

We’re so excited to be able to offer this integration to our customers so they can easily deploy Opsgenie resources as part of their stack. Try it out and let us know what you think.  

 

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events