Skip to content

Commit

Permalink
resolving issues related to library updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zambien committed Nov 1, 2019
1 parent 6e9e190 commit 34157fa
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ resource "apigee_product" "helloworld_product" {
# See here: http://docs.apigee.com/api-services/content/working-scopes
scopes = ["READ"]
attributes {
attributes = {
access = "public" # this one is needed to expose the proxy. The rest of the attributes are custom attrs. Weird.
custom1 = "customval1"
Expand Down Expand Up @@ -139,7 +139,7 @@ resource "apigee_developer" "helloworld_developer" {
last_name = "thelloworld1" # required
user_name = "helloworld1" # required
attributes { # optional
attributes = { # optional
DisplayName = "my_awesome_app_updated"
Notes = "notes_for_developer_app_updated"
custom_attribute_name = "custom_attribute_value"
Expand All @@ -156,7 +156,7 @@ resource "apigee_developer_app" "helloworld_developer_app" {
callback_url = "https://www.google.com" # optional
key_expires_in = 2592000000 # optional
attributes { # optional
attributes = { # optional
DisplayName = "my_awesome_developer_app"
Notes = "notes_for_awesome_developer_app"
custom_attribute_name = "custom_attribute_value"
Expand All @@ -168,7 +168,7 @@ resource "apigee_company" "helloworld_company" {
name = "helloworld_company" # required
display_name = "some longer description for company" # optional
attributes { # optional
attributes = { # optional
DisplayName = "my-awesome-company"
}
}
Expand Down
16 changes: 14 additions & 2 deletions apigee/resource_api_proxy_deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,29 @@ func testAccCheckProxyDeploymentExists(n string, name string) resource.TestCheck
}

const testAccCheckProxyDeploymentConfigRequired = `
resource "apigee_api_proxy" "helloworld" {
name = "helloworld"
bundle = "test-fixtures/helloworld_proxy.zip"
bundle_sha = "${filebase64sha256("test-fixtures/helloworld_proxy.zip")}"
}
resource "apigee_api_proxy_deployment" "foo_api_proxy_deployment" {
proxy_name = "helloworld"
proxy_name = "${apigee_api_proxy.helloworld.name}"
org = "zambien-trial"
env = "test"
revision = "1"
}
`

const testAccCheckProxyDeploymentConfigUpdated = `
resource "apigee_api_proxy" "helloworld" {
name = "helloworld"
bundle = "test-fixtures/helloworld_proxy.zip"
bundle_sha = "${filebase64sha256("test-fixtures/helloworld_proxy.zip")}"
}
resource "apigee_api_proxy_deployment" "foo_api_proxy_deployment" {
proxy_name = "helloworld"
proxy_name = "${apigee_api_proxy.helloworld.name}"
org = "zambien-trial"
env = "test"
revision = "2"
Expand Down
4 changes: 2 additions & 2 deletions apigee/resource_api_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ const testAccCheckProxyConfigRequired = `
resource "apigee_api_proxy" "foo_api_proxy" {
name = "foo_proxy_terraformed"
bundle = "test-fixtures/helloworld_proxy.zip"
bundle_sha = "${base64sha256(file("test-fixtures/helloworld_proxy.zip"))}"
bundle_sha = "${filebase64sha256("test-fixtures/helloworld_proxy.zip")}"
}
`

const testAccCheckProxyConfigUpdated = `
resource "apigee_api_proxy" "foo_api_proxy" {
name = "foo_proxy_terraformed_updated"
bundle = "test-fixtures/helloworld_proxy.zip"
bundle_sha = "${base64sha256(file("test-fixtures/helloworld_proxy.zip"))}"
bundle_sha = "${filebase64sha256("test-fixtures/helloworld_proxy.zip")}"
}
`

Expand Down
2 changes: 1 addition & 1 deletion apigee/resource_company_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const testAccCheckCompanyConfigUpdated = `
resource "apigee_company" "foo_company" {
name = "foo_company_updated"
display_name = "some longer foo description for foo company"
attributes {
attributes = {
DisplayName = "my-awesome-foo-company"
}
}
Expand Down
2 changes: 1 addition & 1 deletion apigee/resource_developer_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestAccDeveloperApp_Updated(t *testing.T) {
resource.TestCheckResourceAttr(
"apigee_developer_app.foo_developer_app", "scopes.0", "READ"),
resource.TestCheckResourceAttr(
"apigee_developer_app.foo_developer_app", "callback_url", "https://www.google.com"),
"apigee_developer_app.foo_developer_app", "callback_url", "http://www.google.com"),
//match integer
resource.TestMatchResourceAttr(
"apigee_developer_app.foo_developer_app", "key_expires_in", regexp.MustCompile("^[-+]?\\d+$")),
Expand Down
2 changes: 1 addition & 1 deletion apigee/resource_developer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ resource "apigee_developer" "foo_developer" {
first_name = "foo-updated"
last_name = "test-updated"
user_name = "footest-updated"
attributes {
attributes = {
DisplayName = "my-awesome-app-updated"
Notes = "notes_for_developer_app_updated"
custom_attribute_name = "custom_attribute_value_updated"
Expand Down
16 changes: 14 additions & 2 deletions apigee/resource_product_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,29 +89,41 @@ func testAccCheckProductExists(n string, name string) resource.TestCheckFunc {
}

const testAccCheckProductConfigRequired = `
resource "apigee_api_proxy" "helloworld" {
name = "helloworld"
bundle = "test-fixtures/helloworld_proxy.zip"
bundle_sha = "${filebase64sha256("test-fixtures/helloworld_proxy.zip")}"
}
resource "apigee_product" "foo_product" {
name = "foo_product"
approval_type = "manual"
}
`

const testAccCheckProductConfigUpdated = `
resource "apigee_api_proxy" "helloworld" {
name = "helloworld"
bundle = "test-fixtures/helloworld_proxy.zip"
bundle_sha = "${filebase64sha256("test-fixtures/helloworld_proxy.zip")}"
}
resource "apigee_product" "foo_product" {
name = "foo_product_updated"
display_name = "foo_product_updated_different"
description = "no one ever fills this out"
approval_type = "auto"
api_resources = ["/**"]
proxies = ["helloworld"]
proxies = ["${apigee_api_proxy.helloworld.name}"]
quota = "1000"
quota_interval = "2"
quota_time_unit = "minute"
scopes = ["READ"]
attributes {
attributes = {
access = "public"
custom1 = "customval1"
Expand Down
8 changes: 4 additions & 4 deletions apigee/resource_target_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestAccTargetServer_Updated(t *testing.T) {
resource.TestCheckResourceAttr(
"apigee_target_server.foo", "name", "foo_target_server"),
resource.TestCheckResourceAttr(
"apigee_target_server.foo", "host", "http://some.api.com"),
"apigee_target_server.foo", "host", "http://google.com"),
resource.TestCheckResourceAttr(
"apigee_target_server.foo", "env", "test"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -87,7 +87,7 @@ func TestAccTargetServer_CreateWithoutSSLInfo(t *testing.T) {
resource.TestCheckResourceAttr(
"apigee_target_server.foo", "name", "foo_target_server"),
resource.TestCheckResourceAttr(
"apigee_target_server.foo", "host", "https://some.api.com"),
"apigee_target_server.foo", "host", "http://google.com"),
resource.TestCheckResourceAttr(
"apigee_target_server.foo", "env", "test"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -126,7 +126,7 @@ func testAccCheckTargetServerExists(n string, name string) resource.TestCheckFun
const testAccCheckTargetServerConfigRequired = `
resource "apigee_target_server" "foo" {
name = "foo_target_server"
host = "http://some.api.com"
host = "http://google.com"
env = "test"
enabled = true
port = 80
Expand Down Expand Up @@ -163,7 +163,7 @@ resource "apigee_target_server" "foo" {
const testAccCheckTargetServerConfigWithoutSSLInfo = `
resource "apigee_target_server" "foo" {
name = "foo_target_server"
host = "https://some.api.com"
host = "http://google.com"
env = "test"
enabled = true
port = 80
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/gofrs/uuid v3.2.0+incompatible
github.com/hashicorp/terraform v0.12.8
github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0 // indirect
github.com/zambien/go-apigee-edge v0.0.0-20190402181302-7d41f53971c1
github.com/zambien/go-apigee-edge v0.0.0-20191101145538-e45257f96262
)

replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q
github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/zambien/go-apigee-edge v0.0.0-20190402181302-7d41f53971c1 h1:YxZab+Dr14skCRI0F/UOk1iAqqtFWU9hq+hf6Gz1Ehc=
github.com/zambien/go-apigee-edge v0.0.0-20190402181302-7d41f53971c1/go.mod h1:igEzqjjI3Gv0va8lXB1fyhuoqe4xT+QsKUtWTf273r8=
github.com/zambien/go-apigee-edge v0.0.0-20191101145538-e45257f96262 h1:QD/u8LKwyG+Ac9Vd/EfwMNcbNdBX658a9EpFz+lf2bI=
github.com/zambien/go-apigee-edge v0.0.0-20191101145538-e45257f96262/go.mod h1:igEzqjjI3Gv0va8lXB1fyhuoqe4xT+QsKUtWTf273r8=
github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty v1.0.1-0.20190708163926-19588f92a98f h1:sq2p8SN6ji66CFEQFIWLlD/gFmGtr5hBrOzv5nLlGfA=
github.com/zclconf/go-cty v1.0.1-0.20190708163926-19588f92a98f/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
Expand Down

0 comments on commit 34157fa

Please sign in to comment.