• 使用を開始する
  • 関連ドキュメント

Migrate 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 type mappings

Opsgenie Resource Type

Atlassian Operations Resource Type

opsgenie_team

atlassian-operations_team

opsgenie_schedule

atlassian-operations_schedule

opsgenie_schedule_rotation

atlassian-operations_schedule_rotation

opsgenie_escalation

atlassian-operations_escalation

opsgenie_api_integration

atlassian-operations_api_integration

opsgenie_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.tffile, refer to importing in Terraform CLI.

Supported resources and adding them to the imports.tf file 

チーム 

Use this configuration to import your teams

1 2 3 4 import { to = atlassian-operations_team.<TEAM_VARIABLE_NAME_HERE> id = "<TEAM_ID_HERE>,<ORGANIZATION_ID_HERE>" }
スケジュール
1 2 3 4 import { to = atlassian-operations_schedule.<SCHEDULE_VARIABLE_NAME_HERE> id = "<SCHEDULE_ID_HERE>" }
スケジュール ローテーション 
1 2 3 4 import { to = atlassian-operations_schedule_rotation.<SCHEDULE_ROTATION_VARIABLE_NAME_HERE> id = "<ROTATION_ID_HERE>,<SCHEDULE_ID_HERE>" }
エスカレーション
1 2 3 4 import { to = atlassian-operations_escalation.<ESCALATION_VARIABLE_NAME_HERE> id = "<ESCALATION_ID_HERE>,<TEAM_ID_HERE>" }
API based integrations
1 2 3 4 import { to = atlassian-operations_api_integration.<API_INTEGRATION_VARIABLE_NAME_HERE> id = "<INTEGRATION_ID_HERE>" }
Email integrations
1 2 3 4 import { to = atlassian-operations_email_integration.<EMAIL_INTEGRATION_VARIABLE_NAME_HERE> id = "<INTEGRATION_ID_HERE>" }

Execute Terraform commands

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

例:  

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

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

確認

  • 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.

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。