Reputation: 2031
I'm working on importing one of our rds instance into terraform.
Terraform plan shows ~ and -
~ maintenance_window = "sat:06:10-sat:06:40" -> (known after apply)
- max_allocated_storage = 0 -> null
Both of these values are not defined in the configuration, I would like to understand, why it is showing - and Do we configure null variables also in the module?
Using Terraform 0.12.28
Upvotes: 0
Views: 544
Reputation: 322
Basically:
~
the value is in the state and is changing after the plan-
the value is in the state and you are trying to remove it (null
value)maintenance_window
is showing ~
because its value is going to change, and in your specific case its value is computed and hence known after applying the changes. From the docs:
maintenance_window - (Optional) The window to perform maintenance in. Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00". See RDS Maintenance Window docs for more information.
If that window is fine for you, you can specify that as an argument or let Terraform change it to its default value.
max_allocated_storage
is showing -
because when you imported the resource in the state, it imported all Terraform known arguments, but you are not specifying that one. In particular from the docs:
max_allocated_storage - (Optional) When configured, the upper limit to which Amazon RDS can automatically scale the storage of the DB instance. Configuring this will automatically ignore differences to allocated_storage. Must be greater than or equal to allocated_storage or 0 to disable Storage Autoscaling.
In this case you can set max_allocated_storage = 0
in order to not show any change in the plan for that argument
Upvotes: 2