_________ ___________ ___ ______ _______

_________ ___ _________ ___________ ___ ______ ________

_________ _______ ___ _________ ___ __________ ____ _____ ___________ ____________ ____ _ _______ _______ ___ ___ _______ __________ ______ ________ ______________ ____ _____ ___ _________ ________ ______ _______ _________ _________ _____ ___ _____ ________ ___ ______ _______ _____ _____ __________ ____ __ ____________

_ ______ ________ ___ _________ ___ ____ ____ _________ _ ___ _______ __ __ ____ ______ ______ _______ __ __________ __ ____ ___________ _____ ____ ______ _______ __ ___ ________ ____ __________ ____ ___ __ _____ _________ __ _ ___________ ____ ________ ____ ___ ___ _______ __ ________ _________ ____ ______ _______ ____ ___ __

____________

____ ___________ __ __________ ____ ___ _________ ________ __ ______ ________

  • _______

  • ______

  • __________

_____ __ ___ _______

  1. ______ _ ___ ____ _____ ____________ ___ _____ ___ _________ ________
    CODE
    # Install VictorOps Terraform Provider
    terraform {
    required_providers {
    victorops = {
    source = "splunk/victorops"
    version = "0.1.4"
    }
    }
    }
  2. ____ ___ ____ ___ ____ _________ __ ___ _________ __ _________ ____

    ____ _________ ___ _______ ___ ______ _______ _________ ________ ____ ___ _________ _________ ___ ________ ____________ ____ ______ _______ _____ ___ ____ ____ __ ___ ____ __ _______ __ ___ ____ ___ ______ _______ ___ ___ _____________

  3. ____ ___ ___ __ ___ ___ ___ ____ ______ _______ ___ _____ __ _________ ____ _______
    CODE
    provider "victorops"
    {
      api_id  = "your api id goes here"
      api_key = "your api key goes here"
    }
  4. _____ ______ ______ _______ __________ _____ ___ _________ ____ ___ __ _____
    CODE
    # Create a team within victorops
    resource "victorops_team" "team" {
    name = "DevOps-Test"
    }
    # Create a user within the victorops organization
    resource "victorops_user" "user1" {
    first_name       = "John"
    last_name        = "Doe"
    user_name        = "john.doe-test"
    email            = "john.doe@example.org"
    is_admin         = "false"
    }
    # Assign user to a team
    resource "victorops_team_membership" "test-membership" {
    team_id          = victorops_team.team.id
    user_name        = victorops_user.user1.user_name
    }
    # Create email contact method for a user
    resource "victorops_contact" "contact_email" {
    user_name    = victorops_user.user1.user_name
    type         = "email"
    value        = "john.doe2@example.org"
    label        = "test email"
    }
    # Create phone number contact method for a user
    resource "victorops_contact" "contact_phone" {
    user_name    = victorops_user.user1.user_name
    type         = "phone"
    value        = "+12345678900"
    label        = "test phone"
    }
    # Create an Escalation Policy for the team
    resource "victorops_escalation_policy" "devops_high_severity" {
    name    = "High Severity"
    team_id = victorops_team.team.id
    step {
    timeout = 0
    entries = [
    {
    type = "user"
    username = "john.doe-test"
    }
    ]
    }
    }
    # Create a Routing Key that uses the above Escalation Policy
    resource "victorops_routing_key" "infrastructure_high_severity" {
    name = "infrastructure-high-severity"
    targets = [victorops_escalation_policy.devops_high_severity.id]
    }
    注: ___ _________ ________ _____ ______ _________ ______ ____ ___ ____ _______ ____ __________ _____ ___ __ _______ _______ _________ __ ____ _____ _____ __ _ ______ ___________ ______ ____ __ __ ____ _______ ___ __ ____ ___ ____ ___ ____ ________
    ___ ________ ______ ___ ________ ____ ________ ____ ____ _____ _____ ___ ____ ___________ ___ ____ __ ___ _________ _____ _____ ___ ___ ________ _____________ __ _______
  5. ____ ___ ____ ___ ____ ___ _________ _______ __ ___ _________ _________ ____

    ____ _______ __ _ _______ __ ___ _________ ____ _________ ___ _______

  6. _____ __ ___________ ___ ________ __ ___ _________ __ ______ ________ ____ ___ _________ ________ _________ _____

  7. ____ ___ __ _______ ___ ___ __ ______ _______ __ ___ __________
    CODE
    victorops_team.team: Creating...
    victorops_user.user1: Creating...
    victorops_team.team: Creation complete after 1s [id=team-0mnx4iUkiP2OkqCt]
    victorops_escalation_policy.devops_high_severity: Creating...
    victorops_user.user1: Creation complete after 2s [id=john.doe-test]
    victorops_contact.contact_email: Creating...
    victorops_team_membership.test-membership: Creating...
    victorops_contact.contact_phone: Creating...
    victorops_escalation_policy.devops_high_severity: Creation complete after 1s [id=pol-tRi4Mn8fyGoN6p8b]
    victorops_routing_key.infrastructure_high_severity: Creating...
    victorops_contact.contact_phone: Creation complete after 1s [id=554c80cf-b6b7-465d-ab9f-0884b41a98fc]
    victorops_contact.contact_email: Creation complete after 1s [id=a56f04be-04fa-4edb-a349-1705e1ac5a1c]
    victorops_routing_key.infrastructure_high_severity: Creation complete after 1s [id=infrastructure-high-severity]
    victorops_team_membership.test-membership: Creation complete after 2s [id=team-0mnx4iUkiP2OkqCt_john.doe-test]
    Apply complete! Resources: 7 added, 0 changed, 0 destroyed.
  8. ___ __ __ ______ _______ ___ ______ ___ _____ ____ _______ ____ _ ___ ____ ___ ____ _______ ____ ___ ____ ___________ __ ___ ____ ___ ________ ___ ___ ____ __ ___ ______ _____

  9. ______ ___ _____ ___ ___ ____ ___ __________ ______ __ _______ __ ___ ______ ____ ___ _ _______ ___ _____ ________ > _______ ___ ____