├── .gitignore ├── README.md ├── go.mod ├── LICENSE ├── main.go ├── create-services.go ├── go.sum └── servicelist.tf /.gitignore: -------------------------------------------------------------------------------- 1 | .terraform* 2 | *.tfstate -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Create Terraform Files in Go 2 | This project demonstrates how to use the [hclwrite](https://pkg.go.dev/github.com/hashicorp/hcl/v2/hclwrite) package to create Terraform configurations using Go. 3 | 4 | ## Create Terraform Resource References 5 | To use the [create_services.go](create-services.go) code you'll want to make sure to set the `ACCCOUNT_OWNER_EMAIL` first. -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module pdt-stmcallister.com 2 | 3 | go 1.17 4 | 5 | require ( 6 | github.com/hashicorp/hcl/v2 v2.11.1 7 | github.com/zclconf/go-cty v1.10.0 8 | ) 9 | 10 | require ( 11 | github.com/agext/levenshtein v1.2.1 // indirect 12 | github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect 13 | github.com/google/go-cmp v0.3.1 // indirect 14 | github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect 15 | golang.org/x/text v0.3.5 // indirect 16 | ) 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Scott McAllister 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/hashicorp/hcl/hclwrite" 8 | "github.com/zclconf/go-cty/cty" 9 | ) 10 | 11 | func main() { 12 | // create new empty hcl file object 13 | f := hclwrite.NewEmptyFile() 14 | 15 | // create new file on system 16 | tfFile, err := os.Create("bservelist.tf") 17 | if err != nil { 18 | fmt.Println(err) 19 | return 20 | } 21 | // initialize the body of the new file object 22 | rootBody := f.Body() 23 | 24 | // initialize terraform object and set provider version 25 | tfBlock := rootBody.AppendNewBlock("terraform", nil) 26 | tfBlockBody := tfBlock.Body() 27 | reqProvsBlock := tfBlockBody.AppendNewBlock("required_providers", nil) 28 | reqProvsBlockBody := reqProvsBlock.Body() 29 | 30 | reqProvsBlockBody.SetAttributeValue("pagerduty", cty.ObjectVal(map[string]cty.Value{ 31 | "source": cty.StringVal("PagerDuty/pagerduty"), 32 | "version": cty.StringVal("1.10.0"), 33 | })) 34 | 35 | // create 50 business services 36 | for i := 1; i <= 150; i++ { 37 | bs := rootBody.AppendNewBlock("resource", []string{"pagerduty_business_service", fmt.Sprintf("bs%v", i)}) 38 | bsBody := bs.Body() 39 | bsBody.SetAttributeValue("name", cty.StringVal(fmt.Sprintf("Business Service %v", i))) 40 | rootBody.AppendNewline() 41 | } 42 | 43 | fmt.Printf("%s", f.Bytes()) 44 | tfFile.Write(f.Bytes()) 45 | } 46 | -------------------------------------------------------------------------------- /create-services.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/hashicorp/hcl/v2/hclsyntax" 8 | "github.com/hashicorp/hcl/v2/hclwrite" 9 | "github.com/zclconf/go-cty/cty" 10 | ) 11 | 12 | func main() { 13 | // TODO: set account owner email to be used retrieve user for defining pagerduty_schedule 14 | ACCOUNT_OWNER_EMAIL := "" 15 | 16 | // create new empty hcl file object 17 | f := hclwrite.NewEmptyFile() 18 | 19 | // create new file on system 20 | tfFile, err := os.Create("servicelist.tf") 21 | if err != nil { 22 | fmt.Println(err) 23 | return 24 | } 25 | // initialize the body of the new file object 26 | rootBody := f.Body() 27 | 28 | // initialize terraform object and set provider version 29 | tfBlock := rootBody.AppendNewBlock("terraform", nil) 30 | tfBlockBody := tfBlock.Body() 31 | reqProvsBlock := tfBlockBody.AppendNewBlock("required_providers", 32 | nil) 33 | reqProvsBlockBody := reqProvsBlock.Body() 34 | 35 | reqProvsBlockBody.SetAttributeValue("pagerduty", cty.ObjectVal(map[string]cty.Value{ 36 | "source": cty.StringVal("PagerDuty/pagerduty"), 37 | "version": cty.StringVal("2.3.0"), 38 | })) 39 | rootBody.AppendNewline() 40 | 41 | // create escalation policy 42 | ep := rootBody.AppendNewBlock("resource", 43 | []string{"pagerduty_escalation_policy", "ep"}) 44 | epBody := ep.Body() 45 | epBody.SetAttributeValue("name", cty.StringVal("Me EP")) 46 | epBody.SetAttributeValue("num_loops", cty.NumberIntVal(3)) 47 | epBody.AppendNewline() 48 | // rule block 49 | epRule := epBody.AppendNewBlock("rule", nil) 50 | epRuleBody := epRule.Body() 51 | epRuleBody.SetAttributeValue("escalation_delay_in_minutes", cty.NumberIntVal(30)) 52 | epRuleBody.AppendNewline() 53 | // target block 54 | epRuleTarget := epRuleBody.AppendNewBlock("target", nil) 55 | epRuleTargetBody := epRuleTarget.Body() 56 | epRuleTargetBody.SetAttributeValue("type", cty.StringVal("schedule_reference")) 57 | // pagerduty_schedule resource reference using SetAttributeRaw 58 | schedTokens := hclwrite.Tokens{ 59 | {Type: hclsyntax.TokenIdent, Bytes: []byte(`pagerduty_schedule.foo.id`)}, 60 | } 61 | epRuleTargetBody.SetAttributeRaw("id", schedTokens) 62 | // pagerduty_schedule resource reference using SetAttribute (here for reference) 63 | // epRuleTargetBody.SetAttributeTraversal("id", hcl.Traversal{ 64 | // hcl.TraverseRoot{ 65 | // Name: "pagerduty_schedule", 66 | // }, 67 | // hcl.TraverseAttr{ 68 | // Name: "foo", 69 | // }, 70 | // hcl.TraverseAttr{ 71 | // Name: "id", 72 | // }, 73 | // }) 74 | rootBody.AppendNewline() 75 | 76 | // create schedule 77 | sched := rootBody.AppendNewBlock("resource", 78 | []string{"pagerduty_schedule", "foo"}) 79 | schedBody := sched.Body() 80 | schedBody.SetAttributeValue("name", cty.StringVal("Me Schedule")) 81 | schedBody.SetAttributeValue("time_zone", cty.StringVal("America/Los_Angeles")) 82 | schedBody.AppendNewline() 83 | // layer block 84 | schedLayer := schedBody.AppendNewBlock("layer", nil) 85 | schedLayerBody := schedLayer.Body() 86 | schedLayerBody.SetAttributeValue("name", cty.StringVal("This Shift")) 87 | schedLayerBody.SetAttributeValue("start", cty.StringVal("2022-03-15T20:00:00-08:00")) 88 | schedLayerBody.SetAttributeValue("rotation_virtual_start", cty.StringVal("2022-03-15T20:00:00-08:00")) 89 | schedLayerBody.SetAttributeValue("rotation_turn_length_seconds", cty.NumberIntVal(86400)) 90 | // users attribute with hclwrite.Tokens and SetAttributeRaw 91 | userTokens := hclwrite.Tokens{ 92 | { 93 | Type: hclsyntax.TokenOBrack, 94 | Bytes: []byte(`[`), 95 | }, 96 | { 97 | Type: hclsyntax.TokenIdent, 98 | Bytes: []byte(`data.pagerduty_user.me.id`), 99 | }, 100 | { 101 | Type: hclsyntax.TokenCBrack, 102 | Bytes: []byte(`]`), 103 | }, 104 | } 105 | schedLayerBody.SetAttributeRaw("users", userTokens) 106 | 107 | // add restriction to schedule layer 108 | schedLayerBody.AppendNewline() 109 | restriction := schedLayerBody.AppendNewBlock("restriction", nil) 110 | restBody := restriction.Body() 111 | restBody.SetAttributeValue("type", cty.StringVal("daily_restriction")) 112 | restBody.SetAttributeValue("start_time_of_day", cty.StringVal("17:00:00")) 113 | restBody.SetAttributeValue("duration_seconds", cty.NumberIntVal(54000)) 114 | rootBody.AppendNewline() 115 | 116 | // get user 117 | me := rootBody.AppendNewBlock("data", 118 | []string{"pagerduty_user", "me"}) 119 | meBody := me.Body() 120 | meBody.SetAttributeValue("email", cty.StringVal(ACCOUNT_OWNER_EMAIL)) 121 | rootBody.AppendNewline() 122 | 123 | // create a lot of services 124 | for i := 1; i <= 50; i++ { 125 | service := rootBody.AppendNewBlock("resource", 126 | []string{"pagerduty_service", 127 | fmt.Sprintf("me%v", i)}) 128 | serviceBody := service.Body() 129 | serviceBody.SetAttributeValue("name", 130 | cty.StringVal(fmt.Sprintf("Me Service %v", i))) 131 | 132 | // defining tokens for pagerduty_escalation_policy resource reference 133 | tokens := hclwrite.Tokens{ 134 | {Type: hclsyntax.TokenIdent, Bytes: []byte(`pagerduty_escalation_policy.ep.id`)}, 135 | } 136 | serviceBody.SetAttributeRaw("escalation_policy", tokens) 137 | rootBody.AppendNewline() 138 | } 139 | 140 | fmt.Printf("%s", f.Bytes()) 141 | tfFile.Write(f.Bytes()) 142 | } 143 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= 2 | github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= 3 | github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= 4 | github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= 5 | github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= 6 | github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= 7 | github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= 8 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 9 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 10 | github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= 11 | github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= 12 | github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 13 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 14 | github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 15 | github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= 16 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 17 | github.com/hashicorp/hcl/v2 v2.11.1 h1:yTyWcXcm9XB0TEkyU/JCRU6rYy4K+mgLtzn2wlrJbcc= 18 | github.com/hashicorp/hcl/v2 v2.11.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= 19 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 20 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 21 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 22 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 23 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 24 | github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= 25 | github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= 26 | github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= 27 | github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= 28 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 29 | github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= 30 | github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 31 | github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 32 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 33 | github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= 34 | github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= 35 | github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= 36 | github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= 37 | github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= 38 | github.com/zclconf/go-cty v1.10.0 h1:mp9ZXQeIcN8kAwuqorjH+Q+njbJKjLrvB2yIh4q7U+0= 39 | github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= 40 | github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= 41 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 42 | golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 43 | golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 44 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 45 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 46 | golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 47 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 48 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 49 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 50 | golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 51 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 52 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 53 | golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= 54 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 55 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 56 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 57 | google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 58 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 59 | -------------------------------------------------------------------------------- /servicelist.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | pagerduty = { 4 | source = "PagerDuty/pagerduty" 5 | version = "2.3.0" 6 | } 7 | } 8 | } 9 | 10 | resource "pagerduty_escalation_policy" "ep" { 11 | name = "Me EP" 12 | num_loops = 3 13 | 14 | rule { 15 | escalation_delay_in_minutes = 30 16 | 17 | target { 18 | type = "schedule_reference" 19 | id = pagerduty_schedule.foo.id 20 | } 21 | } 22 | } 23 | 24 | resource "pagerduty_schedule" "foo" { 25 | name = "Me Schedule" 26 | time_zone = "America/Los_Angeles" 27 | 28 | layer { 29 | name = "This Shift" 30 | start = "2022-03-15T20:00:00-08:00" 31 | rotation_virtual_start = "2022-03-15T20:00:00-08:00" 32 | rotation_turn_length_seconds = 86400 33 | users = [data.pagerduty_user.me.id] 34 | 35 | restriction { 36 | type = "daily_restriction" 37 | start_time_of_day = "17:00:00" 38 | duration_seconds = 54000 39 | } 40 | } 41 | } 42 | 43 | data "pagerduty_user" "me" { 44 | email = "smcallister@pagerduty.com" 45 | } 46 | 47 | resource "pagerduty_service" "me1" { 48 | name = "Me Service 1" 49 | escalation_policy = pagerduty_escalation_policy.ep.id 50 | } 51 | 52 | resource "pagerduty_service" "me2" { 53 | name = "Me Service 2" 54 | escalation_policy = pagerduty_escalation_policy.ep.id 55 | } 56 | 57 | resource "pagerduty_service" "me3" { 58 | name = "Me Service 3" 59 | escalation_policy = pagerduty_escalation_policy.ep.id 60 | } 61 | 62 | resource "pagerduty_service" "me4" { 63 | name = "Me Service 4" 64 | escalation_policy = pagerduty_escalation_policy.ep.id 65 | } 66 | 67 | resource "pagerduty_service" "me5" { 68 | name = "Me Service 5" 69 | escalation_policy = pagerduty_escalation_policy.ep.id 70 | } 71 | 72 | resource "pagerduty_service" "me6" { 73 | name = "Me Service 6" 74 | escalation_policy = pagerduty_escalation_policy.ep.id 75 | } 76 | 77 | resource "pagerduty_service" "me7" { 78 | name = "Me Service 7" 79 | escalation_policy = pagerduty_escalation_policy.ep.id 80 | } 81 | 82 | resource "pagerduty_service" "me8" { 83 | name = "Me Service 8" 84 | escalation_policy = pagerduty_escalation_policy.ep.id 85 | } 86 | 87 | resource "pagerduty_service" "me9" { 88 | name = "Me Service 9" 89 | escalation_policy = pagerduty_escalation_policy.ep.id 90 | } 91 | 92 | resource "pagerduty_service" "me10" { 93 | name = "Me Service 10" 94 | escalation_policy = pagerduty_escalation_policy.ep.id 95 | } 96 | 97 | resource "pagerduty_service" "me11" { 98 | name = "Me Service 11" 99 | escalation_policy = pagerduty_escalation_policy.ep.id 100 | } 101 | 102 | resource "pagerduty_service" "me12" { 103 | name = "Me Service 12" 104 | escalation_policy = pagerduty_escalation_policy.ep.id 105 | } 106 | 107 | resource "pagerduty_service" "me13" { 108 | name = "Me Service 13" 109 | escalation_policy = pagerduty_escalation_policy.ep.id 110 | } 111 | 112 | resource "pagerduty_service" "me14" { 113 | name = "Me Service 14" 114 | escalation_policy = pagerduty_escalation_policy.ep.id 115 | } 116 | 117 | resource "pagerduty_service" "me15" { 118 | name = "Me Service 15" 119 | escalation_policy = pagerduty_escalation_policy.ep.id 120 | } 121 | 122 | resource "pagerduty_service" "me16" { 123 | name = "Me Service 16" 124 | escalation_policy = pagerduty_escalation_policy.ep.id 125 | } 126 | 127 | resource "pagerduty_service" "me17" { 128 | name = "Me Service 17" 129 | escalation_policy = pagerduty_escalation_policy.ep.id 130 | } 131 | 132 | resource "pagerduty_service" "me18" { 133 | name = "Me Service 18" 134 | escalation_policy = pagerduty_escalation_policy.ep.id 135 | } 136 | 137 | resource "pagerduty_service" "me19" { 138 | name = "Me Service 19" 139 | escalation_policy = pagerduty_escalation_policy.ep.id 140 | } 141 | 142 | resource "pagerduty_service" "me20" { 143 | name = "Me Service 20" 144 | escalation_policy = pagerduty_escalation_policy.ep.id 145 | } 146 | 147 | resource "pagerduty_service" "me21" { 148 | name = "Me Service 21" 149 | escalation_policy = pagerduty_escalation_policy.ep.id 150 | } 151 | 152 | resource "pagerduty_service" "me22" { 153 | name = "Me Service 22" 154 | escalation_policy = pagerduty_escalation_policy.ep.id 155 | } 156 | 157 | resource "pagerduty_service" "me23" { 158 | name = "Me Service 23" 159 | escalation_policy = pagerduty_escalation_policy.ep.id 160 | } 161 | 162 | resource "pagerduty_service" "me24" { 163 | name = "Me Service 24" 164 | escalation_policy = pagerduty_escalation_policy.ep.id 165 | } 166 | 167 | resource "pagerduty_service" "me25" { 168 | name = "Me Service 25" 169 | escalation_policy = pagerduty_escalation_policy.ep.id 170 | } 171 | 172 | resource "pagerduty_service" "me26" { 173 | name = "Me Service 26" 174 | escalation_policy = pagerduty_escalation_policy.ep.id 175 | } 176 | 177 | resource "pagerduty_service" "me27" { 178 | name = "Me Service 27" 179 | escalation_policy = pagerduty_escalation_policy.ep.id 180 | } 181 | 182 | resource "pagerduty_service" "me28" { 183 | name = "Me Service 28" 184 | escalation_policy = pagerduty_escalation_policy.ep.id 185 | } 186 | 187 | resource "pagerduty_service" "me29" { 188 | name = "Me Service 29" 189 | escalation_policy = pagerduty_escalation_policy.ep.id 190 | } 191 | 192 | resource "pagerduty_service" "me30" { 193 | name = "Me Service 30" 194 | escalation_policy = pagerduty_escalation_policy.ep.id 195 | } 196 | 197 | resource "pagerduty_service" "me31" { 198 | name = "Me Service 31" 199 | escalation_policy = pagerduty_escalation_policy.ep.id 200 | } 201 | 202 | resource "pagerduty_service" "me32" { 203 | name = "Me Service 32" 204 | escalation_policy = pagerduty_escalation_policy.ep.id 205 | } 206 | 207 | resource "pagerduty_service" "me33" { 208 | name = "Me Service 33" 209 | escalation_policy = pagerduty_escalation_policy.ep.id 210 | } 211 | 212 | resource "pagerduty_service" "me34" { 213 | name = "Me Service 34" 214 | escalation_policy = pagerduty_escalation_policy.ep.id 215 | } 216 | 217 | resource "pagerduty_service" "me35" { 218 | name = "Me Service 35" 219 | escalation_policy = pagerduty_escalation_policy.ep.id 220 | } 221 | 222 | resource "pagerduty_service" "me36" { 223 | name = "Me Service 36" 224 | escalation_policy = pagerduty_escalation_policy.ep.id 225 | } 226 | 227 | resource "pagerduty_service" "me37" { 228 | name = "Me Service 37" 229 | escalation_policy = pagerduty_escalation_policy.ep.id 230 | } 231 | 232 | resource "pagerduty_service" "me38" { 233 | name = "Me Service 38" 234 | escalation_policy = pagerduty_escalation_policy.ep.id 235 | } 236 | 237 | resource "pagerduty_service" "me39" { 238 | name = "Me Service 39" 239 | escalation_policy = pagerduty_escalation_policy.ep.id 240 | } 241 | 242 | resource "pagerduty_service" "me40" { 243 | name = "Me Service 40" 244 | escalation_policy = pagerduty_escalation_policy.ep.id 245 | } 246 | 247 | resource "pagerduty_service" "me41" { 248 | name = "Me Service 41" 249 | escalation_policy = pagerduty_escalation_policy.ep.id 250 | } 251 | 252 | resource "pagerduty_service" "me42" { 253 | name = "Me Service 42" 254 | escalation_policy = pagerduty_escalation_policy.ep.id 255 | } 256 | 257 | resource "pagerduty_service" "me43" { 258 | name = "Me Service 43" 259 | escalation_policy = pagerduty_escalation_policy.ep.id 260 | } 261 | 262 | resource "pagerduty_service" "me44" { 263 | name = "Me Service 44" 264 | escalation_policy = pagerduty_escalation_policy.ep.id 265 | } 266 | 267 | resource "pagerduty_service" "me45" { 268 | name = "Me Service 45" 269 | escalation_policy = pagerduty_escalation_policy.ep.id 270 | } 271 | 272 | resource "pagerduty_service" "me46" { 273 | name = "Me Service 46" 274 | escalation_policy = pagerduty_escalation_policy.ep.id 275 | } 276 | 277 | resource "pagerduty_service" "me47" { 278 | name = "Me Service 47" 279 | escalation_policy = pagerduty_escalation_policy.ep.id 280 | } 281 | 282 | resource "pagerduty_service" "me48" { 283 | name = "Me Service 48" 284 | escalation_policy = pagerduty_escalation_policy.ep.id 285 | } 286 | 287 | resource "pagerduty_service" "me49" { 288 | name = "Me Service 49" 289 | escalation_policy = pagerduty_escalation_policy.ep.id 290 | } 291 | 292 | resource "pagerduty_service" "me50" { 293 | name = "Me Service 50" 294 | escalation_policy = pagerduty_escalation_policy.ep.id 295 | } 296 | 297 | --------------------------------------------------------------------------------