We're updating our terminology in Jira

'Issue' is changing to 'work item'. You might notice some inconsistencies while this big change takes place.

Migrating from Terraform's Opsgenie Provider to Atlassian Operations Provider

The Atlassian Operations Terraform Provider enables you to manage Jira Service Management resources, including users, teams, escalations, and more, directly through Terraform. If you're transitioning from Opsgenie to Jira Service Management or have recently completed the move, you can migrate your Opsgenie Terraform Provider configurations to the Atlassian Operations Terraform Provider. This ensures you can continue leveraging Terraform to interact with and manage your data seamlessly in Jira Service Management.

Configure the provider

To set up the Atlassian Operations Terraform Provider, add the atlassian-operations provider configuration to your required_providers block. Ensure that you configure the provider with valid credentials before using it. Read how to set up Atlassian Operations Terraform Provider.

For more information about the available resources and data sources, use the navigation menu on the left. Currently, the provider supports six resources and three data sources.

To get started with Terraform, refer to the get started tutorials

Set up your Terraform configuration

Required parameters

  • Cloud id - Find your site's Cloud ID at: https://my-site-name.atlassian.net/_edge/tenant_info

  • Domain name- Your site’s URL, e.g., my-site-name.atlassian.net

  • email_address - Use your email address associated with your Atlassian account.

  • API Token - An API token added to your Atlassian account. View and manage API tokens for your Atlassian account.

Optional parameters

  • api_retry_count- Number of retries for failed requests.

  • api_retry_wait- Seconds to wait before retrying a failed request.

  • api_retry_wait_max- Maximum time for retries in seconds.

Exporting existing resources from Opsgenie Terraform Provider

For Opsgenie users transitioning to Jira Service Management, entity identifiers remain unchanged with the supported types to the Atlassian Operations Terraform Provider, ensuring a seamless migration. However, exporting existing resource IDs into an imports.tf file must currently be performed manually.

Refer to your state files to find the required resource identifiers. Follow the steps below for mapping and importing your resources.

Supported Resource Types

  • Opsgenie Team(opsgenie_team) > Atlassian Operations Team(atlassian-operations_team)

  • Opsgenie Schedule(opsgenie_schedule) > Atlassian Operations Schedule(atlassian-operations_schedule)

  • Opsgenie Schedule Rotation(opsgenie_schedule_rotation) > Atlassian Operations Schedule Rotation(atlassian-operations_schedule_rotation)

  • Opsgenie Escalation(opsgenie_escalation) > Atlassian Operations Escalation(atlassian-operations_escalation)

  • Opsgenie API Integration(opsgenie_api_integration) >Atlassian Operations API Integration(atlassian-operations_api_integration)

  • Opsgenie Email Integration(opsgenie_email_integration) > Atlassian Operations Email Integration(atlassian-operations_email_integration)

Importing Resources into Atlassian Operations Terraform Provider

The Atlassian Operations Terraform Provider supports importing the following resources:
Teams, Schedules, Schedule Rotations, Escalations, API Integrations, and Email Integrations. By using the Terraform provider CLI, you can easily import your existing resources into the Atlassian Operations Terraform Provider. Read more about importing in Terraform CLI.

Steps for importing resources

Add import blocks

Use Terraform’s import functionality to add existing resources to your state files. For details on preparing your imports.tf file, refer to importing in Terraform CLI.

Supported resources and adding them to the imports.tf file

Team

Use this configuration to import your teams

import { to = atlassian-operations_team.<TEAM_VARIABLE_NAME_HERE> id = "<TEAM_ID_HERE>,<ORGANIZATION_ID_HERE>" }
Schedule
import { to = atlassian-operations_schedule.<SCHEDULE_VARIABLE_NAME_HERE> id = "<SCHEDULE_ID_HERE>" }
Schedule rotations
import { to = atlassian-operations_schedule_rotation.<SCHEDULE_ROTATION_VARIABLE_NAME_HERE> id = "<ROTATION_ID_HERE>,<SCHEDULE_ID_HERE>" }
Escalations
import { to = atlassian-operations_escalation.<ESCALATION_VARIABLE_NAME_HERE> id = "<ESCALATION_ID_HERE>,<TEAM_ID_HERE>" }
API based integrations
import { to = atlassian-operations_api_integration.<API_INTEGRATION_VARIABLE_NAME_HERE> id = "<INTEGRATION_ID_HERE>" }
Email integrations
import { to = atlassian-operations_email_integration.<EMAIL_INTEGRATION_VARIABLE_NAME_HERE> id = "<INTEGRATION_ID_HERE>" }
Notification Rules
# Notification rule can be imported by providing the notification rule id terraform import atlassian-operations_notification_rule.example "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Routing Rules
# Routing rule can be imported by providing the routing rule id and the team id, separated by a comma terraform import atlassian-operations_routing_rule.example "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Execute Terraform commands

After preparing your imports.tf file, use the terraform provided plan command to generate the resource configurations.

Example:

terraform plan -generate-config-out="generated_resources.tf

Refer to Terraform’s import - Generating configuration documentation for more details.

Review

  • After generating your configuration file, review your configurations and update them as needed.

  • Execute terraform apply command to import the resources into your Terraform state files.

Still need help?

The Atlassian Community is here for you.