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

azurerm_cosmosdb_sql_container - support for default_ttl #5492

Merged
merged 4 commits into from
Jan 25, 2020
Merged

azurerm_cosmosdb_sql_container - support for default_ttl #5492

merged 4 commits into from
Jan 25, 2020

Conversation

aqche
Copy link
Contributor

@aqche aqche commented Jan 23, 2020

Fixes #5451

Adds the default_ttl argument for the azurerm_cosmosdb_sql_container resource.

Also, fixes a bug causing resource updates to fail since id.Container was being passed in instead of id.ResourceGroup for one of the function arguments.

--- PASS: TestAccAzureRMCosmosDbSqlContainer_complete (1108.43s)
--- PASS: TestAccAzureRMCosmosDbSqlContainer_basic (1109.64s)
--- PASS: TestAccAzureRMCosmosDbSqlContainer_update (1348.86s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cosmos/tests        1348.94

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 for the pr @aqche, this LGTM! 👍

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.

It looks like the tests are failing? 🤔

Test Failed

------- Stdout: -------
=== RUN   TestAccAzureRMCosmosDbSqlContainer_basic
=== PAUSE TestAccAzureRMCosmosDbSqlContainer_basic
=== CONT  TestAccAzureRMCosmosDbSqlContainer_basic
--- FAIL: TestAccAzureRMCosmosDbSqlContainer_basic (1293.56s)
    testing.go:569: Step 0 error: Check failed: 1 error occurred:
        	* Check 1/1 error: Bad: Get on cosmosAccountsClient: documentdb.DatabaseAccountsClient#GetSQLContainer: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.DocumentDB/databaseAccounts/acctest-200123162126243972' under resource group 'acctestRG-cosmos-200123162126243972' was not found."

@aqche
Copy link
Contributor Author

aqche commented Jan 24, 2020

hmm strange, i'm able to run the tests w/o any issues... i'll poke around and see if I can discover anything.

=== RUN   TestAccAzureRMCosmosDbSqlContainer_basic
=== PAUSE TestAccAzureRMCosmosDbSqlContainer_basic
=== RUN   TestAccAzureRMCosmosDbSqlContainer_complete
=== PAUSE TestAccAzureRMCosmosDbSqlContainer_complete
=== RUN   TestAccAzureRMCosmosDbSqlContainer_update
=== PAUSE TestAccAzureRMCosmosDbSqlContainer_update
=== CONT  TestAccAzureRMCosmosDbSqlContainer_basic
=== CONT  TestAccAzureRMCosmosDbSqlContainer_update
=== CONT  TestAccAzureRMCosmosDbSqlContainer_complete
--- PASS: TestAccAzureRMCosmosDbSqlContainer_basic (1111.22s)
--- PASS: TestAccAzureRMCosmosDbSqlContainer_complete (1149.33s)
--- PASS: TestAccAzureRMCosmosDbSqlContainer_update (1284.63s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cosmos/tests        1284.945s

@ghost ghost removed the waiting-response label Jan 24, 2020
@aqche
Copy link
Contributor Author

aqche commented Jan 24, 2020

update, able to reproduce the failing tests after merging latest master into my branch. will look into the cause.

@tombuildsstuff tombuildsstuff modified the milestones: v1.42.0, v1.43.0 Jan 24, 2020
@@ -127,7 +129,7 @@ func testCheckAzureRMCosmosDbSqlContainerExists(resourceName string) resource.Te
resourceGroup := rs.Primary.Attributes["resource_group_name"]
database := rs.Primary.Attributes["database_name"]

resp, err := client.GetSQLContainer(ctx, resourceGroup, database, account, name)
resp, err := client.GetSQLContainer(ctx, resourceGroup, account, database, name)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

turns out the reason the tests were failing was because the inputs were incorrect. it passed before b/c until recently database and account used the same naming format.

@katbyte
Copy link
Collaborator

katbyte commented Jan 25, 2020

Reran the tests and they passed, thanks @aqche

@katbyte katbyte modified the milestones: v1.43.0, v1.42.0 Jan 25, 2020
@katbyte katbyte merged commit 8e3b507 into hashicorp:master Jan 25, 2020
katbyte added a commit that referenced this pull request Jan 25, 2020
@aqche aqche deleted the azurerm_cosmosdb_sql_container_default_ttl branch January 25, 2020 04:05
@ghost
Copy link

ghost commented Jan 27, 2020

This has been released in version 1.42.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 = "~> 1.42.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 28, 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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 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.

azurerm_cosmosdb_sql_container needs TTL settings
3 participants