Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions mmv1/products/apigee/Organization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ sweeper:
custom_code:
encoder: 'templates/terraform/encoders/apigee_organization.go.tmpl'
custom_import: 'templates/terraform/custom_import/apigee_organization.go.tmpl'
test_check_destroy: 'templates/terraform/custom_check_destroy/apigee_organization.go.tmpl'
examples:
- name: 'apigee_organization_cloud_basic'
exclude_test: true
Expand All @@ -59,6 +60,7 @@ examples:
billing_account: 'BILLING_ACCT'
ignore_read_extra:
- 'properties'
- 'addons_config'
exclude_docs: true
external_providers: ["time"]
- name: 'apigee_organization_cloud_basic_disable_vpc_peering'
Expand All @@ -72,6 +74,7 @@ examples:
billing_account: 'BILLING_ACCT'
ignore_read_extra:
- 'properties'
- 'addons_config'
exclude_docs: true
external_providers: ["time"]
- name: 'apigee_organization_cloud_basic_data_residency'
Expand All @@ -85,6 +88,7 @@ examples:
billing_account: 'BILLING_ACCT'
ignore_read_extra:
- 'properties'
- 'addons_config'
exclude_docs: true
external_providers: ["time"]
- name: 'apigee_organization_cloud_full'
Expand All @@ -102,6 +106,7 @@ examples:
billing_account: 'BILLING_ACCT'
ignore_read_extra:
- 'properties'
- 'addons_config'
exclude_docs: true
external_providers: ["time"]
- name: 'apigee_organization_cloud_full_disable_vpc_peering'
Expand All @@ -119,6 +124,7 @@ examples:
billing_account: 'BILLING_ACCT'
ignore_read_extra:
- 'properties'
- 'addons_config'
exclude_docs: true
external_providers: ["time"]
- name: 'apigee_organization_retention_test'
Expand Down Expand Up @@ -262,6 +268,69 @@ properties:
- name: 'value'
type: String
description: Value of the property.
- name: 'addonsConfig'
type: NestedObject
description: |
Addon configurations of the Apigee organization.
default_from_api: true
properties:
- name: 'advancedApiOpsConfig'
type: NestedObject
description: Configuration for the Advanced API Ops add-on.
properties:
- name: 'enabled'
type: Boolean
description:
Flag that specifies whether the Advanced API Ops add-on is enabled.
send_empty_value: true
- name: 'integrationConfig'
type: NestedObject
description: Configuration for the Integration add-on.
properties:
- name: 'enabled'
type: Boolean
description:
Flag that specifies whether the Integration add-on is enabled.
send_empty_value: true
- name: 'monetizationConfig'
type: NestedObject
description: Configuration for the Monetization add-on.
properties:
- name: 'enabled'
type: Boolean
description:
Flag that specifies whether the Monetization add-on is enabled.
send_empty_value: true
- name: 'apiSecurityConfig'
type: NestedObject
description: Configuration for the API Security add-on.
properties:
- name: 'enabled'
type: Boolean
description:
Flag that specifies whether the API security add-on is enabled.
send_empty_value: true
- name: 'expiresAt'
type: String
description:
Time at which the API Security add-on expires in milliseconds since epoch.
If unspecified, the add-on will never expire.
output: true
- name: 'connectorsPlatformConfig'
type: NestedObject
description: Configuration for the Connectors Platform add-on.
properties:
- name: 'enabled'
type: Boolean
description:
Flag that specifies whether the Connectors Platform add-on is enabled.
send_empty_value: true
- name: 'expiresAt'
type: String
description:
Time at which the Connectors Platform add-on expires in milliseconds since epoch.
If unspecified, the add-on will never expire.
output: true
- name: 'apigeeProjectId'
type: String
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
config := acctest.GoogleProviderConfig(t)

url, err := tpgresource.ReplaceVarsForTest(config, rs, "{{"{{"}}ApigeeBasePath{{"}}"}}organizations/{{"{{"}}name{{"}}"}}")
if err != nil {
return err
}

billingProject := ""

if config.BillingProject != "" {
billingProject = config.BillingProject
}

// Apigee Organization deletion is asynchronous. Poll until the org is fully
// deleted (404) or confirmed to be in a terminal DELETING state.
deleted := false
deadline := time.Now().Add(10 * time.Minute)
for time.Now().Before(deadline) {
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "GET",
Project: billingProject,
RawURL: url,
UserAgent: config.UserAgent,
})
if err != nil {
// 404 (or any error) means the org is gone.
deleted = true
break
}
// If the org is in DELETING state, deletion is in progress — acceptable.
if state, ok := res["state"].(string); ok && state == "DELETING" {
deleted = true
break
}
time.Sleep(30 * time.Second)
}
if !deleted {
return fmt.Errorf("ApigeeOrganization still exists at %s after waiting", url)
}
Loading