-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf.apigee
63 lines (59 loc) · 1.72 KB
/
main.tf.apigee
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
terraform {
required_providers {
apigee = {
source = "scastria/apigee"
version = "~> 0.1.0"
}
}
}
#Configure the Apigee Provider
provider "apigee" {
username = "[email protected]"
password = "abcD1234%"
// access_token = "Use access token instead of username/password"
// oauth_server = "Treat username/password as machine user and obtain access token automatically"
organization = "martin2176-eval"
}
#Add api proxy
resource "apigee_proxy" "weather" {
name = "weather"
bundle = "weather_rev6_2021_12_15.zip"
bundle_hash = filebase64sha256("weather_rev6_2021_12_15.zip")
}
#Deploy api proxy to production
resource "apigee_proxy_deployment" "weather" {
proxy_name = apigee_proxy.weather.name
environment_name = "prod"
revision = apigee_proxy.weather.revision
}
#Add api proxy to api product
resource "apigee_product" "weatherapis" {
name = "weatherapis"
display_name = "weatherapis"
description = "weatherapis"
auto_approval_type = true
proxies = ["weather"]
environments = [
"prod"
]
attributes = {
access = "Internal only"
}
quota = 20
quota_interval = 1
quota_time_unit = "minute"
}
#Add api developer app and add weather api product to the app
resource "apigee_developer_app" "weatherapp" {
name = "weatherapp"
developer_email = "[email protected]"
}
resource "apigee_developer_app_credential" "weatherappcredential" {
developer_email = "[email protected]"
developer_app_name = apigee_developer_app.weatherapp.name
consumer_key = "gLMcKjtHsg2cLRNGZNFv9zhz45ymeseg"
consumer_secret = "45ymeseg"
api_products = [
apigee_product.weatherapis.name
]
}