Sourav
Sourav

Reputation: 49

Terraform plan output shows 2 update in place

I ran terraform import for one SQL server & one SQL database. While running the terraform plan I see message 2 to change. But I am not able to find the change in the below plan. It's not showing any null value. I am not sure what is the change to be in effect.

Here is the information about the terraform plan:

    # azurerm_sql_database.sqldb[0m will be updated in-place[0m[0m
    
    2020-12-24T16:01:39.1426150Z [0m  [33m~[0m[0m resource "azurerm_sql_database" "sqldb" {
    
    2020-12-24T16:01:39.1426881Z         [1m[0mcollation[0m[0m   = "SQL_Latin1_General_CP1_CI_AS"
    
    2020-12-24T16:01:39.1427865Z       [32m+[0m [0m[1m[0mcreate_mode[0m[0m   = "Default"
    
    2020-12-24T16:01:39.1428801Z         [1m[0mcreation_date[0m[0m     = "2020-07-06T15:20:16.947Z"
    
    2020-12-24T16:01:39.1429581Z         [1m[0mdefault_secondary_location[0m[0m       = "East US"
    
    2020-12-24T16:01:39.1430271Z         [1m[0medition[0m[0m    = "GeneralPurpose"
    
    2020-12-24T16:01:39.1474446Z  [1m[0mextended_auditing_policy[0m[0m = [
    2020-12-24T16:01:39.1481428Z             {
    2020-12-24T16:01:39.1482165Z                 retention_in_days                       = 0
    
    2020-12-24T16:01:39.1483057Z                 storage_account_access_key              = ""
    
    2020-12-24T16:01:39.1483679Z                 storage_account_access_key_is_secondary = false
    
    2020-12-24T16:01:39.1484293Z                 storage_endpoint                        = ""
    
    2020-12-24T16:01:39.1486841Z             },
    
    2020-12-24T16:01:39.1487323Z         ]
    2020-12-24T16:01:39.1488663Z    [1m[0mid[0m[0m = "/subscriptions/78bc4018-84c1-4906-94c9-c1d5b84cc907/resourceGroups/rg-us-wus-dev-1/providers/Microsoft.Sql/servers/sql-us-wus-dev/databases/sqldb-us-wus-dev"
    
    2020-12-24T16:01:39.1491489Z         [1m[0mlocation[0m[0m                = "westus"
    
    2020-12-24T16:01:39.1492160Z         [1m[0mmax_size_bytes[0m[0m          = "34359738368"
    
    2020-12-24T16:01:39.1492790Z         [1m[0mname[0m[0m                   = "sqldb-us-wus-dev"
    
    2020-12-24T16:01:39.1493436Z         [1m[0mread_scale[0m[0m             = false
    
    2020-12-24T16:01:39.1494194Z         [1m[0mrequested_service_objective_id[0m[0m   = "f21733ad-9b9b-4d4e-a4fa-94a133c41718"
    
    2020-12-24T16:01:39.1495057Z         [1m[0mrequested_service_objective_name[0m[0m = "GP_Gen5_2"
    
    2020-12-24T16:01:39.1495733Z         [1m[0mresource_group_name[0m[0m              = "rg-us-wus-dev-1"
    
    2020-12-24T16:01:39.1496437Z         [1m[0mserver_name[0m[0m                      = "sql-us-wus-dev"
    
    2020-12-24T16:01:39.1497190Z         [1m[0mtags[0m[0m                             = {}
    
    2020-12-24T16:01:39.1497905Z         [1m[0mzone_redundant[0m[0m                   = false
    2020-12-24T16:01:39.1498494Z 
    2020-12-24T16:01:39.1498890Z         threat_detection_policy {
    2020-12-24T16:01:39.1499416Z             [1m[0mdisabled_alerts[0m[0m      = []
    
    2020-12-24T16:01:39.1500074Z             [1m[0memail_account_admins[0m[0m = "Disabled"
    
    2020-12-24T16:01:39.1500670Z             [1m[0memail_addresses[0m[0m      = []
    
    2020-12-24T16:01:39.1501143Z             [1m[0mretention_days[0m[0m       = 0
    
    2020-12-24T16:01:39.1501574Z             [1m[0mstate[0m[0m                = "Disabled"
    
    2020-12-24T16:01:39.1502069Z             [1m[0muse_server_default[0m[0m   = "Disabled"
    
    2020-12-24T16:01:39.1502411Z         }
    2020-12-24T16:01:39.1502594Z 
    2020-12-24T16:01:39.1502851Z         timeouts {}
    2020-12-24T16:01:39.1503112Z     }
    2020-12-24T16:01:39.1503279Z 
    2020-12-24T16:01:39.1503637Z [1m  # azurerm_sql_server.sqlserver[0m will be updated in-place[0m[0m
    2020-12-24T16:01:39.1504503Z [0m  [33m~[0m[0m resource "azurerm_sql_server" "sqlserver" {
    
    2020-12-24T16:01:39.1504979Z         [1m[0madministrator_login[0m[0m      = "sqladmin"
    
    2020-12-24T16:01:39.1505483Z  [32m+[0m [0m[1m[0madministrator_login_password[0m[0m = (sensitive value)
    
    2020-12-24T16:01:39.1506007Z         [1m[0mconnection_policy[0m[0m            = "Default"
    
    2020-12-24T16:01:39.1506451Z         [1m[0mextended_auditing_policy[0m[0m     = [
    2020-12-24T16:01:39.1506802Z             {
    2020-12-24T16:01:39.1507156Z                 retention_in_days                       = 0
    
    2020-12-24T16:01:39.1507611Z                 storage_account_access_key              = ""
    
    2020-12-24T16:01:39.1508130Z                 storage_account_access_key_is_secondary = false
    
    2020-12-24T16:01:39.1508695Z           storage_endpoint  = "https://stuxxwusdev.blob.core.windows.net/"
    2020-12-24T16:01:39.1509179Z             },
    
    2020-12-24T16:01:39.1509442Z         ]
    
    2020-12-24T16:01:39.1510082Z    [1m[0mfully_qualified_domain_name[0m[0m  = "sql-us-wus-dev.database.windows.net"
    
    2020-12-24T16:01:39.1511114Z         [1m[0mid[0m[0m  = "/subscriptions/78bc4018-84c1-4906-94c9-c1d5b84cc907/resourceGroups/rg-us-wus-dev-1/providers/Microsoft.Sql/servers/sql-us-wus-dev"
    
    2020-12-24T16:01:39.1511895Z         [1m[0mlocation[0m[0m                     = "westus"
    
    2020-12-24T16:01:39.1512415Z         [1m[0mname[0m[0m                         = "sql-us-wus-dev"
    
    2020-12-24T16:01:39.1512991Z         [1m[0mresource_group_name[0m[0m          = "wus-dev"
    
    2020-12-24T16:01:39.1513500Z         [1m[0mtags[0m[0m                         = {}
    
    2020-12-24T16:01:39.1514036Z         [1m[0mversion[0m[0m                      = "12.0"
    2020-12-24T16:01:39.1514327Z 
    2020-12-24T16:01:39.1514602Z         timeouts {}
    2020-12-24T16:01:39.1514890Z     }

Upvotes: 2

Views: 11631

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28244

There are terraform plan symbol meanings, refer to this.

  • + create
  • - destroy
  • -/+ replace (destroy and then create, or vice-versa if create-before-destroy is used)
  • ~ update in-place i.e. change without destroying
  • <= read

You can check the ~ mark line to check that the specific attributes will be updated in place.

For example, it will update the retention_in_days from 6 to 0 in the terraform template code.

enter image description here

Please let me know if you still have any questions.

Upvotes: 4

Related Questions