# Error: Invalid attribute value: the given value is not suitable for attribute "tags": string values must not be null

- **ID:** `terraform/invalid-nullable-attribute`
- **Domain:** terraform
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

A resource attribute that expects a string or map of strings is receiving a null value, often from a conditional expression or variable that evaluates to null.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Terraform 1.3.0 | active | — | — |
| Terraform 1.4.0 | active | — | — |
| Terraform 1.5.0 | active | — | — |

## Workarounds

1. **Use the coalesce() function to provide a default non-null value when the variable is null.** (90% success)
   ```
   Use the coalesce() function to provide a default non-null value when the variable is null.
   ```
2. **Use conditional logic with try() and type constraints to ensure null values are replaced. Alternatively, define the variable with a default non-null value.** (85% success)
   ```
   Use conditional logic with try() and type constraints to ensure null values are replaced. Alternatively, define the variable with a default non-null value.
   ```
3. **If the attribute is optional and can be omitted, use a dynamic block or conditional to skip it entirely when the value is null.** (80% success)
   ```
   If the attribute is optional and can be omitted, use a dynamic block or conditional to skip it entirely when the value is null.
   ```

## Dead Ends

- **** — Some AWS services reject empty strings for required tags. The provider may still throw an error if the service requires non-empty values. (60% fail)
- **** — If the attribute is required, Terraform will error with 'Required attribute is not set'. Removing it doesn't fix the null issue. (85% fail)
- **** — try() only catches errors, not null values. If the expression evaluates to null without error, try() returns null. (75% fail)
