-
Notifications
You must be signed in to change notification settings - Fork 1
/
akamai.tf
74 lines (66 loc) · 1.69 KB
/
akamai.tf
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
74
# Load module
terraform {
required_version = ">=1.0.11"
required_providers {
akamai = {
source = "akamai/akamai"
version = ">=1.9.0"
}
}
}
# Variables declare
variable "AKAMAI_jp-all_CLIENT_SECRET" {}
variable "AKAMAI_jp-all_HOST" {}
variable "AKAMAI_jp-all_ACCESS_TOKEN" {}
variable "AKAMAI_jp-all_CLIENT_TOKEN" {}
# Configure the Akamai Provider
provider "akamai" {
config {
client_secret = "${var.AKAMAI_jp-all_CLIENT_SECRET}"
host = "${var.AKAMAI_jp-all_HOST}"
access_token = "${var.AKAMAI_jp-all_ACCESS_TOKEN}"
client_token = "${var.AKAMAI_jp-all_CLIENT_TOKEN}"
}
}
# Contract and Group
data "akamai_contract" "default" {
group_id = "grp_179232"
}
data "akamai_group" "default" {
group_name = "shki"
contract_id = data.akamai_contract.default.id
}
#Rule File
data "local_file" "rules" {
filename = "rules.json"
}
# DP Creation
resource "akamai_property" "default" {
name = "test02.essl.shki.tokyo"
product_id = "prd_Site_Accel"
contract_id = data.akamai_contract.default.id
group_id = data.akamai_group.default.id
hostnames {
cname_from = "test02-essl.shki.tokyo"
cname_to = "test02.essl.shki.tokyo.edgekey.net"
cert_provisioning_type = "CPS_MANAGED"
}
rule_format = "latest"
rules = data.local_file.rules.content
}
#*/
# Activation Staging
resource "akamai_property_activation" "staging-activation" {
property_id = akamai_property.default.id
version = 5
network = "STAGING"
contact = ["[email protected]"]
}
#/*
# Activation Production
resource "akamai_property_activation" "production-activation" {
property_id = akamai_property.default.id
version = 3
network = "PRODUCTION"
contact = ["[email protected]"]
}