Opsgenie CloudFormation Registry Resources

Amazon CloudFormation Registry is an open-source extension of AWS CloudFormation. It provides IaC capabilities that allow us to create Opsgenie resources alongside AWS resources. This can potentially simplify the configuration of your Opsgenie and AWS environments.

You can get started immediately by visiting the opensource Github repository here

Opsgenie Custom Resources

User

Atlassian::Opsgenie::User
Allows us to create user entities in Opsgenie via Amazon Cloudformation Registry and CLI. Even though Opsgenie's User entity contains multiple fields as per the Rest API documentation, the CloudFormation Registry resource supports three configurable properties for simplicity along with the required endpoint and ApiKey properties.

Field

Description

Required

Limit

ApiKey

Your Opsgenie provided API Key

Required

Endpoint

Endpoint of API according to your preferred environment

Required

Limited to one of the following:

  • api.eu.opsgenie.com
  • api.opsgenie.com
  • api.sandbox.opsgenie.com

Username

E-mail address of the user

Required

100 chars

Fullname

Name of the user

Required

512 chars

Role

Role of user

Required

Limited to one of the following:

  • Owner
  • Admin
  • User
  • Custom role created by you

Exported Properties
Generated after the creation of the resource.

Property

Description

id

Unique Id of the user that is used to reference the user entity

Example

{
  "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": "[email protected]",
        "FullName": "test user",
        "Role": "User"
      }
    }
  }
}

Team

Atlassian::Opsgenie::Team
Allows us to create user entities in Opsgenie via Amazon CloudFormation Registry and CLI. To the team, you can associate members upon creation. The Team resource supports all the fields available in Opsgenie's Team entity as can be seen in the API documentation.

Supported Properties

Property

Description

Required

Limit

ApiKey

Your Opsgenie provided API Key

Required

Endpoint

Endpoint of API according to your preferred environment

Required

Limited to one of the following:

  • api.eu.opsgenie.com
  • api.opsgenie.com
  • api.sandbox.opsgenie.com

Name

Name of the team

Required

100 chars

Description

The description of team

Optional

10000 chars

Members

The users which will be added to team, and optionally their roles. Refer to the Members property table below. Alternatively, you can refer Team Members documentation for detailed information about members and their fields.

Optional

Members Properties:
The properties available for configuration under the Members property of Opsgenie's Team resource.

Property

Description

Required

Limit

UserId

User identifier

Required

Role

Role of user

Required

Limited to one of the following:

  • Owner
  • Admin
  • User
  • Custom role created by you

Exported Properties
There are no generated fields upon the creation of Opsgenie's Team resource

Example

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Opsgenie Test Users",
  "Parameters": {
    "ApiKey": {
      "Description": "Enter Opsgenie Api Key",
      "Type": "String"
    },
    "ApiEndpoint": {
      "Description": "Enter Opsgenie Api endpoint",
      "Type": "String",
      "Default": "https://api.opsgenie.com",
      "AllowedValues": [
        "https://api.opsgenie.com",
        "https://api.eu.opsgenie.com",
        "https://api.sandbox.opsgenie.com"
      ]
    }
  },
  "Resources": {
    "TeamA": {
      "Type": "Atlassian::Opsgenie::Team",
      "Properties": {
        "OpsgenieApiKey": {
          "Ref": "ApiKey"
        },
        "OpsgenieApiEndpoint": {
          "Ref": "ApiEndpoint"
        },
        "Name": "uuuii-test-team-ops",
        "Description": "Test team with 2 user for demonstration",
        "Members": [
          {
            "UserId": "04461d66-6ec6-4632-9904-f5429aec9535",
            "Role": "user"
          }
        ]
      }
    }
  }
}

Integration

Atlassian::Opsgenie::Integration
Allows creation of an Opsgenie Integration which is then associated with a team. This integration allows Opsgenie's incident management capabilities to your third-party tools used in your technology stack. You can learn more about Opsgenie's available integrations here.

📘

Integration Types Supported

At the moment, with Opsgenie’s AWS CloudFormation Registry and CLI support, only API integrations can be created.

Opsgenie's Integration resource properties reflect Opsgenie's Integration entity parameters which can be found in the API documentation.

Supported Properties:

Property

Description

Required

Limit

ApiKey

Your Opsgenie provided API Key

Required

Endpoint

Endpoint of API according to your preferred environment

Required

Limited to one of the following:

  • api.eu.opsgenie.com
  • api.opsgenie.com
  • api.sandbox.opsgenie.com

Enabled

This parameter is for specifying whether the integration will be enabled or not. Defaults to true

Required

Boolean value defaults to true.

Name

Name of the integration

Required

Name must be unique for each integration.

IntegrationType

The API integration supported tool that is to be created. List of integrations on Opsgenie's Integrations page

Required

Can only create API integrations. Please filter by API in the list of integrations shown in your Opsgenie console to know which integrations are supported.

OwnerTeamId

The identifier of the team associated with the integration

Required

OwnerTeamName

The name of the team associated with the integration

Optional

AllowReadAccess

This parameter is for configuring the read access of integration. If read access is restricted, the integration will not be authorized to read within any domain.

Optional

Boolean value defaults to true.

AllowWriteAccess

This parameter is for configuring the write access of integration. If write access is restricted, the integration will not be authorized to write within any domain.

Optional

Boolean value defaults to true.

AllowDeleteAccess

This parameter is for configuring the delete access of integration. If delete access is restricted, the integration will not be authorized to delete within any domain.

Optional

Boolean value defaults to true.

AllowConfigurationAccess

This parameter is for allowing or restricting the configuration access. If configuration access is restricted, the integration will be limited to Alert API requests, Incident API requests and sending heartbeats.

Optional

Boolean value defaults to true.

Responders

Optional user, schedule, teams or escalation names to calculate which users will receive the notifications of the alert. Responders which are exceeding the limit are ignored.

Refer to the Responders property table below.

Optional

Reponder Properties:
The properties available for configuration under the Responder property of Opsgenie's Integration resource.

Property

Description

Required

Limit

Type

The responder entity associated with the integration's alerts.

Required

Limited to one of the following:

  • Schedule
  • Team
  • User

Name

Name of the schedule or team acting as responder to the alerts generated by the integration

Required

Username

Name of the user acting as responder to the alerts generated by the integration

Required

Exported Properties
Generated after the creation of the resource.

Property

Description

Id

Unique identifier of the integration created

IntegrationApiKey

The integration's API key auto-generated

Example

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Opsgenie Integration",
  "Parameters": {
    "OpsgenieApiKey": {
      "Description": "Enter Opsgenie Api Key",
      "Type": "String"
    },
    "OpsgenieEndpoint": {
      "Description": "Enter Opsgenie Api URL",
      "Type": "String"
    }
  },
  "Resources": {
    "IntegrationTest": {
      "Type": "Atlassian::Opsgenie::Integration",
      "Properties": {
        "OpsgenieApiKey": {
          "Ref": "OpsgenieApiKey"
        },
        "OpsgenieApiEndpoint": {
          "Ref": "OpsgenieEndpoint"
        },
        "IntegrationType": "Marid",
        "Name": "test maridint",
    "Enabled":true      
    }
    }
  }
}

Demo

Creates two users, a team containing the users, an Opsgenie SNS integration finally an SNS topic with a subscription.

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Opsgenie Test Users",
  "Parameters": {
    "OpsgenieApiKey": {
      "Description": "Enter Opsgenie Api Key",
      "Type": "String"
    },
    "OpsgenieApiEndpoint": {
      "Description": "Enter Opsgenie Api endpoint",
      "Type": "String",
      "Default": "https://api.opsgenie.com",
      "AllowedValues": [
        "https://api.opsgenie.com",
        "https://api.eu.opsgenie.com",
        "https://api.sandbox.opsgenie.com"
      ]
    }
  },
  "Resources": {
    "UserA": {
      "Type": "Atlassian::Opsgenie::User",
      "Properties": {
        "ApiKey": {
          "Ref": "OpsgenieApiKey"
        },
        "Endpoint": {
          "Ref": "OpsgenieApiEndpoint"
        },
        "Username": "[email protected]",
        "FullName": "user one",
        "Role": "User"
      }
    },
    "UserB": {
      "Type": "Atlassian::Opsgenie::User",
      "Properties": {
        "ApiKey": {
          "Ref": "OpsgenieApiKey"
        },
        "Endpoint": {
          "Ref": "OpsgenieApiEndpoint"
        },
        "Username": "[email protected]",
        "FullName": "user two",
        "Role": "User"
      }
    },
    "TeamA": {
      "Type": "Atlassian::Opsgenie::Team",
      "Properties": {
        "ApiKey": {
          "Ref": "OpsgenieApiKey"
        },
        "ApiEndpoint": {
          "Ref": "OpsgenieApiEndpoint"
        },
        "Name": "uuu-test-team-ops",
        "Description": "Test team with 2 user for demonstration",
        "Members": [
          {
            "UserId": {
              "Ref": "UserA"
            },
            "Role": "user"
          },
          {
            "UserId": {
              "Ref": "UserB"
            },
            "Role": "user"
          }
        ]
      },
      "DependsOn": [
        "UserA",
        "UserB"
      ]
    },
    "IntegrationTest": {
      "Type": "Atlassian::Opsgenie::Integration",
      "Properties": {
        "ApiKey": {
          "Ref": "OpsgenieApiKey"
        },
        "Endpoint": {
          "Ref": "OpsgenieApiEndpoint"
        },
        "IntegrationType": "AmazonSns",
        "Name": "test awsSns",
        "Responders": [
          {
            "type": "team",
            "name": {
              "Fn::GetAtt": [
                "TeamA",
                "Name"
              ]
            }
          }
        ],
        "Enabled": true
      },
      "DependsOn": [
        "TeamA"
      ]
    },
    "MySns": {
      "Type": "AWS::SNS::Topic",
      "Properties": {
        "DisplayName": "opsgenie-test-aws",
        "Subscription": [
          {
            "Endpoint": {
              "Fn::Join": [
                "",
                [
                  {
                    "Ref": "OpsgenieApiEndpoint"
                  },
                  "/v1/json/amazonsns?apiKey=",
                  {
                    "Fn::GetAtt": [
                      "IntegrationTest",
                      "IntegrationApiKey"
                    ]
                  }
                ]
              ]
            },
            "Protocol": "https"
          }
        ],
        "TopicName": "opsgenie-test-demo"
      },
      "DependsOn": [
        "IntegrationTest"
      ]
    }
  }
}

Get started with Opsgenie and CloudFormation Registry and CLI by heading over to the opensource Github repository.

Updated about a year ago


Opsgenie CloudFormation Registry Resources


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.