-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpgsql_test_cat.rb
More file actions
73 lines (65 loc) · 1.77 KB
/
pgsql_test_cat.rb
File metadata and controls
73 lines (65 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name 'PGSQL Test CAT'
rs_ca_ver 20161221
short_description "Azure PostgresSQL Database Service - Test CAT"
import "sys_log"
import "plugins/rs_azure_pgsql"
parameter "subscription_id" do
like $rs_azure_pgsql.subscription_id
end
permission "read_creds" do
actions "rs_cm.show_sensitive","rs_cm.index_sensitive"
resources "rs_cm.credentials"
end
resource "sql_server", type: "rs_azure_pgsql.pgsql_server" do
name join(["my-sql-server-", last(split(@@deployment.href, "/"))])
resource_group "CCtestresourcegroup"
location "northcentralus"
properties do {
"administratorLogin" => "cloudsa",
"administratorLoginPassword" => "RightScale2017",
"storageMB" => 51200,
"sslEnforcement" => "Enabled",
"createMode" => "Default"
} end
sku do {
"name" => "PGSQLB100",
"tier" => "Basic",
"capacity" => 100
} end
tags do {
"ElasticServer" => "1"
} end
end
resource "firewall_rule", type: "rs_azure_pgsql.firewall_rule" do
name "sample-firewall-rule"
resource_group "CCtestresourcegroup"
location "northcentralus"
server_name @sql_server.name
properties do {
"startIpAddress" => "0.0.0.1",
"endIpAddress" => "0.0.0.1"
} end
end
operation "launch" do
description "Launch the application"
definition "launch_handler"
end
define launch_handler(@sql_server,@firewall_rule) return @sql_server do
call start_debugging()
provision(@sql_server)
provision(@firewall_rule)
call stop_debugging()
end
define start_debugging() do
if $$debugging == false || logic_and($$debugging != false, $$debugging != true)
initiate_debug_report()
$$debugging = true
end
end
define stop_debugging() do
if $$debugging == true
$debug_report = complete_debug_report()
call sys_log.detail($debug_report)
$$debugging = false
end
end