terraform: Fixing type references
terraform: fixing errors
terraform: porting to new state