Introduction
Sometimes you want to create a group of settings where some are needed and others are not. Optional attributes let you skip some settings without breaking your configuration.
When you want to define a resource or module input that can have extra settings but doesn't always need them.
When you want to make your Terraform code flexible for different environments with different needs.
When you want to avoid errors caused by missing values that are not always required.
When you want to provide default values but allow users to override them if needed.
When you want to simplify your configuration by not forcing all attributes to be set every time.