Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Azure Cosmos DB API to to 2020-04-01 from 2015-04-08 #7597

Merged
merged 43 commits into from Jul 20, 2020
Merged

Update Azure Cosmos DB API to to 2020-04-01 from 2015-04-08 #7597

merged 43 commits into from Jul 20, 2020

Conversation

marc-sensenich
Copy link
Contributor

@marc-sensenich marc-sensenich commented Jul 6, 2020

Forked from #6253 and brings the Cosmos DB API up to 2020-04-01

Closes #6253

Acceptance Test Statuses (65/68 passing)

--- PASS: TestAccDataSourceAzureRMCosmosDBAccount_basic (1215.08s)
--- PASS: TestAccAzureRMCosmosDbMongoCollection_withIndex (1245.88s)
--- PASS: TestAccAzureRMCosmosDbMongoDatabase_complete (1364.02s)
--- PASS: TestAccAzureRMCosmosDbMongoDatabase_basic (1365.37s)
--- PASS: TestAccAzureRMCosmosDbSqlDatabase_update (1443.23s)
--- PASS: TestAccAzureRMCosmosDbSqlContainer_basic (1549.32s)
--- PASS: TestAccAzureRMCosmosDbMongoCollection_throughput (1585.49s)
--- PASS: TestAccAzureRMCosmosDbMongoCollection_complete (1425.26s)
--- PASS: TestAccAzureRMCosmosDbMongoCollection_update (1493.49s)
--- PASS: TestAccAzureRMCosmosDbMongoCollection_basic (1428.51s)
--- PASS: TestAccAzureRMCosmosDbGremlinGraph_customConflictResolutionPolicy (1346.60s)
--- PASS: TestAccAzureRMCosmosDbGremlinGraph_indexPolicy (1455.86s)
--- PASS: TestAccAzureRMCosmosDbGremlinGraph_update (1754.62s)
--- PASS: TestAccAzureRMCosmosDbGremlinGraph_requiresImport (1580.51s)
--- PASS: TestAccAzureRMCosmosGremlinDatabase_complete (1471.62s)
--- PASS: TestAccAzureRMCosmosDbGremlinGraph_basic (1515.33s)
--- PASS: TestAccAzureRMCosmosGremlinDatabase_requiresImport (1408.04s)
--- PASS: TestAccAzureRMCosmosGremlinDatabase_basic (1452.88s)
--- PASS: TestAccAzureRMCosmosDbCassandraKeyspace_complete (1275.45s)
--- PASS: TestAccAzureRMCosmosDbCassandraKeyspace_update (1591.40s)
--- PASS: TestAccAzureRMCosmosDbCassandraKeyspace_basic (1332.76s)
--- PASS: TestAccAzureRMCosmosDBAccount_vNetFilters (1244.61s)
--- PASS: TestAccAzureRMCosmosDBAccount_capabilities_mongoEnableDocLevelTTL (1180.26s)
--- PASS: TestAccAzureRMCosmosDBAccount_capabilities_MongoDBv34 (1179.94s)
--- PASS: TestAccAzureRMCosmosDBAccount_capabilities_EnableMongo (1270.57s)
--- PASS: TestAccAzureRMCosmosDBAccount_capabilities_EnableTable (1269.07s)
--- PASS: TestAccAzureRMCosmosDBAccount_capabilities_EnableGremlin (1089.69s)
--- PASS: TestAccAzureRMCosmosDBAccount_geoLocationsUpdate (2214.48s)
--- PASS: TestAccAzureRMCosmosDBAccount_capabilitiesUpdate (2373.06s)
--- PASS: TestAccAzureRMCosmosDBAccount_capabilitiesAdd (2494.84s)
--- PASS: TestAccAzureRMCosmosDBAccount_capabilities_EnableAggregationPipeline (1181.35s)
--- PASS: TestAccAzureRMCosmosDBAccount_capabilities_EnableCassandra (1269.86s)
--- PASS: TestAccAzureRMCosmosDbTable_update (1532.70s)
--- PASS: TestAccAzureRMCosmosDbSqlDatabase_basic (1182.07s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_mongo_eventual (1059.57s)
--- PASS: TestAccAzureRMCosmosDbSqlContainer_update (1506.18s)
--- PASS: TestAccAzureRMCosmosDbTable_basic (1333.15s)
--- PASS: TestAccAzureRMCosmosDbSqlContainer_complete (1245.41s)
--- PASS: TestAccAzureRMCosmosDBAccount_requiresImport (1125.22s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_parse_strong (1160.62s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_parse_session (1089.68s)
--- PASS: TestAccAzureRMCosmosDBAccount_updateConsistency_mongo (2054.74s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_parse_eventual (1001.24s)
--- PASS: TestAccAzureRMCosmosDBAccount_complete_parse (2743.53s)
--- PASS: TestAccAzureRMCosmosDBAccount_complete_global (2632.43s)
--- PASS: TestAccAzureRMCosmosDBAccount_updateConsistency_global (2206.40s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_parse_consistentPrefix (1091.95s)
--- PASS: TestAccAzureRMCosmosDBAccount_complete_mongo (2621.04s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_parse_boundedStaleness (1151.84s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_mongo_strong (1210.16s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_global_strong (1062.27s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_mongo_boundedStaleness (1211.15s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_mongo_session (1315.38s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_global_session (1153.51s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_mongo_consistentPrefix (1421.35s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_global_eventual (1060.34s)
--- PASS: TestAccAzureRMCosmosDBAccount_failover_geoReplicated (1962.85s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_global_consistentPrefix (1038.45s)
--- PASS: TestAccAzureRMCosmosDBAccount_basic_global_boundedStaleness (1121.90s)
--- PASS: TestAccAzureRMCosmosDBAccount_failover_eventualConsistency (1209.89s)
--- PASS: TestAccAzureRMCosmosDBAccount_failover_session (1208.54s)
--- PASS: TestAccAzureRMCosmosDBAccount_failover_strong (1237.73s)
--- PASS: TestAccAzureRMCosmosDBAccount_failover_mongoDB (1118.35s)
--- PASS: TestAccAzureRMCosmosDBAccount_failover_boundedStalenessComplete (1088.26s)
--- PASS: TestAccAzureRMCosmosDBAccount_failover_boundedStaleness (1148.06s)
--- PASS: TestAccDataSourceAzureRMCosmosDBAccount_complete (2566.57s)
--- FAIL: TestAccAzureRMCosmosDBAccount_update_global (4025.25s)
--- FAIL: TestAccAzureRMCosmosDBAccount_update_parse (1672.24s)
--- FAIL: TestAccAzureRMCosmosDBAccount_update_mongo (1664.29s)

@marc-sensenich
Copy link
Contributor Author

marc-sensenich commented Jul 10, 2020

Current outstanding issues

  • How to handle max_staleness_prefix and max_interval_in_seconds. These aren't updated except when the consistency policy is BoundedStaleness, therefore the state will always differ from the resource for these 2 attributes unless the default consistency policy is BoundedStaleness or being changed to BoundedStaleness
    • Resolved using DiffSuppressFunc
  • Figuring out the correct API parameters for handling the changing of EnableMultipleRWriteLocations. I'm working with the REST API to figure that out
    • Resolved the issue of me incorrectly treating a PUT as a PATCH.

@marc-sensenich
Copy link
Contributor Author

marc-sensenich commented Jul 13, 2020

@katbyte this is ready for review, there are 3 acceptance tests that are failing with the following message which seems to be outside of the scope of this PR

--- FAIL: TestAccAzureRMCosmosDBAccount_update_global (4025.25s)
--- FAIL: TestAccAzureRMCosmosDBAccount_update_parse (1672.24s)
--- FAIL: TestAccAzureRMCosmosDBAccount_update_mongo (1664.29s)

All of the messages failures a similar error during teardown, which seems to be a deletion timing error

--- FAIL: TestAccAzureRMCosmosDBAccount_update_parse (4070.12s)
    testing.go:684: Step 6 error: errors during apply:
        
        Error: Error waiting for deletion of Subnet "acctest-SN2-200713134025484552-2" (Virtual Network "acctest-VNET-200713134025484552" / Resource Group "acctestRG-cosmos-200713134025484552"): Code="InternalServerError" Message="An error occurred." Details=[]
        
        
    testing.go:745: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.
        
        Error: errors during apply: Error waiting for deletion of Subnet "acctest-SN2-200713134025484552-2" (Virtual Network "acctest-VNET-200713134025484552" / Resource Group "acctestRG-cosmos-200713134025484552"): Code="Canceled" Message="Operation was canceled." Details=[{"code":"CanceledAndSupersededDueToAnotherOperation","message":"Operation DeleteSubnetOperation (a255d104-7e31-4656-9037-47be3435154f) was canceled and superseded by operation DeleteVirtualNetworkOperation (86e82f0a-e126-491e-8bb0-6d513eddb20b)."}]
        
        State: azurerm_subnet.subnet2:
          ID = /subscriptions/redacted/resourceGroups/acctestRG-cosmos-200713134025484552/providers/Microsoft.Network/virtualNetworks/acctest-VNET-200713134025484552/subnets/acctest-SN2-200713134025484552-2
          provider = provider.azurerm
          address_prefix = 10.0.2.0/24
          address_prefixes.# = 1
          address_prefixes.0 = 10.0.2.0/24
          delegation.# = 0
          enforce_private_link_endpoint_network_policies = false
          enforce_private_link_service_network_policies = false
          name = acctest-SN2-200713134025484552-2
          resource_group_name = acctestRG-cosmos-200713134025484552
          service_endpoints.# = 1
          service_endpoints.0 = Microsoft.AzureCosmosDB
          virtual_network_name = acctest-VNET-200713134025484552
FAIL
FAIL	github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cosmos/tests	4070.157s
FAIL

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @marc-sensenich! checked and those tests have been failing on master for a while. this LGTM now 👍

@ghost
Copy link

ghost commented Jul 23, 2020

This has been released in version 2.20.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.20.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Aug 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Aug 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants